2

I'm trying to use latexmk with XeLaTeX. When I type:

latexmk.pl -xelatex -pvc -cd -auxdir=TeXAux myfile.tex

it all works fine. However I would like to use switches with XeLaTeX, such as synctex=1, and when I type:

latexmk.pl -pdflatex="xelatex --synctex=1 %O %S" -pvc -cd -auxdir=TeXAux myfile.tex

I have the following message from fontspec:

Fatal fontspec error: "cannot-use-pdftex"
The fontspecpackage requires either XeTeX or LuaTeX to function.
&c.

What did I not understand?

2
  • I get no error of this kind. What version of latexmk do you have?
    – egreg
    Commented Nov 7, 2013 at 17:16
  • Last MiKTeX's version: 4.37 (2 July 2013).
    – Bernard
    Commented Nov 7, 2013 at 23:16

1 Answer 1

2

OK. It works simply typesetting:

latexmk.pl -xelatex -synctex=1 -pvc -cd -auxdir=TeXAux myfile.tex

as I found with the help of

latexmk.pl -showextraoptions

However, I don't understand what was wrong with the previous command line…

2
  • I have the same version 4.37 (on Mac OS X), but, as I said, the other command line works too.
    – egreg
    Commented Nov 7, 2013 at 23:18
  • 1
    To diagnose what happened with the previous command line, you should look very carefully at the resulting output from latexmk. It should say exactly what command line was used, and so you should see whether, for example, xelatex was actually invoked. But the new command line (with the -xelatex and -synctex=1 options) is usually a better way to go. Commented Nov 8, 2013 at 18:51

You must log in to answer this question.

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