Vimtex and Xelatex

If you are using latexmk to compile and you use XeLaTeX for the most of the time, I suggest change the defaut engine for your latexmk, just add one line to you $HOME/.latexmkrc

$pdflatex="xelatex %O %S";

Or you might want to keep pdflatex as your latexmk option. I suggest changing the choice of vimtex: add these lines to your $HOME/.vimrc

let g:vimtex_compiler_latexmk = { 
        \ 'executable' : 'latexmk',
        \ 'options' : [ 
        \   '-xelatex',
        \   '-file-line-error',
        \   '-synctex=1',
        \   '-interaction=nonstopmode',
        \ ],
        \}

options here stands for the options of latexmk when you use \ll to compile in vim.

You can refer to the Official Document to see more customizations for latexmk.

Tags:

Xetex