mirror of
https://github.com/kristoferssolo/LU-DF-Typst-Template.git
synced 2026-02-04 06:22:05 +00:00
feat: add attachments to outline and document new fields
This commit is contained in:
16
src/lib.typ
16
src/lib.typ
@@ -272,12 +272,26 @@
|
||||
|
||||
// Table of contents.
|
||||
// Uppercase 1st level headings in ToC
|
||||
show outline.entry.where(level: 1): it => { upper(it) }
|
||||
// show outline.entry.where(level: 1): it => { upper(it) }
|
||||
|
||||
// Format attachment entries in outline
|
||||
show outline.entry: it => {
|
||||
let el = it.element
|
||||
if el.func() == figure {
|
||||
let num = numbering(el.numbering, ..el.counter.at(el.location()))
|
||||
let pg = counter(page).at(el.location()).first()
|
||||
return block[#link(
|
||||
el.location(),
|
||||
)[#num #el.supplement. #el.caption.body] #box(width: 1fr, it.fill) #pg]
|
||||
}
|
||||
it
|
||||
}
|
||||
|
||||
outline(
|
||||
depth: 3,
|
||||
indent: 1cm,
|
||||
title: text(size: 14pt, outline-title),
|
||||
target: selector(heading).or(figure.where(kind: "attachment")),
|
||||
)
|
||||
|
||||
// Display the paper's contents.
|
||||
|
||||
Reference in New Issue
Block a user