Today I discovered that if I have an error in the preamble of my tex file then Latexmk produce an error only once.
Precisely, for example if my file looks like this
\documentclass{article}
\someWrongCommand{foo}
\begin{document}
bar
\end{document}
then of course both latexmk and pdflatex produce an error in the line \someWrongCommand{foo}. But if I then compile the file with latexmk for the second time (without changing anything in my file) then letexmk just says
Latexmk: All targets (file.pdf) are up-to-date
Whats more, if I have an error in the document (not in the preamble) then latexmk shows an error all the time (not only in the first compile) as I wish.
Is it possible to make latexmk behaves like pdflatex if there is an error in a preamble? I know I can use latexmk with -g option but it is not a solution because then it always recompile everything from scratch.
I just want latexmk to handles errors in the preamble no matter in which compilation.
latexmkon the error, it won't build a PDF, and will act likepdflatexas you want. If you hitEnterto get past the errors, a PDF will be built (in your case, with the wordsfooandbarin one paragraph). If that happens, there's no way forlatexmkto know that it needs to rebuild the PDF until you make a change to the source file. – Mike Renfro Apr 17 '12 at 2:19latexmkdidn't build output file (and there is no old one!) then it always show an error. But if I previously compile my tex file and there was no error (I have an output PDF file) and then produce an error (in a preamble) thenlatexmkprint an error only once. I know it would be enough to makelatexmkremove/doesn't save output if it get an error but it behaves like this only for error in document (outside preamble). – xen Apr 17 '12 at 8:23