[Tex/LaTex] How to make LaTex typeset a PDF regardless of an error

errorspdf

When LaTex encounters an error in the .tex window (source) it reports the error in the console when I hit 'typeset' but does NOT produce a PDF. This is particularly distressing when I'm 40 pages into a report and can't figure out what the source of the error is. All I get is the error message and the source window. Any previous version of the compiled PDF is no longer available. I want the PDF to be produced regardless of any errors, so that I have a legible document if this happens minutes from a submission deadline. I'm using TeXShop on a mac, should I perhaps be using something else?
Many thanks

Best Answer

That's not possible. Whether TeX can continue, heavily depends on the kind of error. \batchmode or \nonstopmode can be used to let TeX continue until the TeX job is finished or aborted. But this does not say anything, whether the PDF file is generated. When an error occurs, TeX cannot clairvoyance. Sometimes the error is fatal with immediate abortion. Sometimes TeX's error recovery lets continue the job at least, but with crumbled output maybe.

Also there can be documents, which are free of any errors or warnings, but do not generate any pages, e.g.:

\documentclass{article}
\begin{document}
\end{document}

Also some dubious code can sometimes change the output mode to DVI.

Related Question