typst/template.typ

49 lines
1.2 KiB
Text
Raw Permalink Normal View History

2024-09-24 13:44:10 +00:00
// apply this using:
// #import "../../template.typ": apply-template
2024-09-24 13:44:10 +00:00
// #show: apply-template
#let apply-template(body) = [
#set text(lang: "de")
#set page(
margin: auto,
2024-10-04 10:07:50 +00:00
paper: "a4",
2024-09-24 13:44:10 +00:00
)
#set outline(indent: 1.2em)
#let clean_numbering(..schemes) = {
2024-10-04 10:07:50 +00:00
(..nums) => {
let (section, ..subsections) = nums.pos()
let (section_scheme, ..subschemes) = schemes.pos()
2024-09-24 13:44:10 +00:00
2024-10-04 10:07:50 +00:00
if subsections.len() == 0 {
numbering(section_scheme, section)
} else if subschemes.len() == 0 {
numbering(section_scheme, ..nums.pos())
} else {
clean_numbering(..subschemes)(..subsections)
}
2024-09-24 13:44:10 +00:00
}
}
#set heading(numbering: clean_numbering("A.", "I.", "1.a."))
2024-10-30 20:21:54 +00:00
// functions for my stuff
#let title(body) = {
set align(center)
[ - #body]
}
2024-09-30 12:08:43 +00:00
// #set math.equation(numbering: "(1)", supplement: "equation")
2024-09-24 13:44:10 +00:00
// Customization of text elements
2024-09-25 15:58:09 +00:00
#set par(justify: true)
#show link: underline
2024-10-01 10:22:59 +00:00
#show link: set text(rgb("#1470da"))
// here are replacements for commonly used shortcuts
2024-10-20 13:41:29 +00:00
#show "z.B.": "zum Beispiel"
#show "zb": "zum Beispiel"
2024-10-01 05:54:53 +00:00
#show "vllt": "vielleicht"
2024-10-04 11:13:56 +00:00
#show "CO2": $"CO"_2$
2024-09-24 13:44:10 +00:00
2024-10-20 13:41:29 +00:00
#body // IMPORTANT: must be at the very bottom, else the body will be overwritten
2024-09-24 13:44:10 +00:00
]