I’m writting this template that has a table of contents, list of images, list of tables, etc. These you can outline with a proper selector (i.g., #outline(target: figure.where(kind: image))).
I know I can create my custom figure kind, but what if I didn’t want figures nor headings?
The documentation says that the target can be a label, selector, location or function. But I’ve tried passing a label to text to no avail. Tried passing in a function, but it complained that it wasn’t an element function. I tried location, but that required context, which started to feel unnecessarily complex.
The docs don’t really show any other example other than heading and figure, so I wanted to know what more I could do.
For context, I’m trying to create a list of abreviations, so I created my own function that manages state.
#let abreviations() = {
let abreviation-dict = state("abreviations", (:))
let add-abreviation(key: none, value: none, description: none) = {
if key == none or value == none or description == none {
panic("Key, value and description are necessary parameters.")
}
abreviation-dict.update(old => {
old.insert(key, (value: value, description: description))
})
[#description (#value)]
}
(add-abreviation)
}
#let (add-abreviation) = abreviations()
The idea would be to increment it with either a label or location that could be used by outline.

