When I currently compile my LaTeX document, I do it like this:
sketch figures/torus.sketch > figures/torus.tex
pdflatex $(DOKUMENT).tex -output-format=pdf # aux-files for makeindex / makeglossaries
makeindex $(DOKUMENT)
pdflatex $(DOKUMENT).tex -output-format=pdf # include index
pdflatex $(DOKUMENT).tex -output-format=pdf # include symbol table
make clean # remove intermediate files like *.log and *.aux
This takes about 245 seconds (over 4 minutes).
But quite often, when I compile the document the first time after many changes, it has some errors, e.g.
- forgetting about LaTeX issues with
#and_ - forgetting curly braces
{or} - confusing
input{figures/somefile.tex}with\includegraphics{figures/somefile.png} - forgetting to include packages
It would really be awesome if there was a fast LaTeX syntax checker. I would let the syntax checker run before the rest. If it fails, the rest will not be executed (as I do it with a Makefile, make will stop when the first error occurs). Does a LaTeX syntax checker exist? (False-negatives are ok, but there should not be any false-positives).
pdflatexthe value of$?will be zero. – Sigur Feb 09 '14 at 11:48make, but aboutpdflatex. I want it to fail (if it fails) as soon as possible. Currently, it happens often that it compiles 3 minutes and then fails because of a missing}. – Martin Thoma Feb 09 '14 at 11:52pdflatex -draftmodedo what you want? It cuts away the output phase, but does all the rest. – egreg Feb 09 '14 at 11:52pdflatex -halt-on-erroror-interaction=errorstopmode.– Sigur Feb 09 '14 at 11:59syntonlypackage mentioned in at least one solution there. – Andrew Swann Feb 09 '14 at 12:03pdflatex -halt-on-error foo.tex 1> /dev/null [[ $? -eq 1 ]] && echo "Error with pdflatex. Check TeX files." && exiton my script. – Sigur Feb 09 '14 at 12:05pdflatex -halt-on-errornorpdflatex -interaction=errorstopmodenor adding-draftmodemade it fail faster. – Martin Thoma Feb 09 '14 at 12:18tikzcode could make the process slower. – Sigur Feb 09 '14 at 13:30standalonefor the images? If they are slowing things down, putting them in external files and usingstandaloneshould speed compilation significantly because you wouldn't have to recompile thetikzcode for all pictures each time. – cfr Feb 10 '14 at 01:34