Repository navigation
Conversation
The latexmk emulation ran BibTeX for natbib whenever the .aux file had
any one of \citation, \bibdata or \bibstyle. The check was ported from
TinyTeX's require_bibtex(), which requires all three; the single
alternation regex turned that AND into an OR.
A document with no citation still gets \bibstyle and \bibdata in its
.aux file when a bibliography and a style are set, which is what
templates that always set a style do (quarto-journals/springer sets
sn-basic). BibTeX then runs, reports "I found no \citation commands",
and when the style is not installed the render fails after the PDF was
written.
The new smoke-all tests cover a document without citations (BibTeX
must not run, with a style that is not installed so a run would fail
the render), a document with a citation, and a document using
nocite: @*, which writes \citation{*} and must still run BibTeX.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…e-of-citation-bibdata-bibstyle-tinytex-requires-all-three
cderv
deleted the
fix/latexmk-runs-bibtex-when-aux-has-only-one-of-citation-bibdata-bibstyle-tinytex-requires-all-three
branch
November 16, 2026 19:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a PDF document uses
cite-method: natbibwith a bibliography and a bibliography style but cites nothing, BibTeX still runs. It reportsI found no \citation commands, and when the style file is not installed the render fails after the PDF was written. Templates that always set a style hit this with every document without citations, likequarto-journals/springerin #15376.Root cause
Before running BibTeX, Quarto reads the
.auxfile written by LaTeX, which records the citations (\citation), the bibliography files (\bibdata) and the style (\bibstyle). The check passed when any one of the three was present (src/command/render/latexmk/pdf.ts:591). A document with a bibliography and a style but no citation only has\bibdataand\bibstyle, so BibTeX ran for nothing.The same check in TinyTeX's
latexmk()(require_bibtex()) requires all three, since rstudio/tinytex@732ca9b.Fix
The check now requires
\citation,\bibdataand\bibstyle, as TinyTeX does. A document usingnocite: '@*'still runs BibTeX, as it writes\citation{*}. biblatex with biber is not affected, it does not use this check.New smoke-all tests cover a document without citation (with a style that is not installed, so a BibTeX run would fail the render), a document with a citation, and a document with
nocite.The missing
.bstauto-install and the Windows crash reported in #15376 are not addressed here.Related to #15376
Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.