Sometimes, when I use the longtable package I get a message in the output:

Package longtable Warning: Table widths have changed. Rerun LaTeX.

I read that it can be as often as three times that XeLaTeX must be run until the message disappears. So currently my deploy script re-runs XeLaTeX until the output no longer contains the string Rerun LaTeX.

So, is this the official way (used by all packages) to detect that a re-run is necessary or is there another way like a specific return value? I can already rule out the existence of the .aux file as an indicator, because that file is never deleted.

  • 3
    The output requesting a rerun could be package-specific. For example, the default LaTeX output for an undefined reference is: "Label(s) may have changed. Rerun to get cross-references right." etarmune is another package with a slightly different yet unique "rerun message". See How can I force LyX to rebuild intermediate files for clean PDF display? AFAIK there is no specific return value. – Werner Aug 25 '13 at 4:45
  • 5
    @Werner That's probably the answer, or at least most of it. Ideas such as 'logreq` are about to provide a more regularised approach but are not widely used, hence the fact that tools such as latexmk use hashing, etc. of .aux files to work. – Joseph Wright Aug 25 '13 at 6:55
  • 1
    As Joseph said: rerun LaTeX until .aux file stops changing (but, just in case, add some limit, i.e., 5 or 10 reruns). It has worked for me so far. – Vedran Šego Aug 25 '13 at 9:46
  • So we have "Rerun LaTeX" (longtable) and "Rerun to get them right" (etaremune), the changing of the .aux file (requires at least two runs, doesn't it?) and logreq's approach. Someone should compile that in an answer. – AndreKR Aug 25 '13 at 14:26

There is no general mechanism in the LaTeX2e kernel for reporting 'rerun LaTeX' or similar to the user. As such, it is down to each package author to decide how to pass on this information. For example, the kernel will issue a message of the form

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

if there are new \label commands in the document, a model followed by the etaremune package which also uses the LaTeX warning mechanism:

LaTeX Warning: Etaremune labels have changed.
               Rerun to get them right.

However, other packages use 'info' messages, write directly to the log, etc.

The logreq package is perhaps the closes there is to a general mechanism to request rerunning. It was written by Philipp Lehman principally to pass information to the user from biblatex to request LaTeX/BibTeX/Biber runs, but is designed to be both general and to provide parsable information in the log for automated systems. Before Philipp 'vanished' from the LaTeX world, he and I had discussed briefly implementing a similar idea for LaTeX3 (expl3), and this remains on my 'to do' list. As with most things, a strong need to sort it out is most likely to get me to do it!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.