James-Yu / LaTeX-Workshop

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

"latex-workshop.latex.clean.fileTypes" not deleting "*synctex.gz" file types #3864

Closed jsondevers closed 1 year ago

jsondevers commented 1 year ago

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.

Environment*

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

The Issue*

Please briefly describe the issue you come across.

Reproduction Steps

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

  1. Compile the .tex file
  2. Look at what files are produced and which of them are deleted
  3. Specifically, have a settings.json file that does something of the following manner:
    "latex-workshop.latex.clean.fileTypes": [
        "*.aux",
        "*.log",
        // ... (other files)
        "*synctex.gz",  // this is the one that doesn't get deleted
    ],

Expected Behavior

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

Anything Else?

Add any other context about the problem below.

BenjiaH commented 1 year ago

I have the same issue. It won't clean up any files.

"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"
    ],
James-Yu commented 1 year ago

The default config has changed to only delete files that share the same name with root. Do you use the default or change the settings?

James-Yu commented 1 year ago

Please also provide logs. There should be a list of files intended to clean.

jsondevers commented 1 year ago

I have used the default that aims to delete the files that are within the root. It deletes the majority of the files as desired, there is just a problem with the *.synctex.gz extension, I see that there were some updates with that recently.

James-Yu commented 1 year ago

Not this log, but the extension one.

shikibu-z commented 1 year ago

I'm having similar issue, the .bbl and .synctex.gz are both not cleaned in my case.

Here's my log from "View log messages":

