blob: b317e60c8afc95b0469e91f6227dd44360a5dc5c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// General tests for set.
---
// Test that text is affected by instantiation-site bold.
#let x = [World]
Hello *#x*
---
// Test that lists are affected by correct indents.
#let fruit = [
- Apple
- Orange
#list(body-indent: 20pt)[Pear]
]
- Fruit
#[#set list(indent: 10pt)
#fruit]
- No more fruit
---
// Test that that block spacing and text style are respected from
// the outside, but the more specific fill is respected.
#set block(spacing: 4pt)
#set text(style: "italic", fill: eastern)
#let x = [And the forest #parbreak() lay silent!]
#text(fill: forest, x)
---
// Test that scoping works as expected.
#{
if true {
set text(blue)
[Blue ]
}
[Not blue]
}
---
// Test relative path resolving in layout phase.
#let choice = ("monkey.svg", "rhino.png", "tiger.jpg")
#set enum(numbering: n => {
let path = "/files/" + choice.at(n - 1)
move(dy: -0.15em, image(path, width: 1em, height: 1em))
})
+ Monkey
+ Rhino
+ Tiger
---
// Test conditional set.
#show ref: it => {
set text(red) if it.target == <unknown>
"@" + str(it.target)
}
@hello from the @unknown
---
// Error: 19-24 expected boolean, found integer
#set text(red) if 1 + 2
---
// Error: 12-26 set is only allowed directly in code and content blocks
#{ let x = set text(blue) }
|