30

I like to use latexmk in command line this way:

latexmk -pvc -pdf -xelatex foo.tex

In the event of an error in the translation, I have to manually terminate the compilation in the command line (the letter x) and it just annoys me. Is there any way to modify the command so that when the file is saved has been translated automatically (without regard to previous error)?

0

3 Answers 3

15

You can use this:

latexmk -pvc -pdf -e "$pdflatex='xelatex %O -interaction=nonstopmode %S'" foo.tex

This is for Windows, for Linux, the following might work, but I don’t use Linux, so I don’t know if it actually works:

latexmk -pvc -pdf -e '$pdflatex=q/xelatex %O -interaction=nonstopmode %S/' foo.tex

With -e you can specify what to run as "pdflatex", and the argument you need is -interaction=nonstopmode, i.e. compile all the way no matter what.

Looking at the latexmk documentation, I thought the latexmk option -f would do exactly that, but at least on my system, it doesn’t.


Update: As promised in his comment, John Collins clarified the use of -f in the documentation:

Note: "Further processing" means the running of other programs or the rerunning of latex (etc) that would be done if no errors had occurred. If instead, or additionally, you want the latex (etc) program not to pause for user input after an error, you should arrange this by an option that is passed to the program, e.g., by latexmk’s option -interaction=nonstopmode.

0
35

A simpler solution is

latexmk -pvc -pdf -xelatex -interaction=nonstopmode foo.tex
8

Another simpler solution is:

latexmk -pvc -pdf foo.tex < /dev/null
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .