18

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)?

9

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.

  • 1
    In the documentation in the next release of latexmk, I'll clarify the description of the -f option. – John Collins Jun 24 '13 at 19:10
25

A simpler solution is

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

Another simpler solution is:

latexmk -pvc -pdf foo.tex < /dev/null
  • This is much simpler than the other methods, nice! – japreiss Oct 13 '18 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.