Compare commits

..
5 Commits
Author SHA1 Message Date
Popa aa08958393 fix: correct suffix formatting in statement header 2026-11-11 14:04:41 +01:00
Popa 05b50ba236 feat: add chevrons helper 2026-11-03 16:08:19 +01:00
Popa af8c7de08c fix: adjust header styling in statement 2026-11-03 15:15:22 +01:00
Popa 6f43c309eb fix: hide absent lecture numbers 2026-11-02 18:25:06 +01:00
Popa ac550f5b8a feat: add statement notes 2026-11-02 18:24:50 +01:00
4 changed files with 43 additions and 13 deletions

No files matched your search

+36 -9
View File
@@ -38,7 +38,16 @@
]
}
#let _statement(kind, body, color, label: none, inline: false, breakable: true) = context {
#let _statement(
kind,
body,
color,
label: none,
note: none,
inline: false,
breakable: true,
) = context {
let headings = counter(heading).get()
let first = if headings.len() >= 1 { calc.max(1, headings.at(0)) } else { 1 }
let second = if headings.len() >= 2 { calc.max(1, headings.at(1)) } else { 1 }
@@ -49,21 +58,34 @@
context {
let mark = statement.display(number => numbering("1.1.1", first, second, number))
let heading = text(
font: theme-state.get().text.sans-font,
weight: 600,
size: 0.9em,
fill: color.darken(20%),
)[#kind #mark#suffix.]
)[*#kind #mark*#suffix*.*]
let header = if note == none {
heading
} else {
grid(
columns: (1fr, auto),
column-gutter: 12pt,
align: (left, right),
heading, text(size: 0.9em)[#note],
)
}
if inline {
_box([#heading #body], color.darken(20%), breakable: false)
} else {
_box(body, color.darken(20%), header: heading, breakable: breakable)
_box(body, color.darken(20%), header: header, breakable: breakable)
}
}
}
#let statement-names = (
en: (
definition: [Definition],
@@ -83,61 +105,66 @@
#let _statement-name(kind, lang) = statement-names.at(lang, default: statement-names.en).at(kind)
#let definition(body, label: none, inline: false, breakable: true, lang: none) = context {
#let definition(body, label: none, note: none, inline: false, breakable: true, lang: none) = context {
let lang = if lang == none { theme-state.get().text.lang } else { lang }
_statement(
_statement-name("definition", lang),
body,
theme-state.get().statement-colors.definition,
label: label,
note: note,
inline: inline,
breakable: breakable,
)
}
#let axiom(body, label: none, inline: false, breakable: true, lang: none) = context {
#let axiom(body, label: none, note: none, inline: false, breakable: true, lang: none) = context {
let lang = if lang == none { theme-state.get().text.lang } else { lang }
_statement(
_statement-name("axiom", lang),
body,
theme-state.get().statement-colors.axiom,
label: label,
note: note,
inline: inline,
breakable: breakable,
)
}
#let theorem(body, label: none, inline: false, breakable: true, lang: none) = context {
#let theorem(body, label: none, note: none, inline: false, breakable: true, lang: none) = context {
let lang = if lang == none { theme-state.get().text.lang } else { lang }
_statement(
_statement-name("theorem", lang),
body,
theme-state.get().statement-colors.theorem,
label: label,
note: note,
inline: inline,
breakable: breakable,
)
}
#let lemma(body, label: none, inline: false, breakable: true, lang: none) = context {
#let lemma(body, label: none, note: none, inline: false, breakable: true, lang: none) = context {
let lang = if lang == none { theme-state.get().text.lang } else { lang }
_statement(
_statement-name("lemma", lang),
body,
theme-state.get().statement-colors.lemma,
label: label,
note: note,
inline: inline,
breakable: breakable,
)
}
#let corollary(body, label: none, inline: false, breakable: true, lang: none) = context {
#let corollary(body, label: none, note: none, inline: false, breakable: true, lang: none) = context {
let lang = if lang == none { theme-state.get().text.lang } else { lang }
_statement(
_statement-name("corollary", lang),
body,
theme-state.get().statement-colors.corollary,
label: label,
note: note,
inline: inline,
breakable: breakable,
)
+5 -2
View File
@@ -11,13 +11,16 @@
]
}
#let _qed = $square$
#let chevrons(..children) = {
let body = children.pos().join(", ")
math.lr([$chevron.l #body chevron.r$])
}
#let _qed = $square$
#let qed-equation(eq) = {
set math.equation(numbering: _ => _qed, number-align: right + bottom)
eq
}
#let qed = [#h(1fr)#_qed]
#let Im = math.op("Im")
+1 -1
View File
@@ -3,4 +3,4 @@
#import "title-page.typ": title-page
#import "lecture.typ": lecture, lecture-counter, reset-lectures
#import "boxes.typ": *
#import "helpers.typ": grad, Im, Re, ord, qed, qed-equation, render-footnote-entry, ü
#import "helpers.typ": Im, Re, chevrons, grad, ord, qed, qed-equation, render-footnote-entry, ü
+1 -1
View File
@@ -36,7 +36,7 @@
},
if lectures.len() > 0 {
let current = lectures.last().value
text(fill: active-theme.colors.text)[#current.prefix #current.number, #current.date]
[#current.prefix#{ if current.number != none [ #current.number] }, #current.date]
},
)
}