-
Notifications
You must be signed in to change notification settings - Fork 0
/
mfraiman-lists.typ
123 lines (117 loc) · 1.88 KB
/
mfraiman-lists.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
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
// LISTS
// numbering with letters
#let enum_l(..items) = {
enum(
numbering: {
(..nums) => {
set text(
weight: "extrabold"
)
numbering("a.", nums.pos().first())
}
}
,
..items)
}
#let enum_cond(..items) = {
enum(
numbering: {
(..nums) => {
set text(
weight: "extrabold"
)
numbering("1.", nums.pos().first())
}
}
,
..items)
}
// numbering with no indentation
#let enum_big(
spacing: 1em,
..items) = {
enum(
numbering: {
(..nums) => {
if nums.pos().len() == 1 {
set text(weight: "extrabold")
"("
nums.pos().map(str).first()
")"
} else {
"("
set text(weight: "bold")
nums.pos().map(str).first()
"."
set text(weight: "medium")
nums.pos().slice(1).map(str).join(".")
")"
}
}
},
full: true,
indent: 0em,
number-align: start + top,
spacing: spacing,
tight: false,
..items
)
}
// inline numbering
#let rr(
counter,
value: none,
pts: none
) = [#{
text(weight: "bold", style: "normal")[#{
"("
if value == none {
counter.step()
counter.display()
} else {
str(value)
}
if pts != none {
text(weight: "regular")[#{", " + pts + " points"}]
}
[)]
}]
}]
#let list_bull(
spacing: 1em,
..items
) = {
list(
marker: sym.diamond.filled,
spacing: spacing,
tight: false,
..items
)
}
#let ur(
t,
marker: sym.diamond.filled
) = text(style: "italic")[
#smallcaps[#{
marker + [~] + t
}]
]
#let enum_col(
columns: (1fr),
indent: 0em,
counter_inline,
..items
) = {
let i = ()
for item in items.pos() {
i.push({
h(indent)
rr(counter_inline) + item
})
}
grid(
columns: columns,
row-gutter: 1em,
..i
)
}