feat: revamp template API and box components

This commit is contained in:
Popa committed 2026-09-11 14:00:59 +02:00
1 parent 51fc2ef3c3
commit 337ff33853
8 files changed
+211 -130

No files matched your search

+46 -26
View File
@@ -1,21 +1,37 @@
#import "@preview/clean-sheets:0.3.0": Cal, base-template, ex_box, qed
#import "@preview/clean-sheets:0.3.0": Cal, base-template, exercise, qed
#let logo = box(
width: 2.4cm,
height: 1cm,
stroke: 0.8pt + eastern,
radius: 3pt,
align(center + horizon, text(fill: eastern, weight: "bold")[UNI LOGO]),
)
#show: body => base-template(
1,
none, // sheetnumber can be omitted for an unnumbered exercise sheet
[Linear Algebra I],
[Prof. Dr. Daniel Docent],
[Dr. Anne Assistant],
4,
([Jane Doe], [Joe Shmoe]),
[John Q. Public],
show-logo: false,
show-end-message: true,
[John Q. Public, James X. Smith],
tutor-label: [Tutors:],
sheet-label: [Example Exercise Sheet],
logo: logo,
page-numbering: "— I of I —",
table-header-smallcaps: true,
text-font: "IBM Plex Sans",
math-font: "IBM Plex Math",
no-pagebreak: true,
show-credits: true,
credits: [_Typset with #link("https://typst.app")[Typst]._],
body,
)
= Exercise 1
#ex_box(
#exercise(
heading: [#lorem(5)],
points: [$5 + 10 + 5$ Points],
)[
@@ -32,16 +48,34 @@
#lorem(40)
]
#lorem(59)#footnote[#lorem(21)]
#lorem(20)#footnote[#lorem(21)]
$
(a + b)^n = sum_(k = 0)^n binom(n, k) space.thin a^(n - k) b^k
bold("B")(P) =
mu_0 / (4 pi)
integral
(I times bold(hat("r"))) / r^2 dif bold(l)
= (mu_0 I) / (4 pi)
integral
(dif bold(l) times bold(hat("r"))) / r^2
$
#lorem(30) #qed
#table(
columns: (1fr,) * 5,
align: (start,) + (center,) * 3 + (end,),
table.header([Header 1], [Header 2], [Header 3], [Header 4], [Header 5]),
[Cell 1], [Cell 2], [Cell 3], [Cell 4], [Cell 5],
[Cell 6], [Cell 7], [Cell 8], [Cell 9], [Cell 10],
[Cell 11], [Cell 12], [Cell 13], [Cell 14], [Cell 15],
)
= Exercise 2
#ex_box(points: [$25$ Points])[
#exercise(points: [$25$ Points])[
#lorem(41)
#lorem(26)
@@ -65,17 +99,13 @@ $
det V(x_1, ..., x_n) = product_(1 <= i < j <= n)(x_j - x_i)
$
#lorem(60)#footnote[#lorem(31)]#footnote[#lorem(13)] #qed
#lorem(59)#footnote[#lorem(31)]#footnote[#lorem(13)]
#lorem(30) #qed
= Exercise 3
#ex_box(heading: [#lorem(8)])[
#lorem(20)
#lorem(30)
]
#exercise[#lorem(20)]
```js
#!/usr/bin/env node
@@ -90,14 +120,4 @@ if (π >= 0 && π !== Infinity || !NaN) for (const [k,v] of Object.entries(obj))
try { await Promise.resolve(fn?.({foo:n=>n**2})); } catch (e) { console.error(`${e}`); }
```
$
bold("B")(P) =
mu_0 / (4 pi)
integral
(I times bold(hat("r"))) / r^2 dif bold(l)
= (mu_0 I) / (4 pi)
integral
(dif bold(l) times bold(hat("r"))) / r^2
$
#lorem(30) #qed
#lorem(20) #qed
+49 -12
View File
@@ -1,31 +1,39 @@
#import "@preview/clean-sheets:0.3.0": Cal, chevrons, computer-science-template, def, ex_box, qed, satz
#import "@preview/clean-sheets:0.3.0": Cal, chevrons, computer-science-template, exercise, lemma, qed
#show: body => computer-science-template(
1,
subtitle: [Vorlesung 1: Einführung in die Grundlagen],
[Exemplarische Grundlagen I],
(
([Max Mustermann], [1234567]),
([Erika Musterfrau], [7654321]),
),
[Wintersemester 2025/26],
[Wintersemester 2026/27],
[Beispiel-Universität Musterstadt],
[Institut für Exemplarisches],
sheetnumber: 1,
subtitle: lorem(5),
department: [Abteilung Beispiel],
submit_until: datetime(day: 1, month: 1, year: 2026, hour: 14, minute: 0, second: 0),
testats_from: datetime(day: 1, month: 1, year: 2026, hour: 18, minute: 0, second: 0),
testats_until: datetime(day: 8, month: 1, year: 2026, hour: 10, minute: 0, second: 0),
submit-until: datetime(day: 1, month: 1, year: 2027, hour: 14, minute: 0, second: 0),
attestations-from: datetime(day: 1, month: 1, year: 2027, hour: 18, minute: 0, second: 0),
attestations-until: datetime(day: 8, month: 1, year: 2027, hour: 10, minute: 0, second: 0),
info-text: lorem(40),
page-numbering: "Blatt I von I",
group-digits: true,
decimal-comma: true,
text-font: "Libertinus Serif",
math-font: "Libertinus Math",
table-header-smallcaps: true,
no-pagebreak: false,
body,
)
= Aufgabe 1
#ex_box(
heading: [Aufgabe 1],
points: [10 Punkte],
#exercise(
heading: [Listen],
points: [$10000.5$ Punkte],
color: fuchsia,
stroke-color: fuchsia.lighten(50%),
text-color: fuchsia.darken(25%),
)[
Zeigen Sie eine einfache Aussage über Listen.
]
@@ -40,8 +48,37 @@ DEF magic_recursive(string s, string p):
#table(
columns: 6,
[Heading 1], [Heading 2], [Heading 3], [Heading 4], [Heading 5], [Heading 6],
table.header([Heading 1], [Heading 2], [Heading 3], [Heading 4], [Heading 5], [Heading 6]),
[Cell 1], [Cell 2], [Cell 3], [Cell 4], [Cell 5], [Cell 6],
[Cell 7], [Cell 8], [Cell 9], [Cell 10], [Cell 11], [Cell 12],
)
#lemma(label: [Pumping-Lemma], lang: "de")[
Sei $L subset.eq Sigma^*$ eine unendliche reguläre Sprache. Dann existiert eine Zahl $k in NN$ (die Pumping-Konstante), sodass jedes Wort $w in L$ mit $|w| >= k$ in drei Teile $w = x y z$ zerlegt werden kann, wobei
#set enum(numbering: "(i)")
+ $|x y| <= k$,
+ $|y| >= 1$ und
+ $forall i in NN_0: x y^i z in L$.
]
= Aufgabe 2
#exercise(
color: fuchsia,
stroke-color: fuchsia.lighten(50%),
)[
Unter _Rekursion_ versteht man in der Informatik die Eigenschaft einer Funktion, sich selbst aufzurufen. Geben Sie ein Beispiel für eine rekursive Funktion an und erläutern Sie ihre Funktionsweise.
]
#lorem(50) #qed
$
bold("B")(P) =
mu_0 / (4 pi)
integral
(I times bold(hat("r"))) / r^2 dif bold(l)
= (mu_0 I) / (4 pi)
integral
(dif bold(l) times bold(hat("r"))) / r^2
$