4

Up until recently, my primary device ran Ubuntu (15.x) with VIM (7.x), TeX Live (2016), and vim-latex. Since all my files call fontspec, my ~/.vimrc contained these lines:

filetype plugin on
let g:tex_flavor='latex'
let g:Tex_CompileRule_pdf = 'xelatex --interaction=nonstopmode --shell-escape $*'

allowing me to compile using xelatex from VIM by typing \ll in normal mode. This worked.

I've now installed Arch (kernel release 4.14.7-1) on new hardware, installed the gvim (VIM 8.0.1415), texlive-most (TeX Live 2017), and vim-latexsuite (1:1.9.0-2) packages from repo. I've cobbled together a new .vimrc and included the above lines, and nothing that cancels them out. I can successfully compile from the command line running the command defined in the Tex_CompileRule (i.e. xelatex --interaction=nonstopmode --shell-escape filename). I can also compile from VIM by running :r! xelatex --interaction=nonstopmode --shell-escape filename. However, \ll executes pdflatex instead, which fails because my tex file contains the line \usepackage{fontspec}. I need it to run xelatex. Is there a typo in my Tex_CompileRule? Is there some other way to select my typesetting engine? What am I missing?

To be clear, I've restarted VIM since modifying .vimrc and checked that the CompileRule has been processed by entering :echo Tex_CompileRule_pdf, which echoes the desired xelatex syntax back at me. I've seen a thread suggesting my tex_flavor should be set to xelatex rather than latex, but that yields the same result. The default output format is obviously PDF, or it wouldn't execute pdflatex.

  • 1
    In case anyone else runs into this, my workaround has been to use [`vimtex`](https://github.com/lervag/vimtex) instead; it relies on `latexmk`, which defines the typesetting engine in [`~/.latexmkrc`](https://ctan.org/pkg/latexmk?lang=en). – Paul Langeslag Jul 04 '18 at 14:05

0 Answers0