I'm trying to make latexmk works with XeLaTeX and biber for my thesis. The document will have many cross references. What settings do I need to ensure it works correctly? My current settings for latexmk are below.

$pdflatex=q/pdflatex -synctex=1 %O %S/


$pdflatex=q/xelatex -synctex=1 %O %S/

in the .latexmkrc file.

For Biber, look at this discussion. However the latest version of latexmk coming with TeX Live 2011 works with Biber, choosing it automatically when needed (thanks to PLK for pointing this out).

  • 3
    The latest version of latexmk which comes with TexLive 2011 works fine with biber. – PLK Sep 4 '11 at 20:26
  • @PLK: I'll change my answer, thanks for remarking. – egreg Sep 4 '11 at 20:30

As this is still very high on google:

LatexMk (since 4.31) supports the -xelatex option and auto-detects biber.

Therefore, in the fabulous world of 2015:

$ latexmk -xelatex biberedtexfile.tex

works fine.

  • 3
    If you want this in your .latexmkrc file: $pdflatex = "xelatex %O %S"; $pdf_mode = 1; $dvi_mode = $postscript_mode = 0; This is what latexmk does when it encounters the -xelatex flag. – rubdos Oct 13 '17 at 13:38
  • 3
    @rubdos while that works, that is not correct. The -xelatex flag corresponds to setting $pdf_mode = 5; $dvi_mode = $postscript_mode = 0;. No need to override $pdflatex. – Joe Dec 18 '18 at 14:38

If neither of the two other approaches works (as in my case), put this in .latexmkrc, as suggested by @rubdos in the comments:

$pdflatex = "xelatex %O %S";
$pdf_mode = 1;
$dvi_mode = 0;
$postscript_mode = 0;

This is a really old question, but I still want to help those who are here.

Besides -xelatex option metioned by @Tommy, latexmk's doc explains $pdf_mode's usage:

If equal to 5, generate a pdf version (and an xdv version) of the document using xelatex, using the commands specified by the $xelatex and xdvipdfmx variables.

Thus, setting $pdf_mode = 5 in .latexmkrc would help.

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.