[23:04:28][Logger] New log placeholder %WS1% registered for /Users/shikibu/Documents/csc544/p04-shikibu-z .
[23:04:28][Config] latex-workshop.latex.recipes: [{"name":"pdfLaTeX->pdfLaTeX","tools":["pdfLaTeX","pdfLaTeX"]},{"name":"pdfLaTeX->BibTeX->pdfLaTeX->pdfLaTeX","tools":["pdfLaTeX","BibTeX","pdfLaTeX","pdfLaTeX"]},{"name":"pdfLaTeX->Biber->pdfLaTeX->pdfLaTeX","tools":["pdfLaTeX","Biber","pdfLaTeX","pdfLaTeX"]}] .
[23:04:28][Config] latex-workshop.latex.recipe.default: "lastUsed" .
[23:04:28][Config] latex-workshop.latex.tools: [{"name":"pdfLaTeX","command":"pdflatex","args":["-synctex=1","-interaction=nonstopmode","-file-line-error","-shell-escape","%DOCFILE%"]},{"name":"BibTeX","command":"bibtex","args":["%DOCFILE%"]},{"name":"Biber","command":"biber","args":["%DOCFILE%"]}] .
[23:04:28][Config] latex-workshop.latex.autoBuild.run: "never" .
[23:04:28][Config] latex-workshop.latex.autoClean.run: "onBuilt" .
[23:04:28][Config] latex-workshop.latex.clean.fileTypes: ["*.acn","*.acr","*.alg","*.aux","*.bbl","*.bcf","*.blg","*.fdb_latexmk","*.fls","*.glg","*.glo","*.gls","*.idx","*.ind","*.ist","*.lof","*.log","*.lot","*.out","*.synctex.gz","*.toc","*.xml"] .
[23:04:28][Config] latex-workshop.latexindent.path: "/opt/homebrew/bin/latexindent" .
[23:04:28][Manager] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[23:04:28][Server] Creating LaTeX Workshop http and websocket server.
[23:04:28][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":51559} .
[23:04:28][Extension] Initializing LaTeX Workshop.
[23:04:28][Extension] Extension root: /Users/shikibu/.vscode/extensions/james-yu.latex-workshop-9.9.0
[23:04:28][Extension] $PATH: /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
[23:04:28][Extension] $SHELL: /bin/zsh
[23:04:28][Extension] $LANG: undefined
[23:04:28][Extension] $LC_ALL: undefined
[23:04:28][Extension] process.platform: darwin
[23:04:28][Extension] process.arch: arm64
[23:04:28][Extension] vscode.env.appName: Visual Studio Code
[23:04:28][Extension] vscode.env.remoteName: undefined
[23:04:28][Extension] vscode.env.uiKind: 1
[23:04:28][Extension] LaTeX Workshop initialized.
[23:04:28][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[23:04:28][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"]
[23:04:28][Manager] Current workspace folders: ["file://%WS1%"]
[23:04:28][Manager] Current workspaceRootDir: file://%WS1%
[23:04:28][Server] valdOrigin is http://127.0.0.1:51559
[23:04:28][Cacher][Path] Non-existent .fls for %WS1%/intro.tex .
[23:04:28][Cacher][Path] Non-existent .fls for %WS1%/optimize.tex .
[23:04:28][Cacher][Path] Non-existent .fls for %WS1%/update.tex .
[23:04:28][Cacher] Cache not finished on %WS1%/update.tex when getting its children.
[23:04:28][Cacher] Caching %WS1%/update.tex .
[23:04:28][Cacher] Input %WS1%/intro.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/intro.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/intro.tex with a new watcher on %WS1% .
[23:04:28][Cacher] Caching %WS1%/intro.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/intro.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/intro.tex .
[23:04:28][Cacher] Input %WS1%/background.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/background.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/background.tex .
[23:04:28][Cacher] Caching %WS1%/background.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/background.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/background.tex .
[23:04:28][Cacher] Input %WS1%/optimize.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/optimize.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/optimize.tex .
[23:04:28][Cacher] Caching %WS1%/optimize.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/optimize.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/optimize.tex .
[23:04:28][Cacher] Input %WS1%/research.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/research.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/research.tex .
[23:04:28][Cacher] Caching %WS1%/research.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/research.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/research.tex .
[23:04:28][Cacher] Input %WS1%/impact.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/impact.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/impact.tex .
[23:04:28][Cacher] Caching %WS1%/impact.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/impact.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/impact.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/update.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/update.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/intro.tex .
[23:04:28][Cacher] Updated elements of %WS1%/intro.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/intro.tex .
[23:04:28][Cacher] Cached %WS1%/intro.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/background.tex .
[23:04:28][Cacher] Updated elements of %WS1%/background.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/background.tex .
[23:04:28][Cacher] Cached %WS1%/background.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/optimize.tex .
[23:04:28][Cacher] Updated elements of %WS1%/optimize.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/optimize.tex .
[23:04:28][Cacher] Cached %WS1%/optimize.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/research.tex .
[23:04:28][Cacher] Updated elements of %WS1%/research.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/research.tex .
[23:04:28][Cacher] Cached %WS1%/research.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/impact.tex .
[23:04:28][Cacher] Updated elements of %WS1%/impact.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/impact.tex .
[23:04:28][Cacher] Cached %WS1%/impact.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/update.tex .
[23:04:28][Cacher] Updated elements of %WS1%/update.tex .
[23:04:28][Cacher] Bib %WS1%/update.bib from %WS1%/update.tex .
[23:04:28][Intelli][Citation] Parsing .bib entries from %WS1%/update.bib
[23:04:28][Intelli][Citation] Parse BibTeX AST from %WS1%/update.bib .
[23:04:28][Cacher][Watcher] Watched %WS1%/update.bib with a new watcher on %WS1% .
[23:04:28][Cacher] Updated bibs of %WS1%/update.tex .
[23:04:28][Cacher] Cached %WS1%/update.tex .
[23:04:28][Structure] Structure cleared on undefined root.
[23:04:28][Manager] Found root file from parent: %WS1%/update.tex
[23:04:28][Manager] Root file changed: from undefined to %WS1%/update.tex
[23:04:28][Manager] Start to find all dependencies.
[23:04:28][Manager] Root file languageId: latex
[23:04:28][Cacher][Watcher] Reset.
[23:04:28][Cacher] Adding %WS1%/update.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/update.tex with a new watcher on %WS1% .
[23:04:28][Cacher] Caching %WS1%/update.tex .
[23:04:28][Cacher] Input %WS1%/intro.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/intro.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/intro.tex .
[23:04:28][Cacher] Caching %WS1%/intro.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/intro.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/intro.tex .
[23:04:28][Cacher] Input %WS1%/background.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/background.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/background.tex .
[23:04:28][Cacher] Caching %WS1%/background.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/background.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/background.tex .
[23:04:28][Cacher] Input %WS1%/optimize.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/optimize.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/optimize.tex .
[23:04:28][Cacher] Caching %WS1%/optimize.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/optimize.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/optimize.tex .
[23:04:28][Cacher] Input %WS1%/research.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/research.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/research.tex .
[23:04:28][Cacher] Caching %WS1%/research.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/research.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/research.tex .
[23:04:28][Cacher] Input %WS1%/impact.tex from %WS1%/update.tex .
[23:04:28][Cacher] Adding %WS1%/impact.tex .
[23:04:28][Cacher][Watcher] Watched %WS1%/impact.tex .
[23:04:28][Cacher] Caching %WS1%/impact.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/impact.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/impact.tex .
[23:04:28][Cacher] Updated inputs of %WS1%/update.tex .
[23:04:28][Cacher] Parse LaTeX AST with fast-parse: %WS1%/update.tex .
[23:04:28][Intelli][Citation] Parsed 16 bib entries from %WS1%/update.bib .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/update.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/intro.tex .
[23:04:28][Cacher] Updated elements of %WS1%/intro.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/intro.tex .
[23:04:28][Cacher] Cached %WS1%/intro.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/background.tex .
[23:04:28][Cacher] Updated elements of %WS1%/background.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/background.tex .
[23:04:28][Cacher] Cached %WS1%/background.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/optimize.tex .
[23:04:28][Cacher] Updated elements of %WS1%/optimize.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/optimize.tex .
[23:04:28][Cacher] Cached %WS1%/optimize.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/research.tex .
[23:04:28][Cacher] Updated elements of %WS1%/research.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/research.tex .
[23:04:28][Cacher] Cached %WS1%/research.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/impact.tex .
[23:04:28][Cacher] Updated elements of %WS1%/impact.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/impact.tex .
[23:04:28][Cacher] Cached %WS1%/impact.tex .
[23:04:28][DupLabel] Checking for duplicate labels: %WS1%/update.tex .
[23:04:28][Cacher] Updated elements of %WS1%/update.tex .
[23:04:28][Cacher] Bib %WS1%/update.bib from %WS1%/update.tex .
[23:04:28][Cacher] Updated bibs of %WS1%/update.tex .
[23:04:28][Cacher] Cached %WS1%/update.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/update.tex .
[23:04:28][Cacher][Path] Non-existent .fls for %WS1%/update.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/intro.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/intro.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/background.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/background.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/optimize.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/optimize.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/research.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/research.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/impact.tex .
[23:04:28][Structure][LaTeX] Building LaTeX structure from %WS1%/impact.tex .
[23:04:28][Structure] Structure force updated with 6 root sections for %WS1%/update.tex .
[23:04:28][Structure] Structure force updated with 6 root sections for %WS1%/update.tex .
[23:04:30][Structure] Structure updated with 6 root sections for %WS1%/update.tex .
[23:04:30][Structure][LaTeX] Building LaTeX structure from %WS1%/intro.tex .
[23:04:30][Structure][LaTeX] Parse active document LaTeX AST with fast-parse.
[23:04:34][Commander] RECIPES command invoked.
[23:04:34][Commander] BUILD command invoked.
[23:04:34][Commander] The document of the active editor: file://%WS1%/intro.tex
[23:04:34][Commander] The languageId of the document: latex
[23:04:34][Manager] Current workspace folders: ["file://%WS1%"]
[23:04:34][Manager] Keep using the same root file: %WS1%/update.tex
[23:04:34][Structure] Structure updated with 6 root sections for %WS1%/update.tex .
[23:04:34][Commander] Building root file: %WS1%/update.tex
[23:04:34][Builder] Build root file %WS1%/update.tex
[23:04:34][Builder] outDir: %WS1% .
[23:04:34][Builder] Preparing to run recipe: pdfLaTeX->BibTeX->pdfLaTeX->pdfLaTeX.
[23:04:34][Builder] Prepared 4 tools.
[23:04:34][Builder] Recipe step 1 The command is pdflatex:["-synctex=1","-interaction=nonstopmode","-file-line-error","-shell-escape","update"].
[23:04:34][Builder] env: undefined
[23:04:34][Builder] root: %WS1%/update.tex
[23:04:34][Builder] cwd: %WS1%
[23:04:34][Builder] LaTeX build process spawned with PID 63231.
[23:04:34][Structure] Structure updated with 6 root sections for %WS1%/update.tex .
[23:04:34][Parser][TexLog] Logged 31 messages.
[23:04:34][Builder] Finished a step in recipe with PID 63231.
[23:04:34][Builder] Recipe step 2 The command is bibtex:["update"].
[23:04:34][Builder] env: undefined
[23:04:34][Builder] root: %WS1%/update.tex
[23:04:34][Builder] cwd: %WS1%
[23:04:34][Builder] LaTeX build process spawned with PID 63240.
[23:04:34][Parser][BibTeXLog] Logged 1 messages.
[23:04:34][Builder] Finished a step in recipe with PID 63240.
[23:04:34][Builder] Recipe step 2 The command is pdflatex:["-synctex=1","-interaction=nonstopmode","-file-line-error","-shell-escape","update"].
[23:04:34][Builder] env: undefined
[23:04:34][Builder] root: %WS1%/update.tex
[23:04:34][Builder] cwd: %WS1%
[23:04:34][Builder] LaTeX build process spawned with PID 63249.
[23:04:35][Parser][TexLog] Logged 3 messages.
[23:04:35][Builder] Finished a step in recipe with PID 63249.
[23:04:35][Builder] Recipe step 2 The command is pdflatex:["-synctex=1","-interaction=nonstopmode","-file-line-error","-shell-escape","update"].
[23:04:35][Builder] env: undefined
[23:04:35][Builder] root: %WS1%/update.tex
[23:04:35][Builder] cwd: %WS1%
[23:04:35][Builder] LaTeX build process spawned with PID 63258.
[23:04:35][Parser][TexLog] Logged 3 messages.
[23:04:35][Builder] Finished a step in recipe with PID 63258.
[23:04:35][Builder] Successfully built %WS1%/update.tex .
[23:04:35][Viewer] Call refreshExistingViewer: "%WS1%/update.tex" .
[23:04:35][Viewer] Not found PDF viewers to refresh: undefined
[23:04:35][Cacher][Path] Non-existent .fls for %WS1%/update.tex .
[23:04:35][Builder] Auto Clean invoked.
[23:04:35][Cleaner] Clean temporary files command The command is latexmk:["-c","%WS1%/update.tex"].
[23:04:37][Commander] SHOWLOG command invoked: default
James-Yu commented 1 year ago

ok I confirmed that I missed a change log item. In this version, the default cleaner is changed to latexmk. To resume the previous behavior, you may set the clean method config to glob.

jlelong commented 1 year ago

FYI Latexmk considers .synctex.gz files as final outputs similarly as .pdf and .dvi files. Therefore calling latexmk -c does not remove .synctex.gz files.

jlelong commented 1 year ago

Also, note that removing the .synctex.gz file will break all the tex <-> pdf synchronisation mechanisms.

James-Yu commented 1 year ago

Indeed, we may have a way to ensure that such default config changes are more obviously notified. I'm closing this issue for now and submit PRs if I came up with solutions, which are out of scope of this issue.

jsondevers commented 1 year ago

Also, note that removing the .synctex.gz file will break all the tex <-> pdf synchronisation mechanisms.

Depending on when you use clean it may but I cleaned onBuilt and used the dependsOn to help sync the files and had no problems with synchronization with the PDF outputs

James-Yu commented 1 year ago

Depending on when you use clean it may but I cleaned onBuilt and used the dependsOn to help sync the files and had no problems with synchronization with the PDF outputs

This is out of the discussion scope of this extension. You may find https://mg.readthedocs.io/latexmk.html a better place to discuss on the necessity of cleaning .synctex.gz.