50 lines
954 B
Typst
50 lines
954 B
Typst
|
/// Miscellaneous utilities
|
||
|
|
||
|
#let ored = rgb("D62121")
|
||
|
#let oorange = rgb("#ffaa3b")
|
||
|
#let ogrape = rgb("9C36B5")
|
||
|
#let ocyan = rgb("2288BF")
|
||
|
#let oteal = rgb("12B886")
|
||
|
#let ogreen = rgb("37B26D")
|
||
|
#let oblue = rgb("1C7ED6")
|
||
|
|
||
|
|
||
|
#let note(content, type: none) = {
|
||
|
set text(fill: rgb(100, 100, 100))
|
||
|
if type != none {
|
||
|
text(style: "oblique", [#type: ])
|
||
|
}
|
||
|
text(content)
|
||
|
}
|
||
|
|
||
|
#let hint = note.with(type: "Hint")
|
||
|
|
||
|
#let examplesolution(content) = {
|
||
|
let c = oblue
|
||
|
|
||
|
align(
|
||
|
center,
|
||
|
stack(
|
||
|
block(
|
||
|
width: 100%,
|
||
|
breakable: false,
|
||
|
fill: c,
|
||
|
stroke: c + 2pt,
|
||
|
inset: 1.5mm,
|
||
|
(
|
||
|
align(left, text(fill: white, weight: "bold", [Example solution:]))
|
||
|
),
|
||
|
),
|
||
|
block(
|
||
|
width: 100%,
|
||
|
height: auto,
|
||
|
breakable: false,
|
||
|
fill: c.lighten(80%).desaturate(10%),
|
||
|
stroke: c + 2pt,
|
||
|
inset: 3mm,
|
||
|
align(left, content),
|
||
|
),
|
||
|
),
|
||
|
)
|
||
|
}
|