OCGs are now possible with typst with the millefeuille package ( millefeuille – Typst Universe ) and postprocessor. Typst mark the content in the pdf it produces and the python postprocessor create a pdf with the OCGs. A small windows GUI app is also available (interface in english, french, german and spanish) and the messages are in english (with the english version) or french. Be aware this solution is made on a hack and the postprocessor may break some accessibility artifacts (kind:“watermark” and maybe “page”). Some examples are linked in the README and it contains the following animated svg to give an idea of a few possibilities. Of interest to some, the solution also enable ocgcolorlinks: coloured and/or framed on screen, plain when printed.
I didn’t know what OCG was but the animation caught my attention so checked out the package. As I understand it now: The package allows using a feature of PDFs called OCG (optional content groups) that can be shown/hidden based on user input. These layers can be used to create documents with…
clickable answers, show/hide buttons, step-by-step reveals, radio groups, conditional content, hover hints, print/screen-only content (like with
hyperref), and student / answer-key versions of the same document.
Sounds very powerful and is a cool extension of what Typst is capable of.
Is my understanding correct?
Yes, your understanding is completely correct.
I personally use them mainly for my slides (as a teacher) : the result is much lighter than with normal slides using pause etc to reveal content.