James-Yu / LaTeX-Workshop

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

Can we continue to compile the citation even the bibtex has some error (like overleaf)? #3583

Closed quarkquartet closed 1 year ago

quarkquartet commented 1 year ago

Preliminary questions [Required]

Disable all the other extensions except for LaTeX Workshop, restart VS Code, and check that you can not see the requested feature. [Required]

Yes

Make sure to visit the wiki FAQ before requesting a feature.

Yes

If your requested feature is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.

You can compile a TeX document manually?: Yes

Is your requested feature related to a problem? Please describe. [Required]

Sometimes the bibtex compilation gives some errors.

Yes, I admit that there are indeed errors. But most of the editors or workshops, like Mac TeX, overleaf, emacs-auctex, etc, can continue to work and generate the PDF file with compiled citations so that I did not even notice the errors. But the VSCode latex workshop will stop once the bibtex finds an error. The generated pdf thus does not have the citations. I have to do it manually.

To Reproduce [Required]

Very simple.

The attached .zip file is a very simple example. Just a few lines. Compile it in vscode, and you see that the pdf has question marks in the citation bracket. But if you compile it with emacs-auctex or overleaf, it immediately give you the whole pdf file. If you run mac tex shop and do it step-by-step manually, you can also get the good pdf. Archive.zip

Describe the solution you'd like [Required]

Just add a feature to continue compiling with the error.

Logs [Required]

Please paste the whole log messages here, not parts of ones. The log should start with Initializing LaTeX Workshop. It is very important to identify problems.

LaTeX Workshop Output [Required]

[01:32:13] Initializing LaTeX Workshop.
[01:32:13] Extension root: /Users/quarkquartet/.vscode/extensions/james-yu.latex-workshop-9.1.1
[01:32:13] $PATH: /Users/quarkquartet/Work/hepmc2root/bin:/Users/quarkquartet/envs/base/bin:/Users/quarkquartet/Work/root/bin:/Users/quarkquartet/Work/pythia8-install/bin:/Users/quarkquartet/bin:/usr/local/bin:/usr/local/sbin:/Users/quarkquartet/.emacs.d/bin:/Users/quarkquartet/go/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin
[01:32:13] $SHELL: /bin/zsh
[01:32:13] $LANG: undefined
[01:32:13] $LC_ALL: undefined
[01:32:13] process.platform: darwin
[01:32:13] process.arch: x64
[01:32:13] vscode.env.appName: Visual Studio Code
[01:32:13] vscode.env.remoteName: undefined
[01:32:13] vscode.env.uiKind: 1
[01:32:13] Configuration for workspace: file:///Users/quarkquartet/Dropbox/Research_Project/2022-1-SFOPT_light_singlet/01-Draft
[01:32:13] editor.acceptSuggestionOnEnter: "on"
[01:32:13] latex-workshop.bind.enter.key: true
[01:32:13] latex-workshop.docker.enabled: false
[01:32:13] latex-workshop.docker.image.latex: ""
[01:32:13] latex-workshop.hover.preview.mathjax.extensions: []
[01:32:13] latex-workshop.intellisense.package.enabled: true
[01:32:13] latex-workshop.intellisense.update.aggressive.enabled: false
[01:32:13] latex-workshop.intellisense.update.delay: 1000
[01:32:13] latex-workshop.latex.autoBuild.run: "never"
[01:32:13] latex-workshop.latex.build.forceRecipeUsage: true
[01:32:13] latex-workshop.latex.outDir: "%DIR%"
[01:32:13] latex-workshop.latex.recipes: [
 {
  "name": "latexmk 🔃",
  "tools": [
   "latexmk"
  ]
 },
 {
  "name": "latexmk (latexmkrc)",
  "tools": [
   "latexmk_rconly"
  ]
 },
 {
  "name": "latexmk (lualatex)",
  "tools": [
   "lualatexmk"
  ]
 },
 {
  "name": "latexmk (xelatex)",
  "tools": [
   "xelatexmk"
  ]
 },
 {
  "name": "pdflatex ➞ bibtex ➞ pdflatex × 2",
  "tools": [
   "pdflatex",
   "bibtex",
   "pdflatex",
   "pdflatex"
  ]
 },
 {
  "name": "Compile Rnw files",
  "tools": [
   "rnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "Compile Jnw files",
  "tools": [
   "jnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "tectonic",
  "tools": [
   "tectonic"
  ]
 }
]
[01:32:13] latex-workshop.latex.tools: [
 {
  "name": "latexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-pdf",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "lualatexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-lualatex",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "xelatexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-xelatex",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "latexmk_rconly",
  "command": "latexmk",
  "args": [
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "pdflatex",
  "command": "pdflatex",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "bibtex",
  "command": "bibtex",
  "args": [
   "%DOCFILE%"
  ],
  "env": {}
 },
 {
  "name": "rnw2tex",
  "command": "Rscript",
  "args": [
   "-e",
   "knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')"
  ],
  "env": {}
 },
 {
  "name": "jnw2tex",
  "command": "julia",
  "args": [
   "-e",
   "using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")"
  ],
  "env": {}
 },
 {
  "name": "jnw2texmintex",
  "command": "julia",
  "args": [
   "-e",
   "using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")"
  ],
  "env": {}
 },
 {
  "name": "tectonic",
  "command": "tectonic",
  "args": [
   "--synctex",
   "--keep-logs",
   "%DOC%.tex"
  ],
  "env": {}
 }
]
[01:32:13] latex-workshop.viewer.pdf.internal.keyboardEvent: "auto"
[01:32:13] Configuration for workspace: file:///Users/quarkquartet/Dropbox/Research_Project/2020-12-MUonE/01-Draft
[01:32:13] editor.acceptSuggestionOnEnter: "on"
[01:32:13] latex-workshop.bind.enter.key: true
[01:32:13] latex-workshop.docker.enabled: false
[01:32:13] latex-workshop.docker.image.latex: ""
[01:32:13] latex-workshop.hover.preview.mathjax.extensions: []
[01:32:13] latex-workshop.intellisense.package.enabled: true
[01:32:13] latex-workshop.intellisense.update.aggressive.enabled: false
[01:32:13] latex-workshop.intellisense.update.delay: 1000
[01:32:13] latex-workshop.latex.autoBuild.run: "never"
[01:32:13] latex-workshop.latex.build.forceRecipeUsage: true
[01:32:13] latex-workshop.latex.outDir: "%DIR%"
[01:32:13] latex-workshop.latex.recipes: [
 {
  "name": "latexmk 🔃",
  "tools": [
   "latexmk"
  ]
 },
 {
  "name": "latexmk (latexmkrc)",
  "tools": [
   "latexmk_rconly"
  ]
 },
 {
  "name": "latexmk (lualatex)",
  "tools": [
   "lualatexmk"
  ]
 },
 {
  "name": "latexmk (xelatex)",
  "tools": [
   "xelatexmk"
  ]
 },
 {
  "name": "pdflatex ➞ bibtex ➞ pdflatex × 2",
  "tools": [
   "pdflatex",
   "bibtex",
   "pdflatex",
   "pdflatex"
  ]
 },
 {
  "name": "Compile Rnw files",
  "tools": [
   "rnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "Compile Jnw files",
  "tools": [
   "jnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "tectonic",
  "tools": [
   "tectonic"
  ]
 }
]
[01:32:13] latex-workshop.latex.tools: [
 {
  "name": "latexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-pdf",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "lualatexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-lualatex",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "xelatexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-xelatex",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "latexmk_rconly",
  "command": "latexmk",
  "args": [
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "pdflatex",
  "command": "pdflatex",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "bibtex",
  "command": "bibtex",
  "args": [
   "%DOCFILE%"
  ],
  "env": {}
 },
 {
  "name": "rnw2tex",
  "command": "Rscript",
  "args": [
   "-e",
   "knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')"
  ],
  "env": {}
 },
 {
  "name": "jnw2tex",
  "command": "julia",
  "args": [
   "-e",
   "using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")"
  ],
  "env": {}
 },
 {
  "name": "jnw2texmintex",
  "command": "julia",
  "args": [
   "-e",
   "using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")"
  ],
  "env": {}
 },
 {
  "name": "tectonic",
  "command": "tectonic",
  "args": [
   "--synctex",
   "--keep-logs",
   "%DOC%.tex"
  ],
  "env": {}
 }
]
[01:32:13] latex-workshop.viewer.pdf.internal.keyboardEvent: "auto"
[01:32:13] Configuration for workspace: file:///Users/quarkquartet/Work/test
[01:32:13] editor.acceptSuggestionOnEnter: "on"
[01:32:13] latex-workshop.bind.enter.key: true
[01:32:13] latex-workshop.docker.enabled: false
[01:32:13] latex-workshop.docker.image.latex: ""
[01:32:13] latex-workshop.hover.preview.mathjax.extensions: []
[01:32:13] latex-workshop.intellisense.package.enabled: true
[01:32:13] latex-workshop.intellisense.update.aggressive.enabled: false
[01:32:13] latex-workshop.intellisense.update.delay: 1000
[01:32:13] latex-workshop.latex.autoBuild.run: "never"
[01:32:13] latex-workshop.latex.build.forceRecipeUsage: true
[01:32:13] latex-workshop.latex.outDir: "%DIR%"
[01:32:13] latex-workshop.latex.recipes: [
 {
  "name": "latexmk 🔃",
  "tools": [
   "latexmk"
  ]
 },
 {
  "name": "latexmk (latexmkrc)",
  "tools": [
   "latexmk_rconly"
  ]
 },
 {
  "name": "latexmk (lualatex)",
  "tools": [
   "lualatexmk"
  ]
 },
 {
  "name": "latexmk (xelatex)",
  "tools": [
   "xelatexmk"
  ]
 },
 {
  "name": "pdflatex ➞ bibtex ➞ pdflatex × 2",
  "tools": [
   "pdflatex",
   "bibtex",
   "pdflatex",
   "pdflatex"
  ]
 },
 {
  "name": "Compile Rnw files",
  "tools": [
   "rnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "Compile Jnw files",
  "tools": [
   "jnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "tectonic",
  "tools": [
   "tectonic"
  ]
 }
]
[01:32:13] latex-workshop.latex.tools: [
 {
  "name": "latexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-pdf",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "lualatexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-lualatex",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "xelatexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-xelatex",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "latexmk_rconly",
  "command": "latexmk",
  "args": [
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "pdflatex",
  "command": "pdflatex",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "bibtex",
  "command": "bibtex",
  "args": [
   "%DOCFILE%"
  ],
  "env": {}
 },
 {
  "name": "rnw2tex",
  "command": "Rscript",
  "args": [
   "-e",
   "knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')"
  ],
  "env": {}
 },
 {
  "name": "jnw2tex",
  "command": "julia",
  "args": [
   "-e",
   "using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")"
  ],
  "env": {}
 },
 {
  "name": "jnw2texmintex",
  "command": "julia",
  "args": [
   "-e",
   "using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")"
  ],
  "env": {}
 },
 {
  "name": "tectonic",
  "command": "tectonic",
  "args": [
   "--synctex",
   "--keep-logs",
   "%DOC%.tex"
  ],
  "env": {}
 }
]
[01:32:13] latex-workshop.viewer.pdf.internal.keyboardEvent: "auto"
[01:32:13] Creating a new file watcher.
[01:32:13] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{"stabilityThreshold":250}}
[01:32:13] Creating PDF file watcher.
[01:32:13] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{}}
[01:32:13] Creating Bib file watcher.
[01:32:13] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{"stabilityThreshold":250}}
[01:32:13] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[01:32:13] [Server] Creating LaTeX Workshop http and websocket server.
[01:32:13] LaTeX Workshop initialized.
[01:32:13] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"]
[01:32:13] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["year-desc"],"alignOnEqual":true,"sortFields":true,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[01:32:13] Current workspace folders: ["file:///Users/quarkquartet/Dropbox/Research_Project/2022-1-SFOPT_light_singlet/01-Draft","file:///Users/quarkquartet/Dropbox/Research_Project/2020-12-MUonE/01-Draft","file:///Users/quarkquartet/Work/test"]
[01:32:13] Found root file from active editor: /Users/quarkquartet/Work/test/test.tex
[01:32:13] Root file changed: from undefined to /Users/quarkquartet/Work/test/test.tex
[01:32:13] Start to find all dependencies.
[01:32:13] Root file languageId: latex
[01:32:13] Reset file watcher.
[01:32:13] Parsing a file and its subfiles: /Users/quarkquartet/Work/test/test.tex
[01:32:13] Found .bib file: /Users/quarkquartet/Work/test/test.bib
[01:32:13] Added to bib file watcher: /Users/quarkquartet/Work/test/test.bib
[01:32:13] Parsing .bib entries from /Users/quarkquartet/Work/test/test.bib
[01:32:13] [Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":64248}
[01:32:13] Added to file watcher: /Users/quarkquartet/Work/test/test.tex
[01:32:13] Snippet data loaded.
[01:32:13] [Server] valdOrigin is http://127.0.0.1:64248
[01:32:13] Restoring the PDF viewer at the column 1 from the state: {"type":"state","state":{"pdfFileUri":"file:///Users/quarkquartet/Work/test/test.pdf","scale":"auto","scrollMode":0,"spreadMode":0,"scrollTop":0,"scrollLeft":0,"trim":0,"synctexEnabled":true,"autoReloadEnabled":true}}
[01:32:13] The internal PDF viewer url: http://127.0.0.1:64248/viewer.html?file=pdf..ZmlsZSUzQSUyRiUyRiUyRlVzZXJzJTJGcXVhcmtxdWFydGV0JTJGV29yayUyRnRlc3QlMkZ0ZXN0LnBkZg
[01:32:13] Added to PDF file watcher: file:///Users/quarkquartet/Work/test/test.pdf
[01:32:13] Parsed 2 bib entries from /Users/quarkquartet/Work/test/test.bib.
[01:32:13] Parse fls file.
[01:32:13] Cannot find fls file: /Users/quarkquartet/Work/test/test.fls
[01:32:13] Checking for duplicate labels: /Users/quarkquartet/Work/test/test.tex.
[01:32:14] Handle data type: open
[01:32:14] Preview PDF file: file:///Users/quarkquartet/Work/test/test.pdf
[01:32:14] Handle data type: loaded
[01:32:15] Manager.fileWatcher.getWatched: {"/Users/quarkquartet/Work/test":["test.tex"]}
[01:32:15] Manager.filesWatched: ["/Users/quarkquartet/Work/test/test.tex"]
[01:32:15] BibWatcher.bibWatcher.getWatched: {"/Users/quarkquartet/Work/test":["test.bib"]}
[01:32:15] BibWatcher.bibsWatched: ["/Users/quarkquartet/Work/test/test.bib"]
[01:32:15] PdfWatcher.pdfWatcher.getWatched: {"/Users/quarkquartet/Work/test":["test.pdf"]}
[01:32:15] PdfWatcher.pdfsWatched: ["/Users/quarkquartet/Work/test/test.pdf"]
[01:32:15] PdfWatcher.watchedPdfVirtualUris: []
[01:32:15] PdfWatcher.ignoredPdfUris: []
[01:32:16] BUILD command invoked.
[01:32:16] The document of the active editor: file:///Users/quarkquartet/Work/test/test.tex
[01:32:16] The languageId of the document: latex
[01:32:16] Current workspace folders: ["file:///Users/quarkquartet/Dropbox/Research_Project/2022-1-SFOPT_light_singlet/01-Draft","file:///Users/quarkquartet/Dropbox/Research_Project/2020-12-MUonE/01-Draft","file:///Users/quarkquartet/Work/test"]
[01:32:16] Found root file from active editor: /Users/quarkquartet/Work/test/test.tex
[01:32:16] Keep using the same root file: /Users/quarkquartet/Work/test/test.tex
[01:32:16] Building root file: /Users/quarkquartet/Work/test/test.tex
[01:32:16] Build root file /Users/quarkquartet/Work/test/test.tex
[01:32:16] outDir: /Users/quarkquartet/Work/test
[01:32:16] Preparing to run recipe: latexmk 🔃
[01:32:16] Recipe step 1: latexmk
[01:32:16] Recipe step 1 args: ["-synctex=1","-interaction=nonstopmode","-file-line-error","-pdf","-outdir=/Users/quarkquartet/Work/test","/Users/quarkquartet/Work/test/test"]
[01:32:16] Recipe step env: {}
[01:32:16] Recipe step root file: /Users/quarkquartet/Work/test/test.tex
[01:32:16] cwd: /Users/quarkquartet/Work/test
[01:32:16] LaTeX build process spawned. PID: 3235.
[01:32:17] BibTeX log parsed with 1 messages.
[01:32:17] LaTeX log parsed with 8 messages.
[01:32:17] Recipe returns with error: 12/null. PID: 3235. message: Latexmk: ====List of undefined refs and citations:
  Citation `Ahriche:2007jp' on page 1 undefined on input line 8
  Citation `Alimena:2021mdu' on page 1 undefined on input line 8
  Reference `LastBibItem' on page 1 undefined on input line 9
Latexmk: If appropriate, the -f option can be used to get latexmk
  to try to force complete processing.
.
[01:32:17] Does the executable exist? $PATH: /Users/quarkquartet/Work/hepmc2root/bin:/Users/quarkquartet/envs/base/bin:/Users/quarkquartet/Work/root/bin:/Users/quarkquartet/Work/pythia8-install/bin:/Users/quarkquartet/bin:/usr/local/bin:/usr/local/sbin:/Users/quarkquartet/.emacs.d/bin:/Users/quarkquartet/go/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin
[01:32:17] Does the executable exist? $Path: undefined
[01:32:17] The environment variable $SHELL: /bin/zsh
[01:32:26] LOG command invoked: default

Developer Tools Console [Required]

workbench.desktop.main.js:774 Recipe terminated with error.
c @ workbench.desktop.main.js:774
workbench.desktop.main.js:89 [Extension Host] goto-previous-buffer: CHANGED to: extension-output-James-Yu.latex-workshop-#1-LaTeX Workshop

Screenshots

The VSCode output:

image

Overleaf output

image

Desktop [Required]

Please write exact version numbers. Please don't write latest instead of exact numbers.

Additional questions

Are you using VSCodium?

No

Are you using the Snap or Flatpack versions of VS Code?

No

Are you using LaTeX Workshop with VS Code Remote?

No

If the answer is Yes, please write which one you are using. Write the versions of the remote extension.

Additional context

Add any other context about the problem here.

James-Yu commented 1 year ago

You can create a script to wrap bibtex and always return zero despite the returning code. I personally don't favor compilation over errors.