I have a series of images I want to make interactive. As an example let us say I have three images: a cat, a dog and a mouse.

I want have all three in a single figure in my document, but not shown simultaneously. In fact, I want the reader to be able to click on corresponding text to change the image. So: The same figure with clickable areas in the image - or text beneath. When clicked the image changes, like in the mockup below.

I know interactive videos, 3D models and questionnaires can be made using LaTeX. Can something like this also be done? I am guessing PDF layers and pgf/tikz might do it, but I am unsure as to how


  • 1
    PDF Layers via pkg ocgx2 could be an option.
    – AlexG
    Jul 15, 2022 at 12:54

1 Answer 1


This can be achieved with PDF Layers via package ocgx2. Note the use of the common option radiobtngrp to make the visibility of the grouped layers mutually exclusive.



  \showocg{A}{Letter ``A''}\quad
  \showocg{B}{Letter ``B''}\quad
  \showocg{C}{Letter ``C''}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .