lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.4k stars 388 forks source link

How to replace deprecated option 'vimtex_view_general_options_latexmk'? #2887

Closed ChristophSchmidpeter closed 6 months ago

ChristophSchmidpeter commented 6 months ago

Description

I have the following lazy.nvim vimtex Lua config file:

return
{
  {
    "lervag/vimtex",
    config = function ()
        vim.g.vimtex_view_general_viewer = 'okular'
        vim.g.vimtex_compiler_latexmk_engines = {
            _ = '-xelatex'
        }
        vim.g.tex_comment_nospell = 1
        vim.g.vimtex_compiler_progname = 'nvr'
        vim.g.vimtex_view_general_options = [[--unique file:@pdf\#src:@line@tex]]
        vim.g.vimtex_view_general_options_latexmk = '--unique'
    end,
    ft = 'tex'
  }
}

With it upon opening .tex files I get the following error on startup:

VimTeX: Deprecated option(s) detected!
        - g:vimtex_view_general_options_latexmk
        Please see `:help OPTION` for more info!

With what/How do I replace the deprecated option vimtex_view_general_options_latexmk? In the :help file I only found the option vimtex-compiler-latexmk, but I guess this option does something else?

Steps to reproduce

See above

Expected behavior

No error message

Actual behavior

Error message

Do you use a latexmkrc file?

No, I believe?

VimtexInfo

System info:
  OS: Linux 6.6.10-zen1-1-zen
  Vim version: NVIM v0.9.5
  Has clientserver: true
  Servername: /run/user/1000/nvim.100599.0

VimTeX project: main
  base: main.tex
  root: /home/vbm/Projects/Bewerbung/Cv/cv
  tex: /home/vbm/Projects/Bewerbung/Cv/cv/main.tex
  main parser: texroot specifier
  document class: article
  packages: amsbsy amsgen amsmath amsopn amstext array atbegshi atbegshi-ltx atveryend atveryend-ltx auxhook babel biblatex bigintcalc bitset blx-case-expl3 csquotes easyCV etexcmds etoolbox expl3 fix-cm fontenc fontspec fontspec-xetex geometry gettitlestring graphics graphicx hycolor hyperref ifluatex iftex ifthen ifvtex ifxetex infwarerr intcalc keyval kvdefinekeys kvoptions kvsetkeys l3keys2e letltxmacro logreq ltxcmds microtype nameref parskip pdfescape pdftexcmds pgf pgfcomp-version-0-65 pgfcomp-version-1-18 pgfcore pgffor pgfkeys pgfmath pgfrcs pgfsys refcount rerunfilecheck sourcesanspro stringenc switchlang tabularx textpos tikz trig unicode-math unicode-math-xetex uniquecounter url xcolor xkeyval xparse
  compiler: latexmk
    engine: -xelatex
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: General
  qf method: LaTeX logfile
lervag commented 6 months ago

I have the following lazy.nvim vimtex Lua config file: …

You want this:

return
{
  {
    "lervag/vimtex",
    init = function()
      vim.g.vimtex_compiler_latexmk_engines = { _ = "-xelatex" }
      vim.g.vimtex_view_general_viewer = "okular"
      vim.g.vimtex_view_general_options = "--unique file:@pdf\\#src:@line@tex"
    end,
  }
}

I belive this should fix your problems.

Notice: DON'T lazy load VimTeX (remove ft = tex).

lervag commented 6 months ago

Also vim.g.tex_comment_nospell = 1 is not relevant to VimTeX.

ChristophSchmidpeter commented 6 months ago

@lervag Thanks very much for your help!

lervag commented 6 months ago

Glad to help!