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

Backward SyncTeX failed on non-existent #4239

Closed
3 of 4 tasks
Cold-Stars opened this issue Apr 17, 2024 · 7 comments
Closed
3 of 4 tasks

Backward SyncTeX failed on non-existent #4239

Cold-Stars opened this issue Apr 17, 2024 · 7 comments

Comments

@Cold-Stars
Copy link

Cold-Stars commented Apr 17, 2024

Please fill the following fields with a star (*) and provide as much related information as possible.

Pre-checks*

Please change the following [ ] to [x] for confirmation.

  • The issue has not been reported in this repository.
  • The issue remains after disabling all other extensions and restarting Visual Studio Code.
  • The FAQ cannot address the issue.
  • The issue is not related to compiling a document, or the document can be successfully compiled in the OS terminal but not in Visual Studio Code with this extension.

Environment*

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

  • Operating System: [Windows 11]
  • Visual Studio Code Version: [1.88.1(system step)]
  • LaTeX Workshop Version: [9.20.0]
  • TeX Distribution Version: [TeX Live 2024]

The Issue*

  • Error when using vscode built-in pdf preview for reverse search
  • settings.json:
{
    "latex-workshop.latex.autoBuild.run": "onFileChange",
    "latex-workshop.showContextMenu": true,
    "latex-workshop.intellisense.package.enabled": true,
    "latex-workshop.message.error.show": false,
    "latex-workshop.message.warning.show": false,
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "-outdir=%OUTDIR%",
                "%DOCFILE%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        }
    ],
    "latex-workshop.latex.recipes": [
        {
            "name": "XeLaTeX",
            "tools": [
                "xelatex"
            ]
        },
        {
            "name": "PDFLaTeX",
            "tools": [
                "pdflatex"
            ]
        },
        {
            "name": "BibTeX",
            "tools": [
                "bibtex"
            ]
        },
        {
            "name": "LaTeXmk",
            "tools": [
                "latexmk"
            ]
        },
        {
            "name": "xelatex -> bibtex -> xelatex*2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex"
            ]
        },
        {
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        }
    ],
    "latex-workshop.latex.clean.fileTypes": [
        "*.aux",
        "*.bbl",
        "*.blg",
        "*.idx",
        "*.ind",
        "*.lof",
        "*.lot",
        "*.out",
        "*.toc",
        "*.acn",
        "*.acr",
        "*.alg",
        "*.glg",
        "*.glo",
        "*.gls",
        "*.ist",
        "*.fls",
        "*.log",
        "*.fdb_latexmk"
    ],
    "latex-workshop.latex.autoClean.run": "onFailed",
    "latex-workshop.latex.recipe.default": "lastUsed",
    "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click"
}

image

Logs

LaTeX Workshop Output*

