-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.typ
55 lines (51 loc) · 1.06 KB
/
lib.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
#import "@preview/wrap-it:0.1.0": wrap-content
#let task = (given: "", find: "", stroke: "partially", fig: none, fig-align: top + right, given-width: auto, body) => {
grid(
columns: (given-width, auto),
column-gutter: 1.2em,
table(
inset: 0.6em,
stroke: (x, y) => {
if (stroke == "full") {
return black
}
else if (stroke == "partially") {
return (
right: black,
bottom: black
)
}
else if (stroke == "find") {
if (y == 0) {
return (
bottom: black
)
}
}
},
given,
if find != "" {
find
}
),
pad(top: 0.6em,
if (fig == none) {
body
}
else {
if (fig-align == top + center) {
align(center, fig)
body
}
else {
wrap-content(
fig,
body,
align: top + right,
column-gutter: 1em
)
}
}
)
)
}