Refactor handout.typ
Reviewed-on: #7 Co-authored-by: Mark <mark@betalupi.com> Co-committed-by: Mark <mark@betalupi.com>
This commit is contained in:
49
lib/typst/local/handout/0.1.0/misc.typ
Executable file
49
lib/typst/local/handout/0.1.0/misc.typ
Executable file
@ -0,0 +1,49 @@
|
||||
/// 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),
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user