I’m currently building a template for touying presentations. For that template I’d like to vary the text size of lists depending on the sublist depth. So for example:
- This text should be 14pt
- This text should be 12pt
- This text should be 12pt
- This text should be 14pt
I’ve already tried
#show list.where(depth: 1): set text(size: 12pt)
but while this instruction compiles without error, it does not seem to have any effect on the appearance of my list.
How can I achieve lists that have different font sizes depending on the sublist level?
There is also list.item for styling the actual items of the list. However, it wouldn’t help you in this case, because level-based styled of lists is not supported yet:
#let list-counter = counter("list")
#show list: set text(14pt)
#show list: it => {
list-counter.step()
context {
set text(10pt) if list-counter.get().first() == 2
set text(20pt) if list-counter.get().first() >= 3
it
}
list-counter.update(i => i - 1)
}
- A bit larger
- smol
- smol
- well this is large!
- A bit larger
- smol