cheat/template.typ

45 lines
851 B
Plaintext
Raw Normal View History

2024-03-06 11:02:01 +01:00
#let apply(doc) = {
set page(
paper: "a4",
flipped: true,
numbering: none,
margin: (x: 2.5em, y: 1em)
)
// Code formatting
show raw.where(block: true): it => {
set par(justify: false)
let split = it.text.split("\n")
let len = split.len()
grid(
columns: (100%, 100%),
column-gutter: -100%,
block(width: 100%, inset: 1em, for (i, line) in split.enumerate() {
box(width: 0pt, align(right, str(i + 1) + h(2em)))
hide(line)
linebreak()
}),
block(radius: 1em, fill: luma(246), width: 100%, inset: 1em, it),
)
}
show link: content => {
set text(fill: blue)
content
}
show cite: content => {
set text(fill: blue)
content
}
show ref: content => {
set text(fill: blue)
content
}
set heading(numbering: "1.1")
doc
}