Open TomBener opened 4 days ago
I did not look in detail, but a reminder that currently settings up Lua filters to run after --citeproc
by Pandoc is not possible
Using -L
at command for quarto render is a 'hack' for Quarto as the filter is not inserted into the filter chain like with filters:
in configuration. It is even probably an oversight that we do not catch this -L
at command line to do the right thing for Quarto.
We discussed this already in
and my comment still applies
Using quarto render -L as you did works because in this case the filters is independently added to the list of filters to run. It could work for some filters, but would not for other more tied to Lua API for example. Those need to be in the filter chain.
Probably for HTML books this is required to be in the filter chain.
This type of usage probably needs to wait for #7888 to be solved.
@cderv Thanks for your response. I also suspect the issue may be related to citeproc
, but the weird thing is that it only happens when rendering multi-page HTML, while PDF and DOCX work well. This is the reason why I submitted the issue.
but the weird thing is that it only happens when rendering multi-page HTML, while PDF and DOCX work well.
The chain of processing is different. as you suspect PDF and DOCX are single processed doc, where for HTML book each .qmd is resolved independently and then some processing creates the book websites. So the problem may lie there.
I'll keep this one open and not a full duplicate of #7888 so that we can investigate more
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:This behavior is observed when the project includes a
references.qmd
file, which moves the bibliography list from theindex.html
toreferences.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
_quarto.yml
:quarto render --to html -L _extensions/citation-backlinks/citation-backlinks.lua
to render the project to HTML.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
Quarto check output