quarto-dev / quarto-dev/quarto-cli
Lua filter not applied to bibliography in HTML output for multi-page books
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
When rendering a Quarto book project to HTML, I've encountered an issue where a Lua filter (citation-backlinks.lua) is not applied to the bibliography if the bibliography is rendered in a separate references.qmd file as follows:
# References {.unnumbered}
::: {#refs}
:::
This behavior is observed when the project includes a references.qmd file, which moves the bibliography list from the index.html to references.html. The Lua filter is intended to add citation backlinks to the bibliography entries.
This issue does not occur when rendering the book to PDF or DOCX formats, which suggests that the problem might be related to how Quarto processes and applies Lua filters in the context of generating multi-page HTML outputs. In PDF and DOCX formats, the output is self-contained, and the Lua filter is applied successfully to the bibliography.
Steps to reproduce
- Create a Quarto book project with the following structure in
_quarto.yml:
project:
type: book
output-dir: _book
book:
title: Lua Filter Test in Quarto
chapters:
- index.qmd
- references.qmd
bibliography: bib.bib
csl: gb-author-date.csl
format:
html: default
docx: default
pdf: default
- Use the command
quarto render --to html -L _extensions/citation-backlinks/citation-backlinks.luato render the project to HTML. - Observe that the Lua filter is not applied to the bibliography in
references.html.
You can also view the full demo project here.
Expected behavior
The Lua filter should be applied to the bibliography in all output formats, including when the bibliography is rendered in a separate HTML file (references.html) for multi-page book projects.
Actual behavior
The Lua filter is applied successfully in PDF and DOCX outputs but not in the HTML output when the bibliography is rendered in references.html.
Your environment
- IDE: VS Code
- OS: macOS Sonoma 14.5
Quarto check output
$ quarto check
Quarto 1.5.52
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.52
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: v2024.06
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/user/Library/TinyTeX/bin/universal-darwin
Version: 2024
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.10.10
Path: /Users/user/.pyenv/versions/3.10.10/bin/python3
Jupyter: 5.7.2
Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK
Version: 4.4.1
Path: /opt/homebrew/Cellar/r/4.4.1/lib/R
LibPaths:
- /Users/user/.R/packages
- /opt/homebrew/lib/R/4.4/site-library
- /opt/homebrew/Cellar/r/4.4.1/lib/R/library
knitr: 1.47
rmarkdown: 2.27
[✓] Checking Knitr engine render......OK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the command quarto render --to html -L _extensions/citation-backlinks/citation-backlinks.lua with the _quarto.yml and references.qmd structure described, then compare the HTML result with PDF and DOCX output. Trace how multi-page HTML books process the bibliography and invoke the Lua filter; done means citation backlinks appear in references.html.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, lua
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100