minior counter updates
parent
1e1bdccaf7
commit
2ce84fe408
Binary file not shown.
@ -0,0 +1,139 @@
|
||||
#let kL = $L$
|
||||
#let dotss = $space dots.c space$
|
||||
|
||||
#let statement-style = (name, numbered: false) => it => {
|
||||
set align(start)
|
||||
block({
|
||||
strong({
|
||||
it.supplement
|
||||
if numbered and it.numbering != none {
|
||||
[ ]
|
||||
// current chapter and section
|
||||
|
||||
[#(
|
||||
..counter(heading).get().slice(0, 2).map(it => str(it)),
|
||||
numbering(it.numbering, ..it.counter.at(it.location())),
|
||||
).join(".")]
|
||||
}
|
||||
if name != none {
|
||||
[ (#name)]
|
||||
}
|
||||
[.]
|
||||
})
|
||||
[ ]
|
||||
it.body
|
||||
})
|
||||
}
|
||||
|
||||
#let definition(body, name: none) = {
|
||||
show figure: statement-style(name, numbered: false)
|
||||
figure(
|
||||
body,
|
||||
kind: "definition",
|
||||
supplement: [Definizione],
|
||||
)
|
||||
}
|
||||
|
||||
#let fact(body, name: none) = {
|
||||
show figure: statement-style(name, numbered: false)
|
||||
figure(
|
||||
body,
|
||||
kind: "fact",
|
||||
supplement: [Fatto],
|
||||
)
|
||||
}
|
||||
|
||||
#let proposition(body, name: none, numbered: true) = {
|
||||
show figure: statement-style(name, numbered: numbered)
|
||||
figure(
|
||||
body,
|
||||
// kind: "proposition",
|
||||
kind: "proposition",
|
||||
supplement: [Proposizione],
|
||||
numbering: if numbered { "1" },
|
||||
)
|
||||
}
|
||||
|
||||
#let lemma(body, name: none, numbered: true) = {
|
||||
show figure: statement-style(name, numbered: numbered)
|
||||
figure(
|
||||
body,
|
||||
// kind: "lemma",
|
||||
kind: "proposition",
|
||||
supplement: [Lemma],
|
||||
numbering: if numbered { "1" },
|
||||
)
|
||||
}
|
||||
|
||||
#let theorem(body, name: none, numbered: true) = {
|
||||
show figure: statement-style(name, numbered: numbered)
|
||||
figure(
|
||||
body,
|
||||
kind: "theorem",
|
||||
supplement: [Teorema],
|
||||
numbering: if numbered { "1" },
|
||||
)
|
||||
}
|
||||
|
||||
#let proof(body) = block(
|
||||
spacing: 11.5pt,
|
||||
{
|
||||
emph[Proof.]
|
||||
[ ]
|
||||
body
|
||||
h(1fr)
|
||||
|
||||
// Add a word-joiner so that the proof square and the last word before the
|
||||
// 1fr spacing are kept together.
|
||||
sym.wj
|
||||
|
||||
// Add a non-breaking space to ensure a minimum amount of space between the
|
||||
// text and the proof square.
|
||||
sym.space.nobreak
|
||||
|
||||
$square$
|
||||
},
|
||||
)
|
||||
|
||||
#let ref-link(target, content) = {
|
||||
show link: it => {
|
||||
set text(luma(10%))
|
||||
|
||||
// remove underline for this
|
||||
show underline: it => it.body
|
||||
|
||||
it
|
||||
}
|
||||
|
||||
link(target, emph(content))
|
||||
}
|
||||
|
||||
#let todo-color = color.mix((red, 10%), (yellow, 90%))
|
||||
#let todo(content) = block(
|
||||
breakable: false,
|
||||
grid(
|
||||
rows: 2,
|
||||
align: left,
|
||||
block(
|
||||
fill: todo-color.desaturate(20%),
|
||||
inset: (x: 0.5em, y: 0.35em),
|
||||
radius: (top: 0.25em),
|
||||
{
|
||||
set text(fill: black.transparentize(15%), size: 8pt, font: "Open Sans")
|
||||
[*TODO*]
|
||||
},
|
||||
),
|
||||
block(
|
||||
width: 100%,
|
||||
fill: todo-color.desaturate(40%),
|
||||
inset: (x: 0.5em, y: 0.5em),
|
||||
radius: (bottom: 0.25em, top-right: 0.25em),
|
||||
{
|
||||
set text(fill: black.transparentize(15%), size: 9pt, font: "Open Sans")
|
||||
content
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue