7

There is a bit of discussion in related questions about automated LaTeX (re)compilation (e.g., here and here) and elsewhere on the web on rerunning the latex command in order to resolve all references.

Now how can I precisely determine from visual inspection (or a search query) in the log-file whether all references are resolved? That is, what is the precise set of messages that indicates that there are unresolved references? A regular-expression-like answer will be good.

(I know that I can mine the solutions to the above-cited SE.TeX post for an educated guess of an answer, but it seems like having an expert answer this and having that answer in one place in this forum will be useful for many people.)

1 Answers1

8

The most common, standard "rerun warning" from LaTeX is:

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

However, other messages may also occur and is most likely package dependent.

rerunfilecheck under PDFLaTeX provides you to tailor the rerun warning using \RerunFileCheck.

Werner
  • 603,163
  • My log-file contains the text "\rerunfilecheck.sty" Package: rerunfilecheck 2011/04/15 v1.7 Rerun checks for auxiliary files (HO); I think hyperref loads this. Towards the end of my log-file I get text like this: Package rerunfilecheck Info: File `.out' has not changed. (rerunfilecheck) Checksum: . Is this a definitive indication that no rerun is necessary? – Lover of Structure Sep 23 '12 at 03:21
  • 1
    From the rerunfilecheck documentation: "Since version 1.30.0 pdfTeX provides \pdfmdfivesum and \pdffilesize. These features are also available in LuaTeX, provided by package pdftexcmds. Thus this package rerunfilecheck uses these features to detect file changes. This saves the packages from keeping the whole files in memory or in file copies. The drawback are different files with the same size and the same MD5 checksum (seldom, hopefully)." – Werner Sep 23 '12 at 03:27
  • Thanks for the info - now I would say that having the same MD5 checksum for manually edited source files of identical size is a negligible practical problem (though it's good that it's being mentioned explicitly). My intended question was whether constancy of the out-file is a definitive/reliable indication of one not needing to rerun the latex command. Is it? – Lover of Structure Sep 23 '12 at 03:31
  • You're probably referring to the .log file. Even the .log file carries a time/date stamp of the compile and is therefore not "consistent". – Werner Sep 23 '12 at 03:43
  • Actually, I meant the out-file, because that one appears in my setup (with hyperref) in the output that's written to the log-file: see the "Package rerunfilecheck Info: File `.out' has not changed."-message cited in my first comment in this thread. – Lover of Structure Sep 23 '12 at 03:46
  • 1
    @user14996, constancy of the .out file means only that. There could be other files that have changed. You can keep track of a larger set of these (but not necessarily all of them), by loading rerunfilecheck with options: \usepackage[mainaux,starttoc,partaux]{rerunfilecheck} – Lev Bishop Sep 23 '12 at 03:47
  • 2
    If/when you have time, latexmk may provide a good alternative solution where you just "don't have to worry". – Brent.Longborough Sep 23 '12 at 14:42
  • You wrote: "However, other messages may also occur [...]". What are some common examples of other messages? – Lover of Structure Oct 03 '12 at 04:34
  • 1
    @user14996: See my answer in How can I force LyX to rebuild intermediate files for clean PDF display? that shows a different warning issued by etaremune. Others may also exist. – Werner Oct 07 '12 at 15:01
  • @Brent.Longborough Good to know, but if (according to the discussion in this comment thread) it is that hard for a user to definitively determine whether LaTeX has finished running, the question is how latexmk could possibly do this. – Lover of Structure Feb 25 '13 at 10:00
  • @LoverofStructure I think it's one of those computers can do lots of boring repetitive things that humans aren't good at kind of things... – Brent.Longborough Feb 25 '13 at 10:25
  • @Brent.Longborough One question is also whether it'd been determined/proven that latexmk actually definitively determines this. If this has been documented, perhaps someone familiar with this subject matter can add a link or more details here. – Lover of Structure Feb 25 '13 at 10:35