Skip to content

Commit

Permalink
Reference first-level headings as "chapters" instead of "sections" (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: Benedikt Geisberger <[email protected]>
  • Loading branch information
pal03377 and bgeisb authored Sep 14, 2023
1 parent a618060 commit 9c95fc4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions thesis_template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@
show heading: set block(below: 0.85em, above: 1.75em)
show heading: set text(font: body-font)
set heading(numbering: "1.1")
// Reference first-level headings as "chapters"
show ref: it => {
let el = it.element
if el != none and el.func() == heading and el.level == 1 {
[Chapter ]
numbering(
el.numbering,
..counter(heading).at(el.location())
)
} else {
it
}
}

// --- Paragraphs ---
set par(leading: 1em)
Expand Down

0 comments on commit 9c95fc4

Please sign in to comment.