-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
docsImprovements or additions to documentationImprovements or additions to documentation
Description
Description
There is a small typo in "Adapt headers and footers on pages with specific elements" of https://typst.app/docs/guides/page-setup-guide/
In particular, there is an unused page-counter variable and a trailing ), both giving compile time errors.
#set page(header: context {
let page-counter =
let matches = query(<big-table>)
let current = counter(page).get()
let has-table = matches.any(m =>
counter(page).at(m.location()) == current
)
if not has-table [
_Lisa Strassner's Thesis_
#h(1fr)
National Academy of Sciences
]
}))
#lorem(100)
#pagebreak()
#table(
columns: 2 * (1fr,),
[A], [B],
[C], [D],
) <big-table>Errors from typst compile foo.typ:
u@x1 ~/D/t/foo> typst compile foo.typ
error: expected expression
┌─ foo.typ:2:20
│
2 │ let page-counter =
│ ^
error: expected semicolon or line break
┌─ foo.typ:14:2
│
14 │ }))
│ ^
u@x1 ~/D/t/foo [1]> typst compile foo.typ
error: expected semicolon or line break
┌─ foo.typ:13:2
│
13 │ }))
│ ^
Patch:
#set page(header: context {
- let page-counter =
let matches = query(<big-table>)
let current = counter(page).get()
let has-table = matches.any(m =>
counter(page).at(m.location()) == current
)
if not has-table [
_Lisa Strassner's Thesis_
#h(1fr)
National Academy of Sciences
]
- }))
+ })
#lorem(100)
#pagebreak()
#table(
columns: 2 * (1fr,),
[A], [B],
[C], [D],
) <big-table>Reproduction URL
No response
Browsers
No response
OS
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsImprovements or additions to documentationImprovements or additions to documentation