quarto-dev / quarto-dev/quarto

Feature Request: Option to Suppress Automatic Bibliography in PDF Output

Open
#386 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
645
Forks
62
Avg merge
17h 42m
Merged PRs (30d)
13

Description

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:

pdf:
  bibliography: none  # or some similar keyword to indicate suppression

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:

book:
...
  chapters:
    - index.qmd
...
    - 27-references.qmd
  appendices:
    - 31-irb.qmd
...

bibliography: references.bib
csl: "csl/apa7-single-spaced.csl"

...

  pdf:
    link-citations: true
    cite-method: "biblatex"
    biblio-style: "apa"
    biblatexoptions: 
      - "backend=biber"
      - "backref=true"
    template: tex/template.tex

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:

::: {.unlisted #27-references}
# References

<!-- For PDF output -->
::: {#refs .latex}
\begingroup
\raggedright
\printbibliography[heading=none]
\endgroup
:::

<!-- For HTML output -->
::: {#refs .html}
:::
:::

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:

# References {#27-references .unnumbered}

\begingroup
\raggedright
\printbibliography[heading=none]
\endgroup

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!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the bibliography and PDF settings in _quarto.yml, then compare the behavior of 27-references.qmd with tex/template.tex during PDF rendering. Trace where Quarto adds the automatic bibliography and determine how a PDF-only suppression option could preserve the manually inserted biblatex output. Done means PDF contains the bibliography once under user control while HTML rendering remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, yaml
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.