James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.42k stars 519 forks source link

reverse synctex not working #4267

Closed EricDarve closed 1 month ago

EricDarve commented 1 month ago

Pre-checks*

Environment*

Please write exact version numbers instead of descriptors such as latest.

  • Operating System: Apple Sonoma 14.4.1
  • Visual Studio Code Version: 1.89.1
  • LaTeX Workshop Version: v9.20.1
  • TeX Distribution Version: TeX Live 2024

Please list the environment and version number if you are using VSCodium, Snap or Flatpack versions of Visual Studio Code, and/or Visual Studio Code Remote Containers/SSH/WSL.

N/A

The Issue*

Please briefly describe the issue you come across.

The reverse search function is no longer working. That is when command-clicking in the PDF window, VSCode is no longer able to find the location in the latex file. This used to be working in earlier versions, although I am not sure which update broke that functionality.

Reproduction Steps

Please list out the steps to reproduce your bug. Include relevant environmental variables or any other configuration.

  1. command-click in the PDF
  2. VSCode is not able to find the location in the latex source file

Expected Behavior

What were you expecting to see? Include any relevant examples or documentation links.

The cursor should move to the correct location in the latex file.

Logs

LaTeX Workshop Output*

Please paste the whole log messages below, not parts of ones. The log should start with New log placeholder %WS1% registered.

[13:42:15.022][Viewer] Handle data type: reverse_synctex
[13:42:15.022][Locator] Backward from [XXX].pdf at x=125.28617363344053, y=410.5111472568327 on page 4.
[13:42:15.022][SyncTeX] Parsing .synctex [XXX].synctex .
[13:42:15.023][SyncTeX] No relevant entries found.

This message appears every time I command-click in the PDF file. The location in the PDF (x, y, page) looks correct.

Additional output:

[13:50:53.399][Logger] New log placeholder %WS1% registered for /Users/XXX .
[13:50:53.399][Extension] Initializing LaTeX Workshop.
[13:50:53.475][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_LATEX: "/usr/local/texlive/2024/bin/universal-darwin"
[13:50:53.493][Server] Creating LaTeX Workshop http and websocket server.
[13:50:53.530][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[13:50:53.548][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":52120} .
[13:50:53.549][Extension] Extension root: /Users/XXX/.vscode/extensions/james-yu.latex-workshop-9.20.1
[13:50:53.549][Extension] $PATH: XXX
[13:50:53.549][Extension] $SHELL: /bin/zsh
[13:50:53.549][Extension] $LANG: undefined
[13:50:53.549][Extension] $LC_ALL: undefined
[13:50:53.549][Extension] process.platform: darwin
[13:50:53.549][Extension] process.arch: arm64
[13:50:53.549][Extension] vscode.env.appName: Visual Studio Code
[13:50:53.549][Extension] vscode.env.remoteName: undefined
[13:50:53.549][Extension] vscode.env.uiKind: 1
[13:50:53.550][Config] latex-workshop.latex.recipes: [{"name":"latexmk","tools":["latexmk"]},{"name":"pdflatex","tools":["pdflatex"]},{"name":"xelatex","tools":["xelatex"]},{"name":"bibtex","tools":["bibtex"]},{"name":"xe -> biber -> 2 x xe","tools":["xelatex","biber","xelatex","xelatex"]},{"name":"pdf -> bibtex -> 2 x pdf","tools":["pdflatex","bibtex","pdflatex","pdflatex"]},{"name":"pdf -> biber -> 2 x pdf","tools":["pdflatex","biber","pdflatex","pdflatex"]},{"name":"biber","tools":["biber"]},{"name":"2 x pdflatex","tools":["pdflatex","pdflatex"]},{"name":"makeindex","tools":["pdflatex","makeindex","pdflatex"]}] .
[13:50:53.550][Config] latex-workshop.latex.tools: [{"name":"latexmk","command":"latexmk","args":["-synctex=2","-interaction=nonstopmode","-file-line-error","-pdf","%DOC%"]},{"name":"pdflatex","command":"pdflatex","args":["-synctex=2","-interaction=nonstopmode","-file-line-error","-shell-escape","%DOC%"]},{"name":"xelatex","command":"xelatex","args":["-synctex=2","-interaction=nonstopmode","-file-line-error","-shell-escape","%DOC%"]},{"name":"bibtex","command":"bibtex","args":["%DOCFILE%"]},{"name":"biber","command":"biber","args":["%DOCFILE%"]},{"name":"makeindex","command":"makeindex","args":["%DOCFILE%"]}] .
[13:50:53.551][Config] latex-workshop.latex.magic.args: ["-synctex=2","-interaction=nonstopmode","-file-line-error","-shell-escape","%DOC%"] .
[13:50:53.551][Config] latex-workshop.latex.build.forceRecipeUsage: false .
[13:50:53.552][Config] latex-workshop.latex.autoBuild.run: "never" .
[13:50:53.556][Config] latex-workshop.synctex.path: "/usr/local/texlive/2024/bin/universal-darwin/synctex" .
[13:50:53.560][Config] latex-workshop.latexindent.path: "/usr/local/texlive/2024/bin/universal-darwin/latexindent" .
[13:50:53.561][Config] latex-workshop.docker.image.latex: "/usr/local/texlive/2024/bin/universal-darwin" .
[13:50:53.564][Config] latex-workshop.texdoc.path: "/usr/local/texlive/2024/bin/universal-darwin/texdoc" .
[13:50:53.568][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"]
[13:50:53.569][Root] Current workspace folders: ["file://%WS1%"]
[13:50:53.569][Extension] LaTeX Workshop initialized.
[13:50:53.570][Root] Current workspaceRootDir: file://%WS1% .
[13:50:53.573][Server] valdOrigin is http://127.0.0.1:52120
[13:50:53.657][Viewer][Panel] Internal PDF viewer at http://127.0.0.1:52120/viewer.html?file=pdf..ZmlsZSUzQSUyRiUyRiUyRlVzZXJzJTJGZGFydmUlMkZnaXRfcmVwb3NpdG9yaWVzJTJGY21lMjEzLWFzc2lnbm1lbnRzJTJGaG9tZXdvcmtzJTJGaHc1JTJGd3JpdGV1cCUyRmh3NV9zb2x1dGlvbi5wZGY .
[13:50:53.657][Cacher][Watcher] Watched XXX.pdf with a new .pdf watcher on XXX .
[13:50:53.657][Event] FILE_WATCHED: "XXX.pdf"
[13:50:53.704][Root] Found files that might be root, choose the first one: XXX
[13:50:53.704][Root] Root file changed: from XXX.tex to XXX.tex, langID latex . Refresh dependencies
[13:50:53.704][Event] ROOT_FILE_CHANGED: "XXX.tex"
[13:50:53.705][Cacher][Watcher] Reset.

Developer Tools Console

Please paste the whole log messages below, not parts of ones. This console logs can sometimes be very important in many cases. To access the log, click Help -> Toggle Developer Tools -> Console.

I could not find a relevant message in the console.

log.ts:439   ERR Ignoring latex-workshop.synctex.indicator.enabled as latex-workshop.synctex.indicator is "rectangle"
log.ts:439   ERR Unable to read file 
'/Users/XXX/Library/Application Support/Code/logs/20240518T135052/window1/exthost/output_logging_20240518T135053/1-LaTeX Workshop.log' 
(Error: Unable to resolve nonexistent file 
'/Users/XXX/Library/Application Support/Code/logs/20240518T135052/window1/exthost/output_logging_20240518T135053/1-LaTeX Workshop.log'): 
Error: Unable to read file 
'/Users/XXX/Library/Application Support/Code/logs/20240518T135052/window1/exthost/output_logging_20240518T135053/1-LaTeX Workshop.log' 
(Error: Unable to resolve nonexistent file 
'/Users/XXX/Library/Application Support/Code/logs/20240518T135052/window1/exthost/output_logging_20240518T135053/1-LaTeX Workshop.log')

Anything Else?

Add any other context about the problem below.

Thank you.

James-Yu commented 1 month ago

No relevant entries found.

Seems your synctex file does not have corresponding record.

Please provide a minimal working example with the corresponding synctex.gz file for debug.

EricDarve commented 1 month ago

Hi,

Thank you for your comment. It put me on the right track to find the problem. I was using synctex=2 instead of synctex=1. synctex=1 does work as expected.

https://www.tug.org/texlive//devsrc/Master/texmf-dist/doc/man/man1/synctex.man1.pdf