5  The shortcode

This chapter uses position: inline. Nothing is injected automatically — every control you see below was placed by hand, with a shortcode. It also sets navbar: false, so the book’s top navigation disappears on this page and returns to its project default in the next chapter.

5.1 Placing a block

The shortcode takes no arguments in its simplest form:

{{< cite-this >}}
Cite this
Jordão, L. S. B. (2026, August 1). The shortcode. Cite-This. https://lsbjordao.github.io/quarto-cite-this/shortcode.html

Unlike the injected positions, the inline block never collapses. In the body of your text it is content, not a trigger — hiding it would defeat the reason you placed it there.

5.2 Choosing the scope

Pass page or work to fix a single scope:

{{< cite-this work >}}
Cite this
Jordão, L. S. B. (2026, August 1). cite-this. https://lsbjordao.github.io/quarto-cite-this/

5.3 Choosing the style

style= overrides the default for that block alone, which is useful when a page discusses a specific style:

{{< cite-this page style=ieee >}}
Cite this
[1]
L. S. B. Jordão, “The shortcode,” cite-this. Accessed: Aug. 02, 2026. [Online]. Available: https://lsbjordao.github.io/quarto-cite-this/shortcode.html

5.4 Collapsing it

collapsed=true wraps the block in a <details>, closed on arrival. This is an explicit authoring choice, unrelated to the hover behaviour of the injected positions:

{{< cite-this collapsed=true >}}
Cite this
Jordão, L. S. B. (2026, August 1). The shortcode. Cite-This. https://lsbjordao.github.io/quarto-cite-this/shortcode.html

5.5 Combining with an injected position

inline is not required to use the shortcode. Any page can carry both an injected control and one or more inline blocks — the BibTeX and styles chapter does exactly that, with a floating pill and a block in the text.

Use inline when you want the citation to appear only where you decide, and nowhere else.

5.6 Other output formats

In PDF, Word and other non-HTML formats there is no widget to click. The shortcode falls back to a static block: the formatted citation followed by the BibTeX entry in a code block, so the information survives the format change.

Which formats get output at all is controlled by formats:

extensions:
  cite-this:
    formats: [html, pdf]

Anything not listed produces nothing — no block, no injection.