-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.typ
132 lines (111 loc) · 2.63 KB
/
template.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
124
125
126
127
128
129
130
131
132
#import "funcs.typ": clean_numbering
#let template(
title: none,
author: (),
academic_year: "",
body,
) = {
set document(title: title, author: author.name)
set text(font: "New Computer Modern", lang: "en", size: 10pt)
set page(paper: "a4", numbering: ("1"))
show figure.caption: set text(size: 0.8em, style: "italic")
show link: underline
set heading(numbering: clean_numbering("I -", "1.a."))
show heading: it => if it.level != 1 {
block(width: 100%, above: 2em, below: 1em, breakable: false)[
#set par(justify: false)
#set text(weight: "bold")
#if it.numbering != none {
grid(
columns: 2,
gutter: 0.5em,
counter(heading).display(it.numbering), smallcaps(it.body),
)
} else {
smallcaps(it)
}
]
} else {
pagebreak(weak: true)
block(width: 100%, above: 3em, below: 3em, breakable: false)[
#set par(justify: false)
#set align(center)
#set text(weight: "bold")
#if it.numbering != none {
grid(
columns: 2,
gutter: 0.5em,
counter(heading).display(it.numbering), smallcaps(it.body),
)
} else {
smallcaps(it)
}
]
}
set table(stroke: none)
show raw.where(block: true): set text(size: 0.8em)
show raw.where(block: true): set par(justify: false)
show raw.where(block: true): block.with(
fill: luma(250),
inset: 10pt,
width: 100%,
stroke: (top: 0.5pt, bottom: 0.5pt),
)
// Outline customization
show outline.entry.where(level: 1): it => {
if it.body != [References] {
v(12pt, weak: true)
link(
it.element.location(),
strong({
it.body
h(1fr)
it.page
}),
)
} else {
text(size: 1em, it)
}
}
// Title Page
// Legend
set align(center)
set page(header: [
#set align(right)
#rect(stroke: 0.5pt + gray)[
#grid(
align: left,
gutter: 0.5em,
columns: 2,
rect(fill: red.transparentize(30%), width: 30pt, height: 1em), [Fake],
rect(fill: blue.transparentize(30%), width: 30pt, height: 1em),
[Genuine],
)
]
])
line(length: 100%)
// Title
block()[
#smallcaps(
text(
size: 1.6em,
weight: "bold",
title,
),
)
]
line(length: 100%)
v(1fr)
// Author and Academic Year
block()[
*#author.name* \
#author.id \ \
_Academic Year #academic_year _
]
v(1fr)
set align(left)
set par(justify: true)
body
set page(header: none)
bibliography("works.bib", title: "External References", full: true)
}