Hi all, I’m currently learning Typst and plan to use it for my thesis.
I have the following issue: I would like to give each figure and short and long caption. In the table of content, only the short caption should be displayed. In the figure itself, I would like to have all text in italic, an additionally, the Figure word, the figure number and the short caption in bold. Thanks to this forum, I’ve already managed to give each figure a long and short caption with the following snippet:
#let in-outline = state("in-outline", false)
#show outline: it => {
in-outline.update(true)
it
in-outline.update(false)
}
#let flex-caption(long, short) = context if in-outline.get() { short } else { long }
I would like to modify this function like this (concat the short and long string):
#let flex-caption(long, short) = context if in-outline.get() { short } else { short + long }
To make the figure word and figure number in bold and italic, and the rest only in italic, I’ve found this snippet:
#show figure.caption: it => [
#emph[*#it.supplement #context it.counter.display(it.numbering):*~#it.body]
]
How can I now modify this code that I get the following:
Figure 1: This is the short caption. This is the long caption.