1
0
mirror of https://gitlab.cvh-server.de/skrause/flashcards.git synced 2025-12-12 06:41:38 +01:00
Files
flashcards/docs/template.typ

65 lines
1013 B
Typst

#import "@preview/hydra:0.6.0": hydra
#let project(title: "", subtitle: "", authors: (), logo: none, body) = {
// Set the document's basic properties.
set document(author: authors, title: title)
set text(lang: "de")
set heading(numbering: "1.1")
set align(center)
// Title page.
v(1fr)
// Logo
if logo != none {
image(logo, width: 50%)
}
v(3em)
// Title
text(2em, weight: 700, title)
linebreak()
v(0.1em)
// Subtitle
text(2em, weight: 400, subtitle)
v(1em)
// Author
grid(
..authors,
)
v(1fr)
pagebreak()
set align(left)
set page(numbering: "I", number-align: center)
// Table of contents
outline(depth: 3)
pagebreak()
let show-header(ctx, candidates) = {
candidates.body
v(-0.8em)
line(length: 100%, stroke: 0.5pt)
}
set page(header: context {
hydra(1, skip-starting: false, display: show-header)
})
set page(numbering: "1")
counter(page).update(1)
// Main body
set par(justify: true)
body
}