mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #2622 (cont.): obey openany option
This cleans up comments from sphinxmanual.cls. Memo: the logic behind the earlier sphinxmanual.cls is obscure, besides the fact that it didn't work correctly if conf.py used openany option. The parent commit corrected the implementation, but not the logic. Were it not for the log message about added blank page, there would be no need to patch \tableofcontents, because by default it will use \chapter* which does the right thing. Similarly after the end of abstract, a \chapter or \part (or \tableofcontents, once abstract is properly handled by LaTeX writer (*)), currently one seems to be contrived to use raw directive and the abstract is then after \tableofcontents) will do the right thing in case of openany. Also the \maketitle wrongly ended with \cleardoublepage, which was corrected in parent commit, but better would be that it does nothing. Indeed it is not logical for \maketitle, abstract or \tableofcontents to worry about what comes next. Anything which comes next should be a \part or \chapter which will do the right thing. (*) currently one seems to be contrived to use raw directive and the abstract is then after \tableofcontents) will do the right thing in case of openany.
This commit is contained in:
parent
78589b05ab
commit
aa31bae17a
@ -85,13 +85,7 @@
|
||||
}
|
||||
|
||||
|
||||
% Catch the end of the {abstract} environment, but here make sure the abstract
|
||||
% is followed by a blank page if the 'openright' option is used.
|
||||
|
||||
% Note added (Sphinx 1.4.4): the earlier code was wrong and in fact not really
|
||||
% needed as after an abstract there might be table of contents, part, or chapter
|
||||
% which all do the right \cleardoublepage if openright option. Besides, there
|
||||
% does not seem to be Sphinx interface for user to abstract.
|
||||
% This is only needed for the \typeout message.
|
||||
\if@openright
|
||||
\let\py@OldEndAbstract=\endabstract
|
||||
\renewcommand{\endabstract}{%
|
||||
@ -108,14 +102,7 @@
|
||||
}
|
||||
\fi
|
||||
|
||||
% This wraps the \tableofcontents macro with all the magic to get the spacing
|
||||
% right and have the right number of pages if the 'openright' option has been
|
||||
% used. This eliminates a fair amount of crud in the individual document files.
|
||||
|
||||
% Note added (Sphinx 1.4.4): code was wrong in case of openany option. Further:
|
||||
% after table of contents there will be part or chapter which by default already
|
||||
% do the right thing. Blank page code is thus here only for the extra message
|
||||
% in log.
|
||||
% Mainly for the \typeout message.
|
||||
\let\py@OldTableofcontents=\tableofcontents
|
||||
\renewcommand{\tableofcontents}{%
|
||||
% before resetting page counter, let's do the right thing.
|
||||
|
Loading…
Reference in New Issue
Block a user