TransWikia.com

OCGX2 to successively change visibility using one button

TeX - LaTeX Asked on March 9, 2021

I am using the ocgx2 package with hyperref and scrartcl class to do simple things, basically just doing

switchocg{ocg1}{Toggle}
begin{ocg}{OCG 1}{ocg1}{0}
    hidden text...
end{ocg}

in order to toggle the visibility of some text.

Now I would like to change the visibility of several text portions using a single button in the following fashion:

Lets say I have three texts T1, T2, T3 (all are initially hidden) and one button B.

  1. B pressed once: T1 becomes visible
  2. B pressed again: T1 and T2 are visible
  3. B pressed again: T1, T2 and T3 are visible
  4. (optional) B pressed again: T1, T2 and T3 are hidden

It seems that OCMD (Optional Content Membership Dictionaries) could be used to achieve something like this, but I did not figure out how to do it nor have I seen an example of it being employed.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP