Open olearydj opened 8 months ago
Try taking a look at https://quarto.org/docs/authoring/conditional.html
Great, thank you. I'm happy to report that this works a treat for rendering references using citeproc for HTML output and biblatex for PDF.
Unfortunately, I'm still stuck with the original problem - there doesn't appear to be a way to suppress the second bib generation at the end of the doc. Can you confirm?
PS - Quarto is so amazing. Just a joy to work with. Thanks to you and the entire team!
# References {#27-references .unnumbered}
::: {#refs .content-visible when-format="html"}
:::
::: {.content-visible when-format="pdf"}
\begingroup
\raggedright
\printbibliography[heading=none]
\endgroup
:::
I'm currently using Quarto to generate both HTML and PDF documents from the same source. For the PDF version, I need to manually manage the bibliography using biblatex and biber due to specific formatting requirements and the need for back-references. However, I've encountered an issue where Quarto automatically generates a bibliography section at the end of my PDF documents, despite my custom configuration. This results in the bibliography being duplicated: once where I have manually inserted it using LaTeX commands, and once automatically by Quarto.
I would like an option in the Quarto configuration that allows me to suppress the automatic bibliography generation when rendering to PDF. This option would prevent Quarto from automatically adding a bibliography section, enabling me to fully control the bibliography placement and formatting through LaTeX.
For example, an option in the _quarto.yml could be:
I have tried various workarounds, such as modifying the LaTeX template to remove bibliography commands. However, these methods have not been successful in preventing the automatic inclusion of the bibliography by Quarto. It seems like the bibliography rendering is done outside of the config files.
Here are the relevant sections of my
_quarto.yml
file; some sections omitted (...) for brevity:Options for html output are included in the same file, but nothing else specific to bibliography generation. I normally render to HTML for a quick preview, and occasionally to PDF.
Here are the contents of
27-references.qmd
which is used to generate the appropriate content based on render target:That last bit is pretty damn clever, if I do say so myself. H/T to ChatGPT4 for being a know-it-all.I spoke too soon. That code doesn't seem to work after all. I've just reverted to this:For PDF, this approach renders the biblatex references twice, once where I've inserted it, and again at the end of everything else. It leaves the references empty when rendering to HTML.
Thanks!