summaryrefslogtreecommitdiff
path: root/tests/typ/repr.typ
blob: 666db42855268647237692c0a62375d525c2259f (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
// Test representation of values in the document.

---
// Variables.

#let name = "Typst"
#let ke-bab = "Kebab!"
#let α = "Alpha"

{name} \
{ke-bab} \
{α} \

// Error: 2-3 unknown variable
{_}

---
// Literal values.
{none} (empty) \
{true} \
{false} \

---
// Numerical values.
{1} \
{1.0e-4} \
{3.15} \
{1e-10} \
{50.368%} \
{0.0000012345pt} \
{4.5cm} \
{12e1pt} \
{2.5rad} \
{45deg} \

// Not in monospace via repr.
#repr(45deg)

---
// Colors.
{#f7a20500} \

---
// Strings and escaping.
{"hi"} \
{"a\n[]\"\u{1F680}string"} \

---
// Templates.
{[*{"H" + "i"} there*]}