lervag / vimtex

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

Trouble with setting build directory latexmk #1179

Closed BlueDrink9 closed 6 years ago

BlueDrink9 commented 6 years ago

This is the .vimrc I've tested it with (run with vim -u minirc file.tex)

set nocompatible
filetype plugin indent on
syntax enable

call plug#begin("~/vimfiles/plugins")

Plug 'lervag/vimtex'
let g:tex_flavor = "latex"
let g:vimtex_latexmk_background       = 1

let g:vimtex_compiler_latexrun = {
    \ 'build_dir' : 'latexbuild',
    \}

let g:vimtex_view_general_viewer = 'SumatraPDF'
let g:vimtex_view_general_options
    \ = '-reuse-instance -forward-search @line @pdf @tex'
let g:vimtex_view_general_options_latexmk = '-reuse-instance'

call plug#end()

However, when I run \ll, the intermediates still all end up in the .tex dir. The dir exists.

Am I entering the command wrongly? And does it need to be set before or after the contents of vimtex.vim get executed?

Windows, latexmk 4.55, latest vimtex, vim8.

lervag commented 6 years ago

I think your error is here:

" This is wrong:
let g:vimtex_compiler_latexrun = {
    \ 'build_dir' : 'latexbuild',
    \}

" It should be:
let g:vimtex_compiler_latexmk = {
    \ 'build_dir' : 'latexbuild',
    \}
franzbertani commented 5 years ago

Hi there, I have the same problem, but only when I compile with \ll, instead with :VimtexCompile the pdf is produced in the expected folder. This is the relevant part of my .vimrc

    Plug 'lervag/vimtex'
    let g:vimtex_compiler_latexmk = {
        \ 'build_dir' : 'build',
    \}

macOS, latexmk 4.52c, neovim

lervag commented 5 years ago

That does not make sense, @franzbertani, because \ll and :VimtexCompile is the same. Do you have LaTeX-Suite installed, maybe? What is the output of :map \ll?

franzbertani commented 5 years ago

The output of :map \ll seems ok \ll *@:Latexmk<CR>. No LaTeX-Suite installed.

lervag commented 5 years ago

Well, the output of \ll should be n \ll @<Plug>(vimtex-compile), so you have a second LaTeX plugin installed. My second guess is that you are using vim-polyglot. I strongly dislike that plugin, myself, but if you use it and insist on using it, then you should disable LaTeX-Box with this option:

let g:polyglot_disabled = ['tex']
franzbertani commented 5 years ago

Thanks a lot! vim-polyglot indeed interfered. Removed.

lervag commented 5 years ago

No problem, happy to help. Note, for the future: It is better to open a new issue with reference to old issues, instead of continuing old discussions. The last comments here are not really relevant to the original thread.