I am using latexmk for compiling a large number of tex-files to PDF's on a Jenkins server, some of the tex-files are known to have errors in them. I would like to reduce build time as much as possible, to achieve this I have tried not to have latexmk cleanup before running (-gg) option but this gives me erroneous output on a second run.
Consider the following tex-file
\documentclass{article}
\usepackage{graphics}
\begin{document}
Trying to include missing file
\includegraphics{missing_file}
\end{document}
If I run this with
latexmk -latexoption=-interaction=nonstopmode mwe.tex
The first time it returns
<lines deleted...>
latex: Command for 'latex' gave return code 256
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs of latex/pdflatex
The second time (no errors are reported, the return code is 0)
Latexmk: This is Latexmk, John Collins, 10 Nov 2013, version: 4.39.
**** Report bugs etc to John Collins <collins at phys.psu.edu>. ****
Latexmk: All targets (mwe.dvi) are up-to-date
Is there anyway to avoid this behavior without using the -gg
option
Update:
I tried running echo X|latex -interaction=errorstopmode mwe.tex
on Ubuntu and Windows and it actually does work, i.e. it does produce any output files.
With the real tex-file though, the dvi-file is produced. I will try to come up with a MWE where this happens.
latexmk file.tex -interaction=nonstopmode -halt-on-error
, that gives me an error every time.