I am using VimTex to write LaTex. I am trying to use gnuplottex in my documents, but get the problem that VimTex won't stop compiling the tex file. I am guessing that some gnuplot related files are changed, which triggers the compilation (I am using the automatic compilation). How could I fix the behaviour so that it does only compile e.g. if the .tex or the .bib file is changed?

I use neovim with the following setting:

vim.g.vimtex_compiler_latexmk = {options = { "-pdf", "-shell-escape"},}

1 Answer 1


You've specified the latexmk options in a way that is not according to the documentation and that is likely the cause of your problem. See :help vimtex_compiler_latexmk, which states:

  Default value:

    let g:vimtex_compiler_latexmk = {
        \ …
        \ 'options' : [
        \   '-verbose',
        \   '-file-line-error',
        \   '-synctex=1',
        \   '-interaction=nonstopmode',
        \ ],
    This is a list of options that are passed to `latexmk`. The default
    options should work well for most people.

    Note: Options like `-pdf` or `-lualatex` should NOT be added to this list.
          These are options used to specify the LaTeX processor/engine, see
          instead |g:vimtex_compiler_latexmk_engines|.

You probably didn't read the last note. Also, you need to keep the default options as well. Thus, you probably want this:

vim.g.vimtex_compiler_latexmk = {
  options = {

I strongly advice all users to actually read the docs. I don't mean to read all of it, but read the docs for the options you are using. And read the introduction. I've taken a lot of care into making the documentation useful as the reference for VimTeX. ;)

Also: This is a question that is generally better to ask at the VimTeX issue tracker (https://github.com/lervag/vimtex/issues/). I suggest that you open an issue in the issue tracker if you have further questions related to VimTeX.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.