summaryrefslogtreecommitdiff
path: root/docs/reference/styling.md
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-02-27 11:05:16 +0100
committerGitHub <noreply@github.com>2024-02-27 10:05:16 +0000
commit145723b1ef4fa23f1f6665b8907dfe79d0bf83cf (patch)
tree02a7de661ddd5dafa75dfce3e3c8b45a7333b9dc /docs/reference/styling.md
parente9ee00a7c0df083663ff5ccca162238b88525e14 (diff)
New context system (#3497)
Diffstat (limited to 'docs/reference/styling.md')
-rw-r--r--docs/reference/styling.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/reference/styling.md b/docs/reference/styling.md
index 687fed79..1c3fd173 100644
--- a/docs/reference/styling.md
+++ b/docs/reference/styling.md
@@ -81,9 +81,9 @@ in Typst. For maximum flexibility, you can instead write a show rule that
defines how to format an element from scratch. To write such a show rule,
replace the set rule after the colon with an arbitrary [function]($function).
This function receives the element in question and can return arbitrary content.
-Different [fields]($scripting/#fields) are available on the element passed to
-the function. Below, we define a show rule that formats headings for a fantasy
-encyclopedia.
+The available [fields]($scripting/#fields) on the element passed to the function
+again match the parameters of the respective element function. Below, we define
+a show rule that formats headings for a fantasy encyclopedia.
```example
#set heading(numbering: "(I)")
@@ -91,7 +91,9 @@ encyclopedia.
#set align(center)
#set text(font: "Inria Serif")
\~ #emph(it.body)
- #counter(heading).display() \~
+ #counter(heading).display(
+ it.numbering
+ ) \~
]
= Dragon