blob: 60124255eabeb7c71363c2573689a30397212ed0 (
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
|
// Test compatibility with the pre-context way of things.
// Ref: false
---
#let s = state("x", 0)
#let compute(expr) = [
#s.update(x =>
eval(expr.replace("x", str(x)))
)
New value is #s.display().
]
#locate(loc => {
let elem = query(<here>, loc).first()
test(s.at(elem.location()), 13)
})
#compute("10") \
#compute("x + 3") \
*Here.* <here> \
#compute("x * 2") \
#compute("x - 5")
---
#style(styles => measure([it], styles).width < 20pt)
---
#counter(heading).update(10)
#counter(heading).display(n => test(n, 10))
|