-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latex produces empty pages after title and table of contents #2622
Comments
is it possible you try to present minimal rst source creating the problem ? |
@jfbu sorry I am not following? |
@nmat perhaps I missed something from your original report, I will check. But I can not reproduce your problem without appropriate source which I can use. (assuming this is not a MikTeX issue). |
This could be only miktex related. I am not 100% sure. Should I try to build it on linux also? |
as far as I know MikTeX is very much alike TeXLIve, in so far as packages are fetched from CTAN. It is very rare a problem is only with MikTeX. I am quite confident all packages used by Sphinx for LaTeX are the same on MikTeX and TeXLive, if both are up-to-date. It would be useful if you can reduce the problematic document to a minimal project. Because apart from concluding that pdflatex compilation presumably ended in error, I can't say anything from the fact that there are blank pages in output. |
I can make it simple really.
testing/index.rst
Ran the latexpdf and boom several pages of empty information. NOTE also that I use 2 spaces for indenting in the rst files. Build output: https://gist.github.com/nmat/273a28fbb3a406840da3d7c2c98ed84e System information: |
I did reproduce your issue following your instructions. Remove in index.rst the line above I never observed it because I have not used for a long time the quickstart script. I always copy an earlier project skeleton. Instead. Does this fix it for you ? |
It did fix the content header page not generated as blank.....but there are still other pages that are blank. :/ |
With latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
'extraclassoptions': 'openany',
} you get rid of blank pages needed by default for I observe only one blank page after first one of table of contents. This is no bug I think, but probably standard behaviour of Perhaps |
ah ok I see some code including
after table of contents in |
makes sense. Yeah I tested it. And still get 1 blank page after header and one after contents. So it did remove a lot but still kept a few blank pages. Late here also. so will continue tomorrow. If you want to talk directly to me then I am on IRC also. |
seems like |
I have possibly fixed it, can you test PR #2626 ?
latex_documents = [
(master_doc, 'testnmat.tex', 'testnmat Documentation',
'jfbu', 'manual', True),
] This way you can still have @tk0miya shouldn't default value of sixth element to |
Verified and works here. Both solutions fixes blank pages and also the extra content while still keeping html content. Nicely done! |
@nmat good to know, thanks. |
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.
Clean sphinxmanual.cls of superfluous unneeded code. And also avoid skipping blank pages if openany for bibliography and index.
Should I close the ticket? |
@nmat keep it open please until PR is reviewed and perhaps merged. I have modified it substantially, does latest version still work for you ? |
Yes the latest version works just fine. |
Will keep it open until it is commited and pushed. Nice work @jfbu |
Thanks @nmat for patience in explaining the problem and checking proposed fixes 👍 |
You are most welcome! I will try to help as much as I can with testing. |
@jfbu I think the sixth element of So it is not good for me to enable it by default |
@tk0miya yes I understand. If quickstart script wrote something I think when I first started with Sphinx I followed examples were |
Fix #2622: Latex produces empty pages after title and table of contents
When printing out this really adds no value and seeing TOC earlier is more interesting. Reference: sphinx-doc/sphinx#2622 Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
Reported before. Empty pages are created using miktex and latexpdf during make process.
Even if make goes through.
The text was updated successfully, but these errors were encountered: