Files
2026-04-06 11:38:08 +02:00

312 lines
6.0 KiB
Typst

//#import "@preview/fletcher:0.5.8" as fletcher: diagram, node, edge
#import "@preview/marge:0.1.0": sidenote
#import "@preview/itemize:0.2.0" as el
#import "deckblatt.typ": deckblatt
#import "abhaengigkeit.typ": abhaengigkeit
#import "grafiken.typ": *
#let einruecken(abstand, inhalt) = pad(left: abstand, inhalt)
#let def-counter = counter("definition")
// Zähler bei jedem neuen Kapitel zurücksetzen
#show heading.where(level: 1): it => {
it
def-counter.update(0)
}
#let definition(title: none, body, label: none) = context {
def-counter.step()
let h1-num = counter(heading).at(here()).first()
let d-num = def-counter.at(here()).first()
let full-num = [#h1-num.#d-num]
// Die Figure wird erstellt und das Label direkt angehängt
[
#figure(
block(width: 100%, align(left)[
*Definition #full-num*: #if title != none [(#title)] #body
]),
kind: "definition",
supplement: [D.],
numbering: _ => full-num,
) #label
]
}
// Zähler bei jedem neuen Kapitel (Ebene 1) zurücksetzen
#show heading.where(level: 1): it => {
it
def-counter.update(1)
}
#let sn-base = sidenote
#show math.equation: it => {
if it.body.fields().at("size", default: none) != "display" {
return math.display(it)
}
it
}
#let snr(it) = sn-base(side: right, padding: 1em)[
#set text(size: 1.3em, weight: "bold")
#it
]
#let snl(it) = sn-base(side: left, padding: 1em)[
#set text(size: 1.3em, weight: "bold")
#it
]
#set text(
font: "Lato", //Serifenlose Schrift
size: 8.5pt,
lang: "de", //Deutsche Spracheinstellungen
)
#set page(
width:162mm,
height: 230mm,
margin: 20mm,
)
#set par(
justify: true, //Blocksatz
leading: 0.55em,
)
#let tt = "KÖRBER \u{2219} PFORR"
#let meinContent = [*Band 7* #sym.dot.c _Grundlagen_]
// Einfach die Funktion aufrufen
#deckblatt(bandnr: "5", autor: tt, titel: "Integralrechnung für Funktionen\nmit mehreren Variablen")
#pagebreak()
#set page(
width:162mm,
height: 230mm,
margin: 20mm,
)
#set par(
justify: true, //Blocksatz
leading: 0.55em,
)
#set page(
//background: grid(columns: (1mm,) * 162, rows: (1mm,) * 230, stroke: 0.1mm),
margin: (
top: 2mm,
bottom: 2mm,
x: 10mm,
),
width:162mm,
height: 230mm,
)
#v(9mm)
#heading(outlined: false)[Abhängigkeitsgraph]
#v(-6mm)
#scale(x:90%, y:90%)[#abhaengigkeit]
//#scale(factor: 90%, abhaengigkeit)
//#abhaengigkeit
#show heading: it => {
set block(below: if it.level == 1 { 2em } else { 1em })
it
}
#counter(page).update(1)
#pagebreak()
#set text(font: "Lato")
#set text(
font: "Lato", //Serifenlose Schrift
size: 9pt,
lang: "de", //Deutsche Spracheinstellungen
)
#set par(
justify: true,
leading: 0.55em,
)
#set page(
//background: grid(columns: (1mm,) * 162, rows: (1mm,) * 230, stroke: 0.1mm),
margin: (
top: 18mm,
bottom: 20mm,
x: 15mm,
),
width:162mm,
height: 230mm,
)
#set heading(numbering: "1.1.")
#set outline(indent: auto)
#set page(
header: context {
// 1. Kapitelstart-Check (wie zuvor)
let h1_on_page = query(heading.where(level: 1))
.any(it => it.location().page() == here().page())
if h1_on_page { return none }
let page_num = here().page()
// 2. Aktuelle Überschriften finden
let h1_current = query(heading.where(level: 1))
.filter(it => it.location().page() <= page_num).at(-1, default: none)
let h2_current = query(heading.where(level: 2))
.filter(it => it.location().page() <= page_num).at(-1, default: none)
// Hilfsfunktion: Nummer + Text zusammenfügen
let format-head(h) = {
if h != none {
// Falls die Überschrift eine Nummerierung hat, diese anzeigen
if h.numbering != none {
numbering(h.numbering, ..counter(heading).at(h.location()))
[ ] // Kleiner Abstand
}
h.body
}
}
// 3. Layout (Zahlen außen, Text innen oder wie gewünscht)
set text(size: 9pt, style: "italic") // Header dezent formatieren
if calc.even(page_num) {
// Gerade Seite: [Seite] [Kapitelnummer Text]
grid(
columns: (20pt, 1fr),
align(left)[#page_num],
align(right)[#format-head(h1_current)]
)
} else {
// Ungerade Seite: [Unterkapitelnummer Text] [Seite]
grid(
columns: (1fr, 20pt),
align(left)[#format-head(h2_current)],
align(right)[#page_num]
)
}
}
)
#set heading(numbering: "1.1.")
#show selector(<nonumber>): set heading(numbering: none)
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, b2_4)
},
caption: [],
) <abb3>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, EC_drawing)
},
caption: [],
) <abb4>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, EC_drawing2)
},
caption: [],
) <abb5>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, test-case)
},
caption: [],
) <abb5>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, test-case2)
},
caption: [],
) <abb5>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, test-case3)
},
caption: [],
) <abb5>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, test-case4)
},
caption: [],
) <abb5>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, test-case5)
},
caption: [],
) <abb5>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, test-case6)
},
caption: [],
) <abb5>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, test-case7)
},
caption: [],
) <abb5>
#figure(
{
set math.equation(numbering: none)
scale(x: 90%, y: 90%, reflow: true, test-case8)
},
caption: [],
) <abb5>