I script my latex build in my source build. Sometimes it happens that I get this warning when I change something:

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

I found this question. But the solution just to run the command multiple times is not really a nice solution.

Is there a way to tell pdflatex to build until the Labels and cross-references are okay?

$pdflatex --version
pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)
kpathsea version 5.0.0
Copyright 2009 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.2.46; using libpng 1.2.46
Compiled with zlib; using zlib
Compiled with poppler version 0.18.2
  • 1
    Sounds rather like tex.stackexchange.com/questions/64/… – Joseph Wright Aug 29 '14 at 14:08
  • 3
    BTW, it's possible that you never get a stable build, because a reference alternates between two sides. – Juri Robl Aug 29 '14 at 14:14
  • @JosephWright the problem I see is that every solution include a new tool (which is not possible in my case) so I need to script it my self JuriRobl: nice hint, thank you – Sir l33tname Aug 29 '14 at 14:20
  • I guess without any external tool it is not possible. You need an external tool to check if the log file contains the magic words. – Uwe Ziegenhagen Aug 29 '14 at 14:35

There are various tools which can do that, I know of latexmk (Homepage) and rubber (rubber in the TSX community blog). Basically all these tools check for the 'may have changed' string and run LaTeX again until this message does not show up anymore.

  • 1
    unfortunately, there are a few packages that are "pathological" and force the "may have changed" message interminably, so it's good to have a cutoff after, say, five runs. (i have written such a "pathological" package, but so far have failed to determine what keeps it from figuring out that everything has actually stabilized; i'll keep looking though, since this is totally impolite. but my package isn't the only one, hence the suggestion.) – barbara beeton Aug 29 '14 at 15:30

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.