I want to use latexmk to obtain a warningsummary, but for quick updates I don't want it to run multiple passes of pdflatex.

The related discussion Make latexmk just run pdflatex once mentions the option -e "$max_repeat=N$", where N is the limit for the repetitions of pdflatex. With this it is possible to produce the error summary, possibly including an intentionally limited number of compilation passes, to get a quick update on issues for large documents.

However, I am using this setup from with editors (currently LyX), which may exhibit different behavior depending on the exit status of the process. It is therefore necessary for the exit-status to be 0, if no LaTeX errors were encountered, and non-zero otherwise.

If latexmk is stopped, because $max_repeat$ is exceeded, it will return a non-zero exit status to indicate, that the compilation isn't converged, which causes the editor to wrongly thing, that compilation errors have occurred.

Is there some method that makes latexmk

  • Run pdflatex at most once
  • Return an non-zero exit code only if pdflatex was run, and returned a non-zero exit code?

Your Answer

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

Browse other questions tagged or ask your own question.