Skip to content

pdf outfile should be updated to match the argument to compile command #2866

@BertrandSim

Description

@BertrandSim

Description

The addition of arguments to :VimtexCompile allowed a different filename for the pdf output. However, this filename was not passed to the viewer.

In particular, tracing the source code leads me to the function
vimtex#view#compiler_callback() in autoload/vimtex/view.vim.
(I also tried looking at autoload/vimtex/view/_template.vim, and its function s:viewer_out(). But could not understand the rest of the code well enough to submit a PR)

.latexmkrc

$emulate_aux = 1;
$out_dir = "";
$aux_dir = ".auxfiles";

Steps to reproduce

  1. nvim minimal.tex
  2. :VimtexCompileSS to produce minimal.pdf
  3. :q
  4. nvim minimal.tex
  5. :VimtexCompileSS -jobname=anotherminimal
  6. minimal.pdf is opened

Expected behavior

anotherminimal.pdf should be opened

Actual behavior

Either minimal.pdf is opened, or if steps 1-3 were omitted, no pdf is shown.

Do you use a latexmkrc file?

Yes

VimtexInfo

System info:
  OS: Linux Mint 21
  Vim version: NVIM v0.8.1
  Has clientserver: true
  Servername: /run/user/1000/nvim.97711.0

VimTeX project: minimal
  base: minimal.tex
  root: /home/bertrand-sim/tex_temp
  tex: /home/bertrand-sim/tex_temp/minimal.tex
  main parser: current file verified
  document class: minimal
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    aux_dir: .auxfiles
    callback: 1
    continuous: 0
    executable: latexmk
    job: 
      jobid: 5
      output: /tmp/nvim.bertrand-sim/52nKG9/0
      cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -jobname=anotherminimal -pdf -emulate-aux-dir -auxdir=.auxfiles 'minimal.tex'
  viewer: Zathura
    xwin id: 92274691
    cmd_start: zathura  -x "/home/bertrand-sim/software/nvim-0.8.1/bin/nvim --headless -c \"VimtexInverseSearch %{line} '%{input}'\"" --synctex-forward 1:1:'/home/bertrand-sim/tex_temp/minimal.tex' 'minimal.pdf'&
  qf method: LaTeX logfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions