-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimports.typ
More file actions
136 lines (118 loc) · 2.63 KB
/
imports.typ
File metadata and controls
136 lines (118 loc) · 2.63 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#import "@preview/gentle-clues:1.0.0": *
#import "@preview/ctheorems:1.1.3": *
#import "@preview/physica:0.9.4": *
#import "@preview/fletcher:0.5.3" as fletcher: diagram, node, edge
#import fletcher.shapes: pill
#import "@preview/subpar:0.2.0"
#import "@preview/pinit:0.2.2": *
#let MATH_BREAK_THRESHOLD = 200pt
// #show thmbox.where()
#let theorem = thmbox(
"theorem",
"Theorem",
stroke: rgb("#000000")+0.5pt,
radius: 0pt,
breakable: false,
).with(base_level:1)
#let br_theorem = theorem.with(breakable: true)
// #let theorem(..args) = {
// let name = if (args.pos().len() == 2) {
// args.at(0)
// } else { none }
// let content = if (args.pos().len() == 2) {
// args.at(1)
// } else { args.at(0) }
// context {
// let t = theo(name)[#content]
// if (measure(t).height > MATH_BREAK_THRESHOLD){
// return t
// }
// else {
// return unbr_theo(name)[#content]
// }
// }
// }
#let corollary = thmplain(
"corollary",
"Corollary",
base: "theorem",
titlefmt: strong,
breakable: false,
).with(base_level:1)
#let br_corollary = corollary.with(breakable: true)
// #let corollary(name, it) = {
// context {
// let t = coroll(name)[#it]
// if (measure(t).height > MATH_BREAK_THRESHOLD){
// t
// }
// else {
// unbr_coroll(name)[#it]
// }
// }
// }
#let definition = thmbox(
"definition",
"Definition",
inset: (x: 1.2em, top: 1em),
breakable: false,
).with(base_level:1)
#let br_definition = definition.with(breakable: true)
#let example = thmplain(
"example",
"Example",
breakable: true,
).with(numbering: none)
#let unbr_example = example.with(breakable: false)
#let proof = thmproof(
"proof",
"Proof",
breakable: true,
).with()
#let unbr_proof = proof.with(breakable: false)
#let exercise = thmbox(
"exercise",
"Exercise",
inset: (x: 1.2em, top: 1em),
breakable: true,
).with(base_level:1)
#let unbr_exercise = exercise.with(breakable: false)
#let remark = thmplain(
"remark",
"Remark",
breakable:true
).with(numbering: none)
#let unbr_remark = remark.with(breakable: false)
// Such That
#let st = [_s.t._]
// If and only if
#let iff = [_iff_]
#let pin_right(pin, text) = {
let x = 2em
let y = -0.3em
pinit-point-from(
pin,
offset-dx:x,
offset-dy:y,
pin-dx:0.5em,
pin-dy:y,
body-dx:0.2em,
body-dy:y * 3/2
)[#text]
}
#let pin_left(pin, text) = {
let x = 2em
let y = -0.3em
context {
let w = measure(text).width
return pinit-point-from(
pin,
offset-dx:-x,
offset-dy:y,
pin-dx:-0.5em,
pin-dy:y,
body-dx: - w - 0.5em,
body-dy:y * 3/2
)[#text]
}
}