Workarounds for bug with `#set heading(outlined:false)`?

From reading the GitHub issue(s), this seems to be a duplicate of Hide or ignore? ToC structure issue.

Well summed up by this post.

Duplicate of

My view: that’s not a code thing, but a logic thing.

If you want something looks like a heading, but not appear in typst-outline() or pdf-reader-bookmark(), is it a real heading for sure? Why not…

#let heading-pretend(l, h) = {text(1.6em-l*0.2em, weight:"bold")[#h]}

= 1
== 1.1
#heading-pretend(2)[1.x]
#heading(level:2)[1.2]

#outline()
2 Likes