mirror of
https://github.com/typst/typst
synced 2025-05-15 17:45:27 +08:00
For PDF, they will be immediately turned into plain text. However, it's still useful because templates can now accept content titles (with math or such things) instead of forcing strings because of set document. Moreover, it will be useful with "get rules" in the future.
50 lines
882 B
Typst
50 lines
882 B
Typst
// Test document and page-level styles.
|
|
|
|
---
|
|
// This is okay.
|
|
#set document(title: [Hello])
|
|
What's up?
|
|
|
|
---
|
|
// This, too.
|
|
// Ref: false
|
|
#set document(author: ("A", "B"), date: datetime.today())
|
|
|
|
---
|
|
// Error: 21-28 expected datetime, none, or auto, found string
|
|
#set document(date: "today")
|
|
|
|
---
|
|
// This, too.
|
|
// Error: 23-29 expected string, found integer
|
|
#set document(author: (123,))
|
|
What's up?
|
|
|
|
---
|
|
Hello
|
|
|
|
// Error: 2-30 document set rules must appear before any content
|
|
#set document(title: [Hello])
|
|
|
|
---
|
|
// Error: 10-12 can only be used in set rules
|
|
#document()
|
|
|
|
---
|
|
#box[
|
|
// Error: 4-32 document set rules are not allowed inside of containers
|
|
#set document(title: [Hello])
|
|
]
|
|
|
|
---
|
|
#box[
|
|
// Error: 4-18 page configuration is not allowed inside of containers
|
|
#set page("a4")
|
|
]
|
|
|
|
---
|
|
#box[
|
|
// Error: 4-15 pagebreaks are not allowed inside of containers
|
|
#pagebreak()
|
|
]
|