fix: update statement numbering with headings
This commit is contained in:
6 files changed
+103
-72
No files matched your search
@@ -51,6 +51,8 @@ Optional arguments:
|
|||||||
- `tutor-label`: custom label beside the tutor name (`none`)
|
- `tutor-label`: custom label beside the tutor name (`none`)
|
||||||
- `sheet-label`: name displayed before the sheet number (`[Exercise Sheet]`)
|
- `sheet-label`: name displayed before the sheet number (`[Exercise Sheet]`)
|
||||||
- `logo`: logo content, usually `image("logo.png")` or similar (`none`)
|
- `logo`: logo content, usually `image("logo.png")` or similar (`none`)
|
||||||
|
- `track-heading-counter`: whether to track heading counters for custom box
|
||||||
|
components (see below) (`true`)
|
||||||
- `page-numbering`: custom page-numbering function
|
- `page-numbering`: custom page-numbering function
|
||||||
- `table-header-smallcaps`: use small capitals in table headers (`false`)
|
- `table-header-smallcaps`: use small capitals in table headers (`false`)
|
||||||
- `text-font` and `math-font`: font families with portable fallbacks
|
- `text-font` and `math-font`: font families with portable fallbacks
|
||||||
@@ -76,6 +78,8 @@ Optional arguments:
|
|||||||
period (`none`)
|
period (`none`)
|
||||||
- `info-text`: custom text to be displayed in the very beginning of the
|
- `info-text`: custom text to be displayed in the very beginning of the
|
||||||
document (`none`)
|
document (`none`)
|
||||||
|
- `track-heading-counter`: whether to track heading counters for custom box
|
||||||
|
components (see below) (`false`)
|
||||||
- `page-numbering`: custom page-numbering function
|
- `page-numbering`: custom page-numbering function
|
||||||
- `group-digits`: whether to group digits in numbers, e.g. `1 000` instead of
|
- `group-digits`: whether to group digits in numbers, e.g. `1 000` instead of
|
||||||
`1000` (`true`)
|
`1000` (`true`)
|
||||||
|
|||||||
+53
-31
@@ -1,4 +1,4 @@
|
|||||||
#import "@preview/clean-sheets:0.3.0": Cal, base-template, exercise, qed
|
#import "@preview/clean-sheets:0.3.0": *
|
||||||
|
|
||||||
#let logo = box(
|
#let logo = box(
|
||||||
width: 2.4cm,
|
width: 2.4cm,
|
||||||
@@ -17,12 +17,12 @@
|
|||||||
([Jane Doe], [Joe Shmoe]),
|
([Jane Doe], [Joe Shmoe]),
|
||||||
[John Q. Public, James X. Smith],
|
[John Q. Public, James X. Smith],
|
||||||
tutor-label: [Tutors:],
|
tutor-label: [Tutors:],
|
||||||
sheet-label: [Example Exercise Sheet],
|
sheet-label: [Example Sheet],
|
||||||
logo: logo,
|
logo: logo,
|
||||||
page-numbering: "— I of I —",
|
page-numbering: "— I of I —",
|
||||||
table-header-smallcaps: true,
|
table-header-smallcaps: true,
|
||||||
text-font: "IBM Plex Sans",
|
text-font: "Noto Sans",
|
||||||
math-font: "IBM Plex Math",
|
math-font: "Noto Sans Math",
|
||||||
no-pagebreak: true,
|
no-pagebreak: true,
|
||||||
show-credits: true,
|
show-credits: true,
|
||||||
credits: [_Typset with #link("https://typst.app")[Typst]._],
|
credits: [_Typset with #link("https://typst.app")[Typst]._],
|
||||||
@@ -48,20 +48,39 @@
|
|||||||
#lorem(40)
|
#lorem(40)
|
||||||
]
|
]
|
||||||
|
|
||||||
#lorem(20)#footnote[#lorem(21)]
|
== Part (i)
|
||||||
|
|
||||||
$
|
#lorem(40)#footnote[#lorem(21)]
|
||||||
bold("B")(P) =
|
|
||||||
mu_0 / (4 pi)
|
== Part (ii)
|
||||||
integral
|
|
||||||
(I times bold(hat("r"))) / r^2 dif bold(l)
|
#axiom[
|
||||||
= (mu_0 I) / (4 pi)
|
#lorem(30)
|
||||||
integral
|
$
|
||||||
(dif bold(l) times bold(hat("r"))) / r^2
|
bold("F") = #[$m$]bold("a")
|
||||||
$
|
$
|
||||||
|
#lorem(10)
|
||||||
|
]
|
||||||
|
|
||||||
|
#theorem(label: [#smallcaps[Biot--Savard] law])[
|
||||||
|
#lorem(20)
|
||||||
|
$
|
||||||
|
bold("B")(bold("r")) =
|
||||||
|
mu_0 / (4 pi)
|
||||||
|
integral
|
||||||
|
(I times bold(hat("r"))') / abs(bold("r")')^2 dif bold(l)
|
||||||
|
= (mu_0 I) / (4 pi)
|
||||||
|
integral
|
||||||
|
(dif bold(l) times bold(hat("r"))') / abs(bold("r")')^2
|
||||||
|
$
|
||||||
|
]
|
||||||
|
|
||||||
#lorem(30) #qed
|
#lorem(30) #qed
|
||||||
|
|
||||||
|
== Part (iii)
|
||||||
|
|
||||||
|
#corollary(nobreak: true)[#lorem(8)]
|
||||||
|
|
||||||
#table(
|
#table(
|
||||||
columns: (1fr,) * 5,
|
columns: (1fr,) * 5,
|
||||||
align: (start,) + (center,) * 3 + (end,),
|
align: (start,) + (center,) * 3 + (end,),
|
||||||
@@ -76,30 +95,33 @@ $
|
|||||||
= Exercise 2
|
= Exercise 2
|
||||||
|
|
||||||
#exercise(points: [$25$ Points])[
|
#exercise(points: [$25$ Points])[
|
||||||
#lorem(41)
|
#lorem(90)
|
||||||
|
|
||||||
#lorem(26)
|
#lorem(20)
|
||||||
]
|
]
|
||||||
|
|
||||||
#lorem(17) $-pi/2 < arctan(x) := integral_0^x (dif t) / (1 + t^2) < pi/2 space forall x in RR$. #lorem(24)
|
#lorem(17) $-pi/2 < arctan(x) := integral_0^x (dif t) / (1 + t^2) < pi/2 space forall x in RR$. #lorem(24)
|
||||||
|
|
||||||
$
|
#definition[
|
||||||
V(x_1, ..., x_n) := mat(
|
#lorem(15) $
|
||||||
1, x_1, x_1^2, dots.c, x_1^(n-1);
|
V(x_1, ..., x_n) := mat(
|
||||||
1, x_2, x_2^2, dots.c, x_2^(n-1);
|
1, x_1, x_1^2, dots.c, x_1^(n-1);
|
||||||
1, x_3, x_3^2, dots.c, x_3^(n-1);
|
1, x_2, x_2^2, dots.c, x_2^(n-1);
|
||||||
dots.v, dots.v, dots.v, dots.down, dots.v;
|
1, x_3, x_3^2, dots.c, x_3^(n-1);
|
||||||
1, x_n, x_n^2, dots.c, x_n^(n-1)
|
dots.v, dots.v, dots.v, dots.down, dots.v;
|
||||||
)
|
1, x_n, x_n^2, dots.c, x_n^(n-1)
|
||||||
$
|
)
|
||||||
|
$
|
||||||
|
]
|
||||||
|
|
||||||
#lorem(20)
|
#lemma(label: [#smallcaps[Vandermonde] determinant])[
|
||||||
|
#lorem(20)
|
||||||
|
$
|
||||||
|
det V(x_1, ..., x_n) = product_(1 <= i < j <= n)(x_j - x_i)
|
||||||
|
$
|
||||||
|
]
|
||||||
|
|
||||||
$
|
#lorem(50)#footnote[#lorem(31)]#footnote[#lorem(13)]
|
||||||
det V(x_1, ..., x_n) = product_(1 <= i < j <= n)(x_j - x_i)
|
|
||||||
$
|
|
||||||
|
|
||||||
#lorem(59)#footnote[#lorem(31)]#footnote[#lorem(13)]
|
|
||||||
|
|
||||||
#lorem(30) #qed
|
#lorem(30) #qed
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#import "@preview/clean-sheets:0.3.0": Cal, chevrons, computer-science-template, exercise, lemma, qed
|
#import "@preview/clean-sheets:0.3.0": Cal, chevrons, computer-science-template, definition, exercise, korollar, lemma, qed
|
||||||
|
|
||||||
#show: body => computer-science-template(
|
#show: body => computer-science-template(
|
||||||
1,
|
1,
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
attestations-from: datetime(day: 1, month: 1, year: 2027, hour: 18, 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),
|
attestations-until: datetime(day: 8, month: 1, year: 2027, hour: 10, minute: 0, second: 0),
|
||||||
info-text: lorem(40),
|
info-text: lorem(40),
|
||||||
|
track-heading-counter: true,
|
||||||
page-numbering: "Blatt I von I",
|
page-numbering: "Blatt I von I",
|
||||||
group-digits: true,
|
group-digits: true,
|
||||||
decimal-comma: true,
|
decimal-comma: true,
|
||||||
@@ -62,6 +63,10 @@ DEF magic_recursive(string s, string p):
|
|||||||
+ $forall i in NN_0: x y^i z in L$.
|
+ $forall i in NN_0: x y^i z in L$.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
#definition[
|
||||||
|
Sei $Sigma$ ein Alphabet. Eine Sprache $L subset.eq Sigma^*$ heißt _regulär_, wenn es einen endlichen Automaten gibt, der $L$ akzeptiert.
|
||||||
|
]
|
||||||
|
|
||||||
= Aufgabe 2
|
= Aufgabe 2
|
||||||
|
|
||||||
#exercise(
|
#exercise(
|
||||||
@@ -73,12 +78,15 @@ DEF magic_recursive(string s, string p):
|
|||||||
|
|
||||||
#lorem(50) #qed
|
#lorem(50) #qed
|
||||||
|
|
||||||
$
|
#korollar[
|
||||||
bold("B")(P) =
|
#lorem(10)
|
||||||
mu_0 / (4 pi)
|
$
|
||||||
integral
|
bold("B")(P) =
|
||||||
(I times bold(hat("r"))) / r^2 dif bold(l)
|
mu_0 / (4 pi)
|
||||||
= (mu_0 I) / (4 pi)
|
integral
|
||||||
integral
|
(I times bold(hat("r"))) / r^2 dif bold(l)
|
||||||
(dif bold(l) times bold(hat("r"))) / r^2
|
= (mu_0 I) / (4 pi)
|
||||||
$
|
integral
|
||||||
|
(dif bold(l) times bold(hat("r"))) / r^2
|
||||||
|
$
|
||||||
|
]
|
||||||
+11
-15
@@ -15,25 +15,21 @@
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
#let _stmt(kind, body, color, label: [], nobreak: false, radius: 5pt) = context {
|
#let _stmt(kind, body, color, label: none, nobreak: false, radius: 5pt) = context {
|
||||||
let h = counter(heading).get()
|
let h = counter(heading).get()
|
||||||
let x = if h.len() >= 1 { h.at(0) } else { 0 }
|
let x = if h.len() >= 1 { calc.max(1, h.at(0)) } else { 1 }
|
||||||
let y = if h.len() >= 2 { h.at(1) } else { 0 }
|
let y = if h.len() >= 2 { calc.max(1, h.at(1)) } else { 1 }
|
||||||
|
|
||||||
let statement = counter(
|
let statement = counter("statement-" + str(x) + "-" + str(y))
|
||||||
"statement-" + str(x) + "-" + str(y),
|
|
||||||
)
|
|
||||||
|
|
||||||
let lbl = if label != [] { [ (#label)] } else { [] }
|
let lbl = if label != none { [ (#label)] }
|
||||||
let brk = if nobreak { "" } else { [\ ] }
|
let brk = if nobreak { "" } else { [\ ] }
|
||||||
|
|
||||||
[
|
[
|
||||||
#statement.step()
|
#statement.step()
|
||||||
|
|
||||||
#context {
|
#context {
|
||||||
let mark = statement.display(
|
let mark = statement.display(z => numbering("1.1.1", x, y, z))
|
||||||
z => numbering("1.1.1", x, y, z),
|
|
||||||
)
|
|
||||||
|
|
||||||
_box(
|
_box(
|
||||||
[*#kind #mark*#lbl*.* #brk],
|
[*#kind #mark*#lbl*.* #brk],
|
||||||
@@ -64,11 +60,11 @@
|
|||||||
|
|
||||||
#let _stmt-name(kind, lang: "en") = { statement-names.at(lang).at(kind) }
|
#let _stmt-name(kind, lang: "en") = { statement-names.at(lang).at(kind) }
|
||||||
|
|
||||||
#let definition(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name(kind, lang: lang), body, statement-colors.at(kind), label: label, nobreak: nobreak)
|
#let definition(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name("definition", lang: lang), body, statement-colors.at("definition"), label: label, nobreak: nobreak)
|
||||||
#let axiom(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name(kind, lang: lang), body, statement-colors.at(kind), label: label, nobreak: nobreak)
|
#let axiom(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name("axiom", lang: lang), body, statement-colors.at("axiom"), label: label, nobreak: nobreak)
|
||||||
#let theorem(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name(kind, lang: lang), body, statement-colors.at(kind), label: label, nobreak: nobreak)
|
#let theorem(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name("theorem", lang: lang), body, statement-colors.at("theorem"), label: label, nobreak: nobreak)
|
||||||
#let lemma(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name(kind, lang: lang), body, statement-colors.at(kind), label: label, nobreak: nobreak)
|
#let lemma(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name("lemma", lang: lang), body, statement-colors.at("lemma"), label: label, nobreak: nobreak)
|
||||||
#let corollary(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name(kind, lang: lang), body, statement-colors.at(kind), label: label, nobreak: nobreak)
|
#let corollary(body, label: none, nobreak: false, lang: "en") = _stmt(_stmt-name("corollary", lang: lang), body, statement-colors.at("corollary"), label: label, nobreak: nobreak)
|
||||||
// Aliases
|
// Aliases
|
||||||
#let satz(..args) = theorem(..args, lang: "de")
|
#let satz(..args) = theorem(..args, lang: "de")
|
||||||
#let korollar(..args) = corollary(..args, lang: "de")
|
#let korollar(..args) = corollary(..args, lang: "de")
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
tutor-label: none,
|
tutor-label: none,
|
||||||
sheet-label: [Exercise Sheet],
|
sheet-label: [Exercise Sheet],
|
||||||
logo: none,
|
logo: none,
|
||||||
|
track-heading-counter: true,
|
||||||
page-numbering: common-theme.page-numbering,
|
page-numbering: common-theme.page-numbering,
|
||||||
table-header-smallcaps: false,
|
table-header-smallcaps: false,
|
||||||
text-font: base-theme.text-font,
|
text-font: base-theme.text-font,
|
||||||
@@ -66,18 +67,17 @@
|
|||||||
show heading: set text(fill: colors.text)
|
show heading: set text(fill: colors.text)
|
||||||
let first-h1 = state("first-h1", true)
|
let first-h1 = state("first-h1", true)
|
||||||
show heading.where(level: 1): it => {
|
show heading.where(level: 1): it => {
|
||||||
if first-h1.get() {
|
if track-heading-counter and it.numbering == none { counter(heading).step(level: 1) }
|
||||||
first-h1.update(false)
|
if first-h1.get() { first-h1.update(false) } else { if (not no-pagebreak) { pagebreak(weak: true) } }
|
||||||
} else {
|
|
||||||
if (not no-pagebreak) {
|
|
||||||
pagebreak(weak: true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
v(0.3em)
|
|
||||||
it
|
it
|
||||||
v(-0.9em)
|
v(-0.9em)
|
||||||
line(length: 100%, stroke: 0.4pt + colors.stroke)
|
line(length: 100%, stroke: 0.4pt + colors.stroke)
|
||||||
v(0.3em)
|
v(0.25cm)
|
||||||
|
}
|
||||||
|
|
||||||
|
show heading.where(level: 2): it => {
|
||||||
|
if track-heading-counter and it.numbering == none { counter(heading).step(level: 2) }
|
||||||
|
it
|
||||||
}
|
}
|
||||||
|
|
||||||
set footnote(numbering: common-theme.footnote.numbering.note)
|
set footnote(numbering: common-theme.footnote.numbering.note)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
attestations-from: none,
|
attestations-from: none,
|
||||||
attestations-until: none,
|
attestations-until: none,
|
||||||
info-text: none,
|
info-text: none,
|
||||||
|
track-heading-counter: true,
|
||||||
page-numbering: common-theme.page-numbering,
|
page-numbering: common-theme.page-numbering,
|
||||||
group-digits: false,
|
group-digits: false,
|
||||||
decimal-comma: true,
|
decimal-comma: true,
|
||||||
@@ -50,13 +51,13 @@
|
|||||||
|
|
||||||
let first-h1 = state("first-h1", true)
|
let first-h1 = state("first-h1", true)
|
||||||
show heading.where(level: 1): it => {
|
show heading.where(level: 1): it => {
|
||||||
if first-h1.get() {
|
if track-heading-counter and it.numbering == none { counter(heading).step(level: 1) }
|
||||||
first-h1.update(false)
|
if first-h1.get() { first-h1.update(false) } else { if (not no-pagebreak) { pagebreak(weak: true) } }
|
||||||
} else {
|
it
|
||||||
if (not no-pagebreak) {
|
}
|
||||||
pagebreak(weak: true)
|
|
||||||
}
|
show heading.where(level: 2): it => {
|
||||||
}
|
if track-heading-counter and it.numbering == none { counter(heading).step(level: 2) }
|
||||||
it
|
it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user