Special sections and tabsets
What the Typst filters move, renumber, and unwrap.
Two filters reorganise a document for Typst output. Neither one acts on HTML or on a Reveal.js deck.
The options of the format itself are on Typst format.
The classes go on a heading
A special section is marked on the heading, not on a div.
## References {.references}
## Appendix {.appendix}
## Supplementary material {.supplementary}A section runs from its heading to the next ordinary heading of the same level or a higher one. Everything in between travels with it.
What the filter does
Each special section is moved to the end of the document. The order is always references, then appendix, then supplementary, whatever order the source uses.
At the start of each section:
- The heading counter resets to zero.
- The figure counter resets to zero.
- References get no heading numbering.
- An appendix and a supplementary section each get their own numbering scheme.
So a figure in an appendix is numbered from one again, under the appendix scheme, rather than continuing the sequence of the body.
A worked document
---
title: "A report"
format: mcanouil-typst
---
## Introduction
The body of the report.
## Appendix {.appendix}
A table that supports the argument.
## Results
More of the body.
## References {.references}The appendix heading is followed by an ordinary heading of the same level, Results, so the appendix holds one section only. Results stays in the body. The rendered document ends with the references, and then the appendix, in that order, whichever came first in the source.
In HTML output
The extension does nothing here, and Quarto does.
Quarto has its own appendix, and it collects a section marked {.appendix} or {.references} into it, at the foot of the page. A section marked {.supplementary} is left where it is written, because that class is the extension’s own.
So the classes move a section in both formats, for different reasons, and they do not move the same set. The numbering stays as Quarto produces it, because the renumbering is the Typst filter’s work.
Set appendix-style: none to keep every section in source order:
---
title: "A report"
format:
mcanouil-html:
appendix-style: none
---A document that must read the same in both formats should either set that, or write its sections in the order the Typst output produces, which is references, then appendix, then supplementary.
Tabsets
A tabset is Quarto’s own .panel-tabset div.
::: {.panel-tabset}
## R
The R version.
## Python
The Python version.
:::HTML output gives the tabbed interface Quarto normally produces.
Typst has no tabs, so the filter unwraps the div and turns the structure into headings. Each tab name becomes a heading, at level 2 at the shallowest. Any heading written inside a tab moves below the tab name, so the outline still nests correctly.
The Reference lists the classes. The Limitations section states which features are Typst only.