[08:50:45.635][Event] STRUCTURE_UPDATED
[08:50:48.214][Commander] BUILD command invoked.
[08:50:48.215][Build] The document of the active editor: file:///d:/yan/我的/论文/小论文/latex/1.tex
[08:50:48.215][Build] The languageId of the document: latex
[08:50:48.215][Root] Current workspace folders: ["file:///d:/yan/我的/论文/小论文/latex"]
[08:50:48.215][Root] Found root file from active editor: %WS1%\1.tex
[08:50:48.216][Root] Keep using the same root file: %WS1%\1.tex
[08:50:48.216][Event] ROOT_FILE_SEARCHED
[08:50:48.216][Event] STRUCTURE_UPDATED
[08:50:48.216][Build] Building root file: %WS1%\1.tex
[08:50:48.216][Build][Recipe] Build root file %WS1%\1.tex
[08:50:48.219][Build][Recipe] Preparing to run recipe: XeLaTeX.
[08:50:48.219][Build][Recipe] Prepared 1 tools.
[08:50:49.198][Build][Recipe] outDir: d:/yan/我的/论文/小论文/latex .
[08:50:49.199][Build] Recipe step 1 The command is xelatex:["-synctex=1","-interaction=nonstopmode","-file-line-error","1"].
[08:50:49.199][Build] env: undefined
[08:50:49.199][Build] root: %WS1%\1.tex
[08:50:49.200][Build] cwd: %WS1%
[08:50:49.242][Build] LaTeX build process spawned with PID 11736.
[08:50:52.394][Parser][TexLog] Logged 0 messages.
[08:50:52.395][Build] Finished a step in recipe with PID 11736.
[08:50:52.395][Build] Successfully built %WS1%\1.tex .
[08:50:52.395][Event] BUILD_DONE
[08:50:52.395][Viewer] Call refreshExistingViewer: "d:\\yan\\我的\\论文\\小论文\\latex\\1.pdf" .
[08:50:52.396][Viewer] Refresh PDF viewer: %WS1%\1.pdf
[08:50:52.634][Cacher][Watcher] "change" emitted on %WS1%\1.pdf after polling for 264 ms.
[08:50:52.635][Event] FILE_CHANGED: "d:\\yan\\我的\\论文\\小论文\\latex\\1.pdf"
[08:50:57.230][Commander] VIEW command invoked.
[08:50:57.230][Root] Current workspace folders: ["file:///d:/yan/我的/论文/小论文/latex"]
[08:50:57.231][Root] Found root file from active editor: %WS1%\1.tex
[08:50:57.231][Root] Keep using the same root file: %WS1%\1.tex
[08:50:57.231][Event] ROOT_FILE_SEARCHED
[08:50:57.232][Event] STRUCTURE_UPDATED
[08:50:57.288][Viewer][Panel] Internal PDF viewer at http://127.0.0.1:63332/viewer.html?file=pdf..ZmlsZSUzQSUyRiUyRiUyRmQlM0ElMkZ5YW4lMkYlRTYlODglOTElRTclOUElODQlMkYlRTglQUUlQkElRTYlOTYlODclMkYlRTUlQjAlOEYlRTglQUUlQkElRTYlOTYlODclMkZsYXRleCUyRjEucGRm .
[08:50:57.289][Cacher][Watcher] Watched %WS1%\1.pdf by the .pdf watcher.
[08:50:57.289][Event] FILE_WATCHED: "d:\\yan\\我的\\论文\\小论文\\latex\\1.pdf"
[08:50:57.307][Event] STRUCTURE_UPDATED
[08:50:57.316][Viewer] Open PDF tab for file:///d:/yan/我的/论文/小论文/latex/1.pdf
[08:50:57.511][Viewer] Handle data type: open
[08:50:57.559][Server] Preview PDF file: file:///d:/yan/我的/论文/小论文/latex/1.pdf
[08:50:57.637][Viewer] Handle data type: loaded
[08:50:57.637][Event] VIEWER_PAGE_LOADED
[08:51:02.013][Viewer] Handle data type: reverse_synctex
[08:51:02.013][Locator] Backward from %WS1%\1.pdf at x=192.14165912518854, y=254.6907239819005 on page 1.
[08:51:02.288][Locator] Backward SyncTeX failed on isSameRealPath() with d:/yan/�ҵ�/����/С����/latex/./1.tex and %WS1%\1.tex . Error: ENOENT: no such file or directory, lstat 'd:\yan\�ҵ�'
[08:51:02.288]Error: ENOENT: no such file or directory, lstat 'd:\yan\�ҵ�'
	at Object.realpathSync (node:fs:2676:7)
	at Object.<anonymous> (node:electron/js2c/node_init:2:5352)
	at isSameRealPath (c:\Users\19731\.vscode\extensions\james-yu.latex-workshop-9.20.0\out\src\utils\pathnormalize.js:39:28)
	at Object.toTeX (c:\Users\19731\.vscode\extensions\james-yu.latex-workshop-9.20.0\out\src\locate\synctex.js:435:52)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[08:51:02.288][Locator] Backward SyncTeX failed on non-existent d:\yan\�ҵ�\����\С����\latex\1.tex .
[08:51:04.429][Viewer] Handle data type: reverse_synctex
[08:51:04.429][Locator] Backward from %WS1%\1.pdf at x=188.55022624434392, y=258.2821568627452 on page 1.
[08:51:04.504][Locator] Backward SyncTeX failed on isSameRealPath() with d:/yan/�ҵ�/����/С����/latex/./1.tex and %WS1%\1.tex . Error: ENOENT: no such file or directory, lstat 'd:\yan\�ҵ�'
[08:51:04.504]Error: ENOENT: no such file or directory, lstat 'd:\yan\�ҵ�'
	at Object.realpathSync (node:fs:2676:7)
	at Object.<anonymous> (node:electron/js2c/node_init:2:5352)
	at isSameRealPath (c:\Users\19731\.vscode\extensions\james-yu.latex-workshop-9.20.0\out\src\utils\pathnormalize.js:39:28)
	at Object.toTeX (c:\Users\19731\.vscode\extensions\james-yu.latex-workshop-9.20.0\out\src\locate\synctex.js:435:52)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[08:51:04.504][Locator] Backward SyncTeX failed on non-existent d:\yan\�ҵ�\����\С����\latex\1.tex .
[08:51:07.194][Event] STRUCTURE_UPDATED
[08:51:10.612][Event] STRUCTURE_UPDATED
[08:51:10.618][Commander] SYNCTEX command invoked.
[08:51:10.619][Locator] Forward from %WS1%\1.tex to %WS1%\1.pdf on line 7.
[08:51:10.697][Viewer] Try to synctex %WS1%\1.pdf
[08:51:14.823][Viewer] Handle data type: reverse_synctex
[08:51:14.823][Locator] Backward from %WS1%\1.pdf at x=312.4546606334842, y=242.71927876238013 on page 1.
[08:51:14.895][Locator] Backward SyncTeX failed on isSameRealPath() with d:/yan/�ҵ�/����/С����/latex/./1.tex and %WS1%\1.tex . Error: ENOENT: no such file or directory, lstat 'd:\yan\�ҵ�'
[08:51:14.895]Error: ENOENT: no such file or directory, lstat 'd:\yan\�ҵ�'
	at Object.realpathSync (node:fs:2676:7)
	at Object.<anonymous> (node:electron/js2c/node_init:2:5352)
	at isSameRealPath (c:\Users\19731\.vscode\extensions\james-yu.latex-workshop-9.20.0\out\src\utils\pathnormalize.js:39:28)
	at Object.toTeX (c:\Users\19731\.vscode\extensions\james-yu.latex-workshop-9.20.0\out\src\locate\synctex.js:435:52)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[08:51:14.895][Locator] Backward SyncTeX failed on non-existent d:\yan\�ҵ�\����\С����\latex\1.tex .
@James-Yu
Copy link
Owner

James-Yu commented Apr 17, 2024

Please provide a full log.

edit: please also provide the full path to your tex file.

@Cold-Stars
Copy link
Author

Cold-Stars commented Apr 18, 2024

Please provide a full log.

edit: please also provide the full path to your tex file.

I have updated the log. My tex path is D:\yan\我的\论文\小论文\latex\1.tex

@James-Yu
Copy link
Owner

Did you encounter the same issue with all English paths?

@Cold-Stars
Copy link
Author

Did you encounter the same issue with all English paths?

There are no issues under the English path.

@James-Yu
Copy link
Owner

Please provide the synctex.gz file under CJK path for debug. It is highly like to be a SyncTeX issue.

@Cold-Stars
Copy link
Author

1.synctex.gz

@James-Yu
Copy link
Owner

It is always recommended to use ASCII paths. This commit may fix issues related to synctex binary (as we don't use it now), but the general TeX system works poorly under non-ASCII paths.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants