Skip to content
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

Re-run pdflatex multiple times when generating PDFs #749

Closed
GaretJax opened this issue Mar 28, 2014 · 4 comments
Closed

Re-run pdflatex multiple times when generating PDFs #749

GaretJax opened this issue Mar 28, 2014 · 4 comments

Comments

@GaretJax
Copy link
Contributor

Currently pdflatex is run a single time (https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/doc_builder/backends/sphinx.py#L173-L210) but often LaTeX documents need additional runs to get references right.

The Makefile generated by sphinx-build -b latex runs pdflatex 5 times (https://bitbucket.org/birkenfeld/sphinx/src/6a802a4a8bd3b652a91e4effd5e3a7efe2df35bd/sphinx/texinputs/Makefile?at=default#cl-57).

RTD should emulate Sphinx's behavior as closely as possible.

@GaretJax
Copy link
Contributor Author

#296 and #295 are probably related to this as well.

@GaretJax
Copy link
Contributor Author

To check if less runs yield the same result. As PDFs are rebuilt on each push we don't want to multiply the load by a factor of 5 if it's not necessary. ;)

@GaretJax
Copy link
Contributor Author

A possible solutions is to rerun the compilation step only if instructed to do so in the output of the previous run. pdflatex outputs the following message (or similar) when an additional run is needed:

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

@mjkallen
Copy link

+1 for a quick fix of this issue. There are currently quite a few projects on RTD which suffer from it. For example:

pdflatex needs to be run at least twice as it will write a .aux file on the first run. This file contains TOC entries and page numbers for all the cross-references which get picked up in the second run and inserted into the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants