lervag / vimtex

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

Reverse search in zathura does not work in multifile document if auxiliary files included as "\input file" #3007

Closed sergeG closed 2 weeks ago

sergeG commented 2 weeks ago

Description

Hi! Reverse search in zathura does work if I use

\input{file}

and does not work if

\input file

used instead.

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

$job_name='Project'; $pdflatex = "pdflatex --shell-escape %O %S";

VimtexInfo

System info:
  OS: Ubuntu 20.04.6 LTS
  Vim version: NVIM v0.10.1
  Has clientserver: true
  Servername: /run/user/1000/nvim.2001772.0

VimTeX project: Project
  base: Project.tex
  root: /home/serge/FILES/SCIENCE/Poroshin.git
  tex: /home/serge/FILES/SCIENCE/Poroshin.git/Project.tex
  main parser: buffer variable
  document class: svjour3
  packages: afterpage amsbsy amsfonts amsgen amsmath amsopn amssymb amstext atbegshi atveryend authblk auxhook babel bigintcalc bitset calc cancel cite epstopdf-base etexcmds eucal geometry gettitlestring graphics graphicx hycolor hyperref iftex ifvtex infwarerr inputenc intcalc keyval kvdefinekeys kvoptions kvsetkeys letltxmacro ltxcmds mathtools mhsetup nameref pdfescape pdftexcmds refcount rerunfilecheck setspace times trig uniquecounter url xcolor
  source files:
    Project.tex
    text.tex
    references.tex
  compiler: latexmk
    engine: -pdf
    options:
      -shell-escape
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: 14
      output: /tmp/nvim.serge/2sxyFM/0
      cmd: max_print_line=2000 latexmk -shell-escape -verbose -file-line-error -synctex=1 -interaction=nonstopmode  -pdf -pvc -pvctimeout- -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"' 'Project.tex'
      pid: 2002749
  viewer: Zathura
    xwin id: 0
    cmd_start: zathura  -x "/usr/bin/nvim --headless -c \"VimtexInverseSearch %{line} '%{input}'\"" --synctex-forward 4033:10:'/home/serge/FILES/SCIENCE/Poroshin.git/text.tex' 'Project.pdf'&
  qf method: LaTeX logfile
lervag commented 2 weeks ago

Hi! Reverse search in zathura does work if I use

\input{file}

and does not work if

\input file

used instead.

Ok, but why do you use the primitive variant here? I believe it is strongly recommended to use the braced variant. See e.g. here:

The last reference shows this warning:

Warning: this command will list only files which were read using LATEX commands such as \input{⟨file⟩} or \include{⟨file⟩}. If the file was read using the primitive TEX syntax \input file (without { } braces around the file name) then it will not be listed; failure to use the LATEX form with the braces can cause more severe problems, possibly leading to overwriting important files, so always put in the braces.

So, I am curious, is there really any good reason to support the primitive TeX syntax?

sergeG commented 2 weeks ago

I am a user of TeX during more than 30 years, so I because of my habit :). Yesterday I spent several hours to understand why the reverse search sometimes is broken. I agree with you that nowadays it is better to use \input{file}, so perhaps this filed bug can save sometime for somebody.

In any case, thanks for your work!

lervag commented 2 weeks ago

I am a user of TeX during more than 30 years, so I because of my habit :).

Cool! That dwarves my 20 years as a TeX user. 🤩

Yesterday I spent several hours to understand why the reverse search sometimes is broken. I agree with you that nowadays it is better to use \input{file}, so perhaps this filed bug can save sometime for somebody.

Yes, perhaps, so thanks for posting! But to be honest, in my 20 years of using TeX I can't remember to have ever seen the \input file form. 😅

In any case, thanks for your work!

My pleaseure, glad to help!