I want to add a colon to the entries of all outlines that are not the table of contents in my document (index of figures, index of tables, index of algorithms…). Is there a solution that does not involve exhaustively iterating on all these types of outlines like what follows?
#show outline.where(target: figure.where(supplement: [Figure])).or(
outline.where(target: figure.where(supplement: [Table]))).or(
outline.where(target: figure.where(supplement: [Algorithm]))
// and so on...
): out => {
show outline.entry: ent => ent.indented(
[#ent.prefix():], ent.inner()
)
out
}
You can set up a conditional show rule for the outline entries to add the colon depending on the outline target. This allows you to just exclude the outline entries of headings.
On another note, your show rule for the outline entry with a colon was missing the link to the element, see the docs on “Building an entry”.
#let colon-entry(it) = {
link(
it.element.location(),
it.indented([#it.prefix():], it.inner())
)
}
#show outline: out => {
show outline.entry: it => if out.target == selector(heading) { it } else { colon-entry(it) }
out
}
I’m looking for the same solution as the author, but don’t know exactly how to apply your code. When insert in the doc of the figure or table outline, nothing happens. Could you help, please?
@Methan1075 Try copy-pasting @janekfleper’s snippet right before the first outline of your document. Make sure to put it after any template show rule that may otherwise override the outline behavior. If you need more help, you can contact me in PM, but there’s only so much I can do without knowing your code