diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/meta/query.png | bin | 0 -> 121102 bytes | |||
| -rw-r--r-- | tests/typ/meta/query.typ | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/ref/meta/query.png b/tests/ref/meta/query.png Binary files differnew file mode 100644 index 00000000..80981202 --- /dev/null +++ b/tests/ref/meta/query.png diff --git a/tests/typ/meta/query.typ b/tests/typ/meta/query.typ new file mode 100644 index 00000000..85608e8e --- /dev/null +++ b/tests/typ/meta/query.typ @@ -0,0 +1,30 @@ +// Test the query function. + +--- +#set page( + paper: "a7", + margin: (y: 1cm, x: 0.5cm), + header: { + smallcaps[Typst Academy] + h(1fr) + query(heading, (before, after) => { + let elem = if before.len() != 0 { + before.last() + } else if after.len() != 0 { + after.first() + } + emph(elem.body) + }) + } +) + +#outline() + += Introduction +#lorem(35) + += Background +#lorem(35) + += Approach +#lorem(60) |
