Kapitel 2 draft
This commit is contained in:
0
Typst/MA_style.typ
Normal file
0
Typst/MA_style.typ
Normal file
0
Typst/MA_test.typ
Normal file
0
Typst/MA_test.typ
Normal file
44
Typst/simple_style.typ
Normal file
44
Typst/simple_style.typ
Normal file
@@ -0,0 +1,44 @@
|
||||
#let set_simple_layout(doc) = {
|
||||
set page(
|
||||
paper: "a4",
|
||||
margin: (top: 25mm, bottom: 25mm, inside: 25mm, outside: 20mm),
|
||||
numbering: "1"
|
||||
)
|
||||
set text(font: "Helvetica", size: 11pt)
|
||||
set par(justify: true, leading: 14pt, first-line-indent: 4mm)
|
||||
set list(indent: 5mm, spacing: 1.5mm)
|
||||
set heading(numbering: "1.1.1", depth: 3)
|
||||
|
||||
// Make headings visually distinct without extra boilerplate.
|
||||
show heading.where(level: 1): it => [
|
||||
#set text(size: 18pt, weight: "bold")
|
||||
|
||||
]
|
||||
show heading.where(level: 2): it => [
|
||||
#set text(size: 14pt, weight: "semibold")
|
||||
|
||||
]
|
||||
show heading.where(level: 3): it => [
|
||||
#set text(size: 12pt, weight: "bold")
|
||||
]
|
||||
doc
|
||||
}
|
||||
|
||||
#let simple_title_page(title, author, date: none) = [
|
||||
#set page(numbering: none)
|
||||
#align(center)[
|
||||
#v(6cm)
|
||||
#text(size: 26pt, weight: "bold")[#title]
|
||||
#v(6mm)
|
||||
#text(size: 14pt, weight: "medium")[Autor: #author]
|
||||
#if date != none [
|
||||
#v(3mm)
|
||||
#text(size: 12pt)[Datum: #date]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
#let simple_style = (
|
||||
layout: set_simple_layout,
|
||||
title_page: simple_title_page,
|
||||
)
|
||||
29
Typst/simple_style_demo.typ
Normal file
29
Typst/simple_style_demo.typ
Normal file
@@ -0,0 +1,29 @@
|
||||
#import "simple_style.typ": set_simple_layout, simple_style
|
||||
|
||||
#let author = "Max Mustermann"
|
||||
|
||||
#(simple_style.title_page)(
|
||||
"Einfaches Typst-Beispiel",
|
||||
author,
|
||||
date: datetime.today().display()
|
||||
)
|
||||
|
||||
#pagebreak()
|
||||
|
||||
#show: set_simple_layout
|
||||
|
||||
#set text(font: "Helvetica")
|
||||
|
||||
#heading(level: 1)[Einleitung]
|
||||
Dies ist ein kompaktes Beispiel für einen eigenen Typst-Stil. Die Layout-Einstellungen werden in *simple_style.typ* gebündelt, und der Autor #author wird automatisch eingefügt.
|
||||
|
||||
#heading(level: 2)[Motivation]
|
||||
Eigene Styles helfen dabei, mehrere Dokumente einheitlich zu formatieren, ohne jedes Mal alle Einstellungen wiederholen zu müssen.
|
||||
|
||||
#heading(level: 3)[Listen]
|
||||
- Einheitliche Schrift
|
||||
- Konsistente Abstände
|
||||
- Automatische Nummerierung
|
||||
|
||||
#heading(level: 1)[Weitere Inhalte]
|
||||
Nutze dieselben Funktionen für Kapitel wie für normale Texte. Die Nummerierung passt sich automatisch an, sobald mehr Abschnitte hinzukommen.
|
||||
Reference in New Issue
Block a user