1
0
mirror of https://gitlab.cvh-server.de/skrause/flashcards.git synced 2025-12-12 10:01:37 +01:00
Files
flashcards/docs/template.typ
2025-03-29 14:38:21 +01:00

61 lines
1.0 KiB
Typst

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