Skip to content

Startup for PDF Viewer sometimes hangs #2601

@GersiD

Description

@GersiD

Description

Hello! I just got everything setup (or so I think) for using VimTex on Windows 11, neovim v0.8.0, SumatraPDF viewer. I use the following command for inverse search which also sometimes hangs.

cmd /c start /min "" nvim --headless -c "VimtexInverseSearch %l '%f'"

The command which VimTex runs to startup the SumatraPDF view is as follows.

cmd /s /c "SumatraPDF -reuse-instance -forward-search "TEX_DOC_NAME" 1 "PDF_DOC_NAME"

Please note the importance of the double quotation marks (") due to the /s operator.

This command sometimes starts SumatraPDF and sometimes hangs there and does nothing. Similarly, the inverse search via double clicking on SumatraPDF sometimes navigates to the proper line in the file I have open, and sometimes hangs. I am not sure why they hang and I dont know how I would go about fixing it.

Please note that on occurrences where the startup command hangs the inverse search command isn't even allowed to run, meaning I dont even see a terminal popup. I think I would like to try getting the terminal to not pop up at all if this is a possibility.

Thank you to anyone who reads this! Especially the developers and maintainers of this wonderful project.

Steps to reproduce

The following is my Neovim lua Config for VimTex.

        ['lervag/vimtex'] = {
          config = {
            ['vimtex_view_general_viewer'] = 'SumatraPDF',
            ['vimtex_view_method'] = 'SumatraPDF',
            ['vimtex_view_general_options'] = '-reuse-instance -forward-search @tex @line @pdf',
            ['vimtex_view_general_options_latexmk'] = '-reuse-instance',
          }

The following is the minimal tex file required to make the startup SumatraPDF command hang.

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

Steps to reproduce

  1. open the minimal.tex file in vim
  2. run :VimtexCompile (no quotation marks)
  3. Observe the following command window popup

image

4. Observe SumatraPDF open 5. Try and double click to jump to the hello world line, and observe that if it completes it takes a very long time unless you force close the first command window in step 3.

Expected behavior

When following the above steps, I expect the following behaviours.

  1. Primary command window in step 3 to popup and then disappear.
  2. Double click to inverse search to work.

Actual behavior

Please refer to the steps to reproduce where I detail what I actually observe.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: BLACK-BETTY (Microsoft Windows 11 Home)
  Vim version: NVIM v0.8.0-1210-gd367ed9b2
  Has clientserver: true
  Servername: \\.\pipe\nvim.29096.0

VimTeX project: minimal
  base: minimal.tex
  root: C:\Users\gersi\Desktop\rust\dummyRust
  tex: C:\Users\gersi\Desktop\rust\dummyRust\minimal.tex
  main parser: fallback current file
  document class: 
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: 7
      output: C:\Users\gersi\AppData\Local\Temp\nvim.0\hhP8VV\0
      cmd: set max_print_line=2000 & latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -view=none -e "$compiling_cmd = ($compiling_cmd ? $compiling_cmd . ' ^& ' : '') . 'echo vimtex_compiler_callback_compiling'" -e "$success_cmd = ($success_cmd ? $success_cmd . ' ^& ' : '') . 'echo vimtex_compiler_callback_success'" -e "$failure_cmd = ($failure_cmd ? $failure_cmd . ' ^& ' : '') . 'echo vimtex_compiler_callback_failure'" "minimal.tex"
      pid: 164
  viewer: General
    job: 
      pid: 8940
      cmd: SumatraPDF -reuse-instance -forward-search "C:\Users\gersi\Desktop\rust\dummyRust\minimal.tex" 4 "C:\Users\gersi\Desktop\rust\dummyRust/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