examples/sortkey.qmd
Open the rendered page · Open the PDF
The rendered page
The fixture below is rendered on its own, the way quarto render examples/sortkey.qmd --to html renders it. This page frames that output rather than reproducing it.
The source
---
title: "quarto-index sort-key probe"
from: markdown-smart
filters:
- index
---
# Terms that file under something other than what they print
Every term below is written so that its sorted position differs from the
position its printed text alone would give it. The order the marks appear in
is deliberately not the order the index must print, and the twin fixture —
this file with every `sort=` attribute removed and nothing else changed —
prints them in a demonstrably different order.
A leading article files under the word that matters:
[The Hague]{.index sort="Hague"}.
A name whose first character sorts nowhere near where a reader looks for it:
[Ångström]{.index sort="Angstrom"}.
A number files where it is spoken:
[10 Downing Street]{.index sort="ten Downing Street"}.
A nobiliary particle is not the surname:
[von Neumann]{.index sort="Neumann"}.
A surname files ahead of the given name that precedes it:
[Édouard Manet]{.index sort="Manet"}.
A second name filed by its surname, whose printed and sorted positions are
chosen so that the two orders of this fixture share no position at all —
without it two of these terms would happen to land in the same slot under
both orders, and the fixture could no longer tell a sorted index from an
unsorted one:
[Ursula K. Le Guin]{.index sort="Le Guin"}.
# One sort key, several marks
The same term marked again, this time with no `sort=` of its own. A sort key
belongs to the entry rather than to the mark that happened to declare it, so
this mark files under `Hague` too — were it to file under its printed text
instead, the index would carry the term twice, in two places, printed
identically: [The Hague]{.index}.
# Sub-entries sort by their own keys
Two sub-entries under one parent, written in the order their printed text
would give them, so the index cannot be right by having left them alone. The
first level of each sort key is empty, which means "file this level under its
own printed text" — only the second level is being redirected.
Turing: []{.index entry="mathematicians!Alan Turing" sort="!Turing"}
Neumann: []{.index entry="mathematicians!von Neumann" sort="!Neumann"}