-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.typ
78 lines (68 loc) · 1.58 KB
/
common.typ
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
67
68
69
70
71
72
73
74
75
76
77
78
#import "requirements.typ": *
#let template(dark: false, doc) = {
// Dark mode
set text(fill: white) if dark
set page(fill: luma(12%)) if dark
// Fix emptyset symbol
show sym.emptyset: set text(font: "Libertinus Sans")
// Setup theorems
show: ctheorems.thmrules.with(qed-symbol: $square$)
doc
}
// Horizontal rule
#let hrule = line(length: 100%)
// Blob for fletcher diagrams
#let blob(
pos,
label,
tint: white,
shape: fletcher.shapes.rect,
..args,
) = fletcher.node(
pos,
align(center, label),
fill: if (tint != none) { tint.lighten(80%) },
stroke: if (tint != none) { tint.darken(20%) },
shape: shape,
..args,
)
// Colored box around a content
#let fancy-box(
tint: green,
diagram-style: (:),
blob-style: (:),
content,
) = {
fletcher.diagram(
node-corner-radius: 2pt,
node-stroke: .8pt,
..diagram-style,
blob(
(0, 0),
content,
tint: tint,
..blob-style,
),
)
}
// Fitch-style proofs
#let fitch(..args) = derive-it.ded-nat(arr: args.pos(), ..args.named())
#let fitch-boxed(..args) = derive-it.ded-nat-boxed(arr: args.pos(), ..args.named())
// Link with icon
#let href(..args) = link(..args, super(fontawesome.fa-external-link()))
// Aliases
#let neg = sym.not
#let imply = sym.arrow.r
#let implied = sym.arrow.l
#let iff = sym.arrow.l.r
#let to = sym.arrow.long.r
#let maps = sym.arrow.bar
#let neq = sym.eq.not
#let leq = sym.lt.eq
#let geq = sym.gt.eq
#let models = sym.tack.double
#let entails = sym.tack.r
#let notin = sym.in.not
#let setminus = sym.backslash
#let intersect = sym.inter
#let dom = math.op("dom")