examples/demo.qmd

Open the rendered page · Open the PDF

The rendered page

The fixture below is rendered on its own, the way quarto render examples/demo.qmd --to html renders it. This page frames that output rather than reproducing it.

The source

---
title: "quarto-index demo"
# Smart typography is off so the escaping probes below reach the filter as
# the ASCII characters they are written as. With Quarto's default `smart`,
# a typed `"` becomes a curly quote in the document text, and the index
# entry derived from a visible term correctly follows the rendered text —
# which would leave makeindex's quote character unexercised here.
from: markdown-smart
filters:
  - index
---

# Supported forms

The four entry forms, each exercised at least once. The two cross-reference
forms have their own section below.

**Visible term.** The word [pandoc]{.index} is indexed by its own text.
Marking [pandoc]{.index} again, and a third time [pandoc]{.index}, adds
further locators to the same entry.

**Custom entry.** This [phrase]{.index entry="Custom Entry"} stays visible
but indexes under a different term.

**Sub-entries.** A [nested term]{.index entry="Top!Middle!Leaf"} indexes
three levels deep.

**Invisible entry.** This sentence carries a mark with no visible
text.[]{.index entry="Ghost!Sub"}

# Cross-references

A cross-reference sends the reader to another entry instead of listing a
page. Keys here are deliberately distinct from the plain marks above: a term
marked both ways can fail the index build, and the extension says so.

**See.** [cats]{.index see="Felines"} points elsewhere.

**See also.** [dogs]{.index see-also="Pets"} points elsewhere as well as here.

**Multi-level target.** [owls]{.index see="Birds!Owls"} points at a sub-entry.

**Literal bang in a target.** [bang]{.index see="Wow!!Hey"}.

**Cross-reference from a sub-entry.**
[foxes]{.index entry="Canids!Foxes" see="Vulpes"}.

**Invisible cross-reference.**[]{.index entry="Ghosts" see-also="Spirits"}

**Both attributes on one mark**, which warns and emits one entry carrying
both targets: [both]{.index see="Aye" see-also="Bee"}.

**Targets.** Each target above names one of the entries marked below, so every
cross-reference resolves. The marks carry no visible text, so this paragraph
prints nothing after this sentence.
[]{.index entry="Felines"} []{.index entry="Pets"}
[]{.index entry="Birds!Owls"} []{.index entry="Wow!!Hey"}
[]{.index entry="Vulpes"} []{.index entry="Spirits"}
[]{.index entry="Aye"} []{.index entry="Bee"}

# Level syntax probes

A literal exclamation mark is written `!!`.

Leading: [lead]{.index entry="!!Bang leads"}.
Medial: [mid]{.index entry="Wow!!Really"}.
Trailing: [trail]{.index entry="Trail bang!!"}.
Odd run: [odd]{.index entry="A!!!B"}.
Backslash level: [bslash]{.index entry="\\"}.
Old spelling: [old]{.index entry="Alpha\!Beta"}.
Empty level: [empty]{.index entry="A!!B!"}.
Too deep: [deep]{.index entry="One!Two!Three!Four!Five!"}.

# Escaping probes

Every character of the escape domain across visible terms. These
are kept short so each fits one line of the two-column printed index:
[pct % amp & hash #]{.index}, [us \_ brace \{ \}]{.index},
[bs \\ tilde \~ caret \^]{.index}, [dollar \$ at @ bar \|]{.index}, and
[bang ! quote "]{.index}.

The same characters in an `entry=` level:
[entry specials]{.index entry="Specials % & # _ { } \\ ~ ^ $ @ | !! \" < >"}.

Leading and trailing specials in visible terms:
[\{Braced\}]{.index} and [\~tilde dollar\$]{.index}.

Angle brackets, which Pandoc's own LaTeX writer escapes:
[less \< more \>]{.index}.

Non-ASCII, which IP2 requires to appear correctly in the index:
[café naïve]{.index} and [Grüße]{.index entry="Grüße!Straße"}.