GithubHelp home page GithubHelp logo

Comments (2)

psr-ai avatar psr-ai commented on June 26, 2024

I am sorry, my pdf file was missing the vimtex-tex-program directive at the top, adding the following to the top of my pdf file worked:

% !TeX program = xelatex

...

from vimtex.

lervag avatar lervag commented on June 26, 2024

I am using the following configuration for vimtex plugin to use xelatex:

vim.g.vimtex_compiler_latexmk = {
  executable = 'latexmk',
  options = {
    '-xelatex',  -- Specifies the use of XeLaTeX
    '-file-line-error',
    '-synctex=1',
    '-interaction=nonstopmode',
  },
}

That's NOT the right way to configure VimTeX to use xelatex. I understand that this is not obvious, but it is explained in the docs:

  • :help g:vimtex_compiler_latexmk - see the "Note!" for the options key:

    options ~
      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|.
    
  • :help vimtex-tex-program

And my overall configuration looks like following: …

  • Unless you are loading your plugins manually, instead of using a plugin manager, you don't need to do the filetype plugin indent on and syntax enable, so you can most likely remove those lines.
  • You don't need to change g:vimtex_compiler_latexmk (the only change you are doing is not a valid change).
  • Notice that maplocalleader is not specific to VimTeX - it may impact other plugins as well.

When I start the live compilation (using ,, in command mode)

Did you mean ,ll?

If I set the default compiler as follows:

vim.g.vimtex_compiler_latexmk_engines = {
  _ = '-xelatex',
  xelatex = '-xelatex',
  lualatex = '-lualatex',
}

I am able to use the xelatex. What am I doing wrong?

Well, the latter approach is what you are supposed to do. Notice, though, that you don't need to include keys you are not changing, so you can simplify it to:

vim.g.vimtex_compiler_latexmk_engines = { _ = '-xelatex' }

I am sorry, my pdf file was missing the vimtex-tex-program directive at the top, adding the following to the top of my pdf file worked:

% !TeX program = xelatex

Notice that this is a different approach for changing the compiler engine. I personally prefer using this approach, because it is also recognized by other editors. So, as a sensible solution, I think you should simplify your config to something like the following and then use the tex program directive for specifying the engine:

vim.g.vimtex_view_method = 'skim'
vim.g.vimtex_view_skim_sync = 1
vim.g.vimtex_view_skim_activate = 1

-- NB! I would move this to wherever you are specifying your general neovim
--     options. Just make sure it is defined before you load plugins.
--     See :help maplocalleader for more info.
vim.g.maplocalleader = ','

from vimtex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.