From 0c33c7ca63d434587c5f4d328db30df9fc0f284f Mon Sep 17 00:00:00 2001 From: bgero Date: Sun, 15 Dec 2024 16:34:09 +1100 Subject: [PATCH] Added an example to the README, which allows for styling only the glossarium references, while leaving the style of other references alone. --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index fcdfde2..55c4238 100644 --- a/README.md +++ b/README.md @@ -178,3 +178,18 @@ I recommend setting a show rule for the links to that your readers understand th #show link: set text(fill: blue.darken(60%)) // links are now blue ! ``` + +It is also possible to apply styling specifically to the glossarium references, like in this example: +```typ +#show ref: it => { + let el = it.element + if el != none and el.func() == figure and el.kind == "glossarium_entry" { + // Make the glossarium entry references dark blue + text(fill: blue.darken(60%)) + } else { + // Other references as usual. + it + } +} +``` +By adding `else if` clauses for different functions and kinds, each type of reference can be given a different style.