I’m having difficulty finding the right syntax for this. I have some sections of my document that I want to suppress certain heading levels from the outline, and I thought the outlined parameter would be the one to use.
Basically, my intent is something like set heading(outlined: false).where(level: 3). I know this isn’t valid, but just an example.
For example, I have a block that I want everything inside to suppress level 3 heading:
#let suppress_lvl_3(doc) = {
show heading.where(level: 3):it => {
set heading(outlined: false)
it
}
doc
}
But it doesn’t seem to have an effect.
I know there is a way to set conditionally using a syntax that looks like #set heading(outlined: false) if CONDITION HERE, but I don’t know what condition would work for this. Any idea on the simplest way to do this?
Hello! I suppose you are using your function like this: show: suppress_lvl_3? or suppress_lvl_3[content]? Without knowing more about your document, it’s difficult to tell why it’s not working.
Alternatively, just write a show-set rule!
show heading.where(level: 3): set heading(outlined: false) // turn it off
[suppressed section]
show heading.where(level: 3): set heading(outlined: true) // turn it on
Wow, I can’t believe it was that simple! Thanks a lot!
But why wasn’t this working:
#show heading.where(level: 3):it => {
set heading(outlined: false)
it
}
Your solution looks quite similar, so I’m struggling to see how they differ at a fundamental level, but I’m not fully familiar with the syntax. Could you explain a bit of the differences between this and your solution in terms on why mine was not working?
A lot of stuff now is immutable. I don’t know if there will be a possibility to edit elements in-place, but there are a ton of things to do now, so maybe one day, but not anywhere soon.