-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.typ
More file actions
55 lines (48 loc) · 1.05 KB
/
template.typ
File metadata and controls
55 lines (48 loc) · 1.05 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
#import "@preview/toffee-tufte:0.1.1": *
#let doc_template(
title: "",
authors: "",
date: none,
abstract: [],
bibfile: none,
body,
) = {
// 1. Setup heading spacing logic
let heading_counter = counter("custom_heading_spacing")
show heading.where(level: 1): it => {
heading_counter.step()
// Add space before H1, except for the very first one
context {
if heading_counter.get().first() > 1 { v(1em) }
}
it
}
show heading.where(level: 2): it => {
v(0.8em)
it
}
// 2. Configure Global Document Styles
set page(paper: "a4")
set text(lang: "cs", font: "Libertinus Serif", size: 10pt)
set heading(numbering: none)
// 3. Apply the base Toffee-Tufte template
show: template.with(
title: title,
authors: authors,
date: date,
abstract: abstract,
)
// 4. Render Body
body
// 5. Automatic Bibliography Handling
if bibfile != none {
pagebreak()
wideblock(
bibliography(
bibfile,
full: true,
style: "iso-690-author-date",
)
)
}
}