Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF file cannot be updated when g:vimtex_view_use_temp_files is set to non-zero #1362

Closed
xarthurx opened this issue Apr 11, 2019 · 8 comments

Comments

@xarthurx
Copy link

Issue:

PDF file cannot be updated when g:vimtex_view_use_temp_files is set to non-zero

Reproduction:

  1. Using the minimal example provided.
  2. Activate VimTex, generate PDF. (a name_vimtex.pdf will be copied out to the project folder)
  3. Change contents of the tex file, and pdf will be compiled.

expected behaviour:
The name_vimtex.pdf in the main folder will be updated.

observed behaviour:
Based on the timestamp of the file, the name_vimtex.pdf file is not copied out if there's one already in the folder.

using SumatraPDF as pdf viewer.
:VimtexInfo :

System info
  OS: Microsoft Windows 10 Pro (10.0.17763 N/A Build 17763)
  Vim version: NVIM v0.3.4
  Has clientserver: true
  Servername: \\.\pipe\nvim-14268-0

vimtex project: min
  base: min.tex
  root: C:\Users\xliot\Desktop\tmp
  tex: C:\Users\xliot\Desktop\tmp\min.tex
  out: C:\Users\xliot\Desktop\tmp/build/min.pdf
  log: C:\Users\xliot\Desktop\tmp/build/min.log
  aux: C:\Users\xliot\Desktop\tmp/build/min.aux
  fls: C:\Users\xliot\Desktop\tmp/build/min.fls
  compiler: latexmk
    backend: nvim
    output: C:\Users\xliot\AppData\Local\Temp\nvimWxH0Zc\0
    configuration: 
      continuous: 1
      callback: 1
      build_dir: build
      latexmk options:
        -pdf
        -pdflatex="xelatex --shell-escape %O %S"
        -verbose
        -file-line-error
        -synctex=1
        -interaction=nonstopmode
      latexmk engine: -pdf
    pid: 18400
    cmd: set max_print_line=2000 & latexmk -pdf -pdflatex="xelatex --shell-escape %O %S" -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -outdir=build -pvc -view=none -e "$success_cmd = 'echo vimtex_compiler_callback_success'" -e "$failure_cmd = 'echo vimtex_compiler_callback_failure'" "min.tex"
  viewer: General
    process: 
      pid: -
      cmd: start /b cmd /s /c "SumatraPDF.exe -reuse-instance -forward-search "C:\Users\xliot\Desktop\tmp\min.tex" 1 "C:\Users\xliot\Desktop\tmp\min_vimtex.pdf" -inverse-search "nvim --servername \\.\pipe\nvim-14268-0 --remote-send \"^<C-\^>^<C-n^>:drop \%f^<CR^>:\%l^<CR^>:normal\! zzzv^<CR^>:execute 'drop ' . fnameescape('\%f')^<CR^>:\%l^<CR^>:normal\! zzzv^<CR^>:call remote_foreground('\\.\pipe\nvim-14268-0')^<CR^>^<CR^>\"" >nul"
  qf: LaTeX logfile
    config: 
      fix_paths: 1
      packages: 
        default: 1
      default: 1
  document class: minimal

@lervag
Copy link
Owner

lervag commented Apr 11, 2019

No minimal example is provided...

One question, though: Does SumatraPDF block the PDF somehow? That is, similar to what Acrobat does?

@xarthurx
Copy link
Author

xarthurx commented Apr 11, 2019

I use the one given in the template, from your repo.

\documentclass{minimal}
\begin{document}
Hello world!
\end{document}

For the block issue, I don't think so.
I tried manually copy a file with the same name and overwrite it, no problem.

SumatraPDF seems to keep its one cache, and does not hold the real pdf. (Though I need to manually refresh the software by pressing r to update -- only for the manually copy process)

@lervag
Copy link
Owner

lervag commented Apr 11, 2019

But you are obviously using something different than the minivimrc at the same location:

set nocompatible
let &runtimepath  = '~/.vim/bundle/vimtex,' . &runtimepath
let &runtimepath .= ',~/.vim/bundle/vimtex/after'
filetype plugin indent on
syntax enable

nnoremap q :qall!<cr>

let g:vimtex_view_automatic = 0

silent edit main.tex

And so, again, the minimal example is not provided. The minimal vimrc file is much more important than the minimal LaTeX file.

@xarthurx
Copy link
Author

xarthurx commented Apr 11, 2019

Same issue. Note that if I don't set build_dir, all files will be in the same folder, but the name_vimtex.pdf is still not updated.

vimrc (I need to change some settings for Windows accordingly)

set nocompatible
syntax enable
filetype plugin indent on

nnoremap q :qall!<cr>

" python engine support
let g:python_host_prog = 'C:\Users\xliot\Miniconda3\python.exe'
let g:python3_host_prog = 'C:\Users\xliot\Miniconda3\python.exe'

if has('nvim')
   let g:vimtex_compiler_progname = 'C:\Users\xliot\Miniconda3\Scripts\nvr.exe'
endif

" pdf viewer
if has("win32") || has("64")
  let g:vimtex_view_general_viewer='SumatraPDF.exe'
else
  let g:vimtex_view_general_viewer='mupdf.exe'
endif

" copy pdf out of build folder
let g:vimtex_view_use_temp_files = 1
let g:vimtex_view_automatic = 0

@lervag
Copy link
Owner

lervag commented Apr 11, 2019

I don't think the g:python[3]_host_prog settings are relevant at all. In any case, I'll look into this when I get the time.

lervag added a commit that referenced this issue Apr 12, 2019
@lervag lervag closed this as completed in 51892b2 Apr 12, 2019
@lervag
Copy link
Owner

lervag commented Apr 12, 2019

Ok, how about now? Does it work with the latest update?

@xarthurx
Copy link
Author

Works like a charm!
Thx!

@lervag
Copy link
Owner

lervag commented Apr 13, 2019

No problem, happy to hear it works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants