How can the base latex compile routine (VimtexCompile) be modified to execute xelatex instead of latex. For projects that have fontspec dependency, latexmk gives several errors. The same file compiles by running xelatex on a terminal without errors.
A few options have been suggested in the Internet. One of them is (non-lua):
This option when adapted and placed in vimtex.lua should work. I was however not able to get it to work.
Another option was to introduce a .latexmkrc file. This approach also didn't work.
$pdflatex = "xelatex %O %S";
$pdf_mode = 1;
Finally the only option that worked was changing the source file with this line in its header:
%!TeX program = xelatex
While this approach works, it is a problem because for situations like mine, where I'm writing a book, each chapter is a separate source that gets developed independently. This has to be added for every file.
Is there a way to get this mod done permanently inside vimtex.lua or any other .lua file ?
How can the base latex compile routine (VimtexCompile) be modified to execute xelatex instead of latex. For projects that have fontspec dependency, latexmk gives several errors. The same file compiles by running xelatex on a terminal without errors.
A few options have been suggested in the Internet. One of them is (non-lua):
This option when adapted and placed in vimtex.lua should work. I was however not able to get it to work.
Another option was to introduce a
.latexmkrc
file. This approach also didn't work.Finally the only option that worked was changing the source file with this line in its header:
%!TeX program = xelatex
While this approach works, it is a problem because for situations like mine, where I'm writing a book, each chapter is a separate source that gets developed independently. This has to be added for every file.
Is there a way to get this mod done permanently inside
vimtex.lua
or any other.lua
file ?