Expandable Sections of Text?

Is it currently possible to make pdf documents with expandable portions of text?
Something like:

Theorem: blah blah blah
Show Proof

You click on “Show Proof” and then something like the following appears:

Theorem: blah blah blah
Hide Proof
Proof: blah blah blah

And if you click “Hide Proof” it collapses text again. I see this kind of collapsing text mostly online, but I think it could be useful in notes if one could hide proofs or even optional remarks. I’m not sure how this works with pdfs though…

The first link below shows maybe some way of doing this in tex and the second link shows more of what I’ve seen online:

Thanks!

1 Like

Hi @tarball,

this is unfortunately currently not possible with Typst. Here is a feature request to support optional content groups (OCG) which are needed for foldable sections.