foretspaisibles / bsdowl

A highly portable build system targeting modern UNIX systems. Supports C, OCaml, TeX, METAPOST, NOWEB, M4, and more. Based on BSD Make.
http://michipili.github.io/bsdowl/
Other
102 stars 7 forks source link

Enhance the compilation strategy for LaTeX documents #147

Open foretspaisibles opened 10 years ago

foretspaisibles commented 10 years ago

As pointed out by Fabrice Rossi, David Carlisle proposed an example of LaTeX documents whose cross references are never right:

\documentclass{article}

\pagenumbering{Roman}
\begin{document}

a\clearpage b\clearpage c\clearpage

\begin{figure}[!t]
\framebox(200,430){}
\caption{a figure to take up space}
\end{figure}

Some interesting text about  something in Section \ref{x},
which starts on page \pageref{x}.

\section{zzz\label{x}}
The text of an interesting section.
\end{document}

Source: TEX:a/79699

An infinite sequences of compilations results in an infinite sequence of PDF files having a recurring cycle with two values.

The program latexmk considers that a non-pathological document can be build with no more than 5 LaTeX passes:

$max_repeat [5]
  The maximum number of times latexmk will run latex/pdflatex before deciding that there
  may be an infinite loop and that it needs to bail out, rather than rerunning latex/pdflatex
  again to resolve cross-references, etc. The default value covers all normal cases.

We may want to increase the default number of passes when processing a LaTeX document.