#outline()
#show heading: set text(red)
= heading
= heading
// Override the original style
= #set text(black); heading
= heading
= heading
// Another way to do so
#[
#show heading: set text(black)
= heading
]
= heading
This is definitely not common. At the very least, it should be = #text(black)[heading]. Either way, since it’s in the heading’s body, the outline entry will also have the same styling applied, unlike the show-set rules.
Thank you for your reply!
Unfortunately, it can’t work nicely in my project because I have used a function to change the color. And I match the content by string directly. Like:
show "sth": it => text(red, it)
(fixed the code highlight to typc)
The colored text was in the innermost layer, so I have no way to override it. That is the reason why I am looking for a way to flag one content to prevent coloring.
#show heading: it => {
set text(red) if not (it.has("label") and it.label == <special>)
it
}
= heading
= heading
= heading <special>
= heading
= heading
= heading <special>