cite-this

A Quarto extension for citing books and websites

Author

Lucas S. B. Jordão

Published

August 1, 2026

cite-this adds a “how to cite” control to a Quarto book or website. One click copies the citation — either as text formatted by a CSL style, or as a BibTeX @misc entry carrying both the publication date and the access date.

Everything is resolved at render time, in Lua. The browser never formats a citation: it only picks which ready-made variant to copy. That is why the extension works with embed-resources: true, needs no JavaScript library, and still shows a correct citation when JavaScript is disabled.

0.1 Installation

quarto add lsbjordao/quarto-cite-this

Then add the filter in _quarto.yml:

filters:
  - cite-this

That is the whole setup. The extension reads what your project already declares — title, author, date and site-url — and needs no further configuration to work.

0.2 What it produces

Every page offers two citations: this page and the whole work. Here is the control, rendered live on this page:

Cite this
Jordão, L. S. B. (2026). cite-this. https://lsbjordao.github.io/quarto-cite-this/

The text above is not a mock-up. It is generated by the same code path the button copies from.

0.3 Where the control appears

position decides where the control is injected. Each chapter of this book overrides it in its own front matter, so you can see all of them working in the same site — see Positions.

This Overview page has no navbar so both sidebars are easy to compare. Use the switch below to move the same live control instantly; this switch belongs only to the example. In a real project, the author chooses one position in YAML and readers do not see a switch.

value behaviour
title directly below the page or chapter title
sidebar in the book navigation sidebar
margin-sidebar in the page table-of-contents actions
navbar as an icon in the navigation bar
floating a pill fixed to a corner of the viewport (the default)
inline nothing is injected; only the {{< cite-this >}} shortcode renders
none disables automatic injection entirely

The control is collapsed by default and expands on hover, on keyboard focus, or on tap. It never expands on hover alone — a control that only responds to a mouse is a control that keyboard and touch users cannot reach.

0.4 Citation styles

Seven CSL styles ship with the extension: ABNT, APA, IEEE, MLA, Harvard, Chicago and Vancouver. Five of them are enabled by default, with APA selected initially. Any .csl file of your own works too, by path:

extensions:
  cite-this:
    styles: [abnt, apa, my-styles/custom.csl]
    default-style: apa

If your document already declares a csl: and you do not set default-style, that style becomes the default — the citation your readers copy then matches the references of the document itself.

chicago is bundled but stays out of the default list on purpose: it costs about 1.5 s per citeproc call, against 2–100 ms for every other style. In a book with many chapters that difference is measured in minutes.

0.5 Configuration reference

Every key under extensions.cite-this is optional. The values below are the defaults.

extensions:
  cite-this:
    position: floating       # floating | sidebar | margin-sidebar | title | navbar | inline | none
    corner: bottom-right     # floating only: bottom-(right|left) | top-(right|left)
    scope: both              # both | work | page
    default-scope: page      # which tab opens first when scope is both
    styles: [apa, abnt, ieee, mla, harvard]
    use-document-csl: true   # offer the document's own csl: as the first choice
    default-style: apa       # ignored when the document declares csl:
    access-date: build       # build | YYYY-MM-DD
    actions: [text, bibtex, download]
    show-label: true
    remember-choice: true    # remember the reader's style in localStorage
    formats: [html]
    collapsed: false         # inline block only: wrap it in <details>
    label: ~                 # overrides the translated label
    bibtex:
      type: misc
      key: "{author}{year}{title}"
      filename: "{key}.bib"

The names mirror Quarto’s own elements: #quarto-sidebar on the left and #quarto-margin-sidebar on the right.

Interface text follows the document lang: and ships in English, Portuguese and Spanish.

0.6 Overriding the metadata

When the derived data is wrong or incomplete — a site with no author, a work with a DOI, a chapter whose real title differs from its heading — declare the CSL fields directly:

extensions:
  cite-this:
    work:
      publisher: "Independently published"
      doi: "10.5281/zenodo.1234567"
      isbn: "978-85-000-0000-0"
    page:
      title: "Fabaceae of the Brazilian Cerrado"

These take precedence over everything the extension derives on its own.

0.7 Where to go next

  • Positions — the same control in every position
  • Scopes — citing the page against citing the whole work
  • BibTeX and styles — the @misc entry, the key pattern, and switching CSL styles