Skip to content

"Compile selected lines" works but cannot open a viewer when the build_dir of vimtex_compiler_latexmk is set #2522

@krishnakumarg1984

Description

@krishnakumarg1984

Description

With the following configuration,

  let g:vimtex_compiler_latexmk = {
  \ 'build_dir' : 'build',
  \ 'callback' : 1,
  \ 'continuous' : 1,
  \ 'executable' : 'latexmk',
  \ 'hooks': [function('Callback')],
  \ 'options' : [
  \   '-verbose',
  \   '-recorder',
  \   '-file-line-error',
  \   '-synctex=1',
  \   '-interaction=nonstopmode',
  \ ]
  \}

Visually selecting a few lines of latex source code, and performing a <leader>lL triggers a successful compilation of the selected lines. However, the view command fails with the error message:

VimTeX: viewer cannot read the PDF file.

This is with the default settings, wherein the viewer is supposed to automatically open and do a forward search.

Setting the 'build_dir' back to '' ensures a successful compilation of selected lines and immediately opens the PDF viewer

Steps to reproduce

Please see description above

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

N/A

VimtexInfo

N/A?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions