Typst support

This commit is contained in:
Bastien Dumont
2025-12-07 21:20:23 +01:00
parent fb14bd7a02
commit f3907ff28f
2 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# Marginal notes in Pandoc for semantically marked spans of text
`margin-notes` enables you to create unnumbered marginal notes from spans with user-defined class and properties. It currently only works with LaTeX, ConTeXt and, to a limited extent, DOCX (using tooltips instead of marginal notes) and ODT (using annotations).
`margin-notes` enables you to create unnumbered marginal notes from spans with user-defined class and properties. It currently only works with LaTeX, ConTeXt, Typst, and, to a limited extent, DOCX (using tooltips instead of marginal notes) and ODT (using annotations).
## Defining the renderings
@ -38,7 +38,7 @@ as [raw LaTeX]{.term
}, not as Markdown.
```
In LaTeX and ConTeXt, if the span has an identifier (like `#bibtex` above), it will be used as the label of the note.
In LaTeX, ConTeXt and Typst, if the span has an identifier (like `#bibtex` above), it will be used as the label of the note.
For DOCX output, the note is set as the content of a tooltip attached to an asterisk following the body text. Since this does not always produce good results, notably because tooltips only display plain strings, DOCX output is deactivated by default. However, you can activate it for individual classes by setting the variables `docx-body-text` and `docx-note-text`:
@ -121,6 +121,8 @@ By default, in LaTeX and ConTeXt, all marginal notes are rendered by the macro `
alternative=serried]
```
In Typst, the filter uses the `#note` command provided by [marginalia](https://typst.app/universe/package/marginalia). The package has to be loaded explicitly by the user.
However, you can associate different macros/commands with individual classes by setting the variable `csname`:
``` yaml
@ -131,7 +133,7 @@ mrgnn-define-renderings:
csname: mrgnnTerm
```
In that case, you will have to define `\mrgnnTerm` in your LaTeX or ConTeXt template or via `header-includes`. This macro takes one argument, which is the result of the processing of `note-text`.
In that case, you will have to define `\mrgnnTerm` in your LaTeX or ConTeXt template or via `header-includes`. This macro takes one argument, which is the result of the processing of `note-text`. In Typst, you will similarly have to define `#mrgnnTerm[note body]<id>`.
The position of the instructions about the marginal note in the output file can be set _via_ the variable `position`. They can be placed `after` (default) or `before` the in-text content.