答案1
这可以通过 PDF Layers 包实现ocgx2
。请注意使用 common 选项radiobtngrp
使分组图层的可见性相互排斥。
\documentclass{article}
\usepackage{hyperref}
\usepackage{ocgx2}
\usepackage{graphicx}
\begin{document}
\begin{center}
\makebox[0pt][l]{%
\begin{ocg}[radiobtngrp=letters]{A}{A}{on}
\includegraphics[width=\linewidth]{example-image-a}
\end{ocg}
}%
\makebox[0pt][l]{%
\begin{ocg}[radiobtngrp=letters]{B}{B}{off}
\includegraphics[width=\linewidth]{example-image-b}
\end{ocg}
}%
\begin{ocg}[radiobtngrp=letters]{C}{C}{off}
\includegraphics[width=\linewidth]{example-image-c}
\end{ocg}
\showocg{A}{Letter ``A''}\quad
\showocg{B}{Letter ``B''}\quad
\showocg{C}{Letter ``C''}
\end{center}
\end{document}