I have a .tex
file that I need to compile to PDF using XeLaTeX (I am using fontspec, among other packages). Using RStudio, I can successfully generate a PDF via the Compile PDF command, having specified XeLaTeX as the engine in my RStudio preferences.
How can I programmatically invoke this compilation from a script? I've investigated tools::texi2pdf()
, but when running it on my file I get an error saying The fontspec package requires either XeTeX or LuaTeX
, and I don't see a way of specifying that I want to use XeLaTeX instead of plain LaTeX.