10

I am using Beamer LaTeX for a presenation. On one slide I want to interact with the audience and I want to unhide the text (A,B,C,D,E in the MWE) in the order in which the audience mentions these texts (i.e. if they first mention C, then D, then A, I want to click on C to make it appear, then on D so that C and D are visible and then on A so that A,C,D are visible).

I could use a construction as mentioned here, but I would need an extra slide for any of the possible combinations. Is there any easier method?

MWE:

\documentclass[ngerman]{beamer}
\begin{document}
\begin{frame}
\begin{block}{Questions}
\begin{itemize}
\item A
\item B
\item C
\item D
\item E
\item ...
\end{itemize}
\end{block}
\end{frame}
\end{document}
Martin
  • 511
  • 2
    Possibly related: https://tex.stackexchange.com/questions/79832/change-on-click-in-beamer (not a duplicate). –  Apr 18 '17 at 14:09

3 Answers3

5

This is very cheap, but at the same time very interactive.

\documentclass{beamer}
\usepackage{pdfcomment}

\begin{document}
    \begin{frame}
        \begin{block}{Questions}
            \begin{itemize}
                \item A 
                    \pdfsquarecomment
                        [height=.8cm,width=5cm,voffset=-.2cm,hoffset=-.4cm]
                        {use mouse to move this}
                \item B
                \item C
                \item D
                \item E
                \item ...
            \end{itemize}
        \end{block}
    \end{frame}
\end{document}

This idea is to build an annotation that covers the contents. When the audience mentions it, use your mouse to move the annotation away. (Or simply press delete or backspace to delete it)

Advantage

Since only annotation involves, this is supported by more PDF readers. (In contrast, PDF readers from the unix world does not like javascript and a bunch of useful PDF features. This includes Preview on macOS.)

Bonus

This is called Tangram.

Have fun!

\documentclass{beamer}
\usepackage{tikz,pdfcomment}

\begin{document}
    \begin{frame}
        \pdflinecomment[type=polygon,line={300 100 350 150 300 200}]{}
        \pdflinecomment[type=polygon,line={150 60 250 60 200 10}]{}
        \pdflinecomment[type=polygon,line={10 50 60 50 60 100}]{}
        \pdflinecomment[type=polygon,line={10 210 35 235 60 210 35 185}]{}
        \pdflinecomment[type=polygon,line={150 200 175 225 175 275 150 250}]{}
        \pdflinecomment[type=polygon,line={300 20 350 20 325 45}]{}
        \pdflinecomment[type=polygon,line={260 190 285 215 285 165}]{}
        \tikz[remember picture,overlay]{
            \draw(current page.center)+(-50bp,-50bp)rectangle+(50bp,50bp);
        }
    \end{frame}
\end{document}

Symbol 1
  • 36,855
4

Using the ocgx package mentioned in the link posted in Andrew's comment I managed to solve the problem:

\documentclass[ngerman]{beamer}
\usepackage{ocgx}
\begin{document}
\begin{frame}
\begin{block}{Questions}
\begin{itemize}
\item \begin{ocg}{Bul01}{ocg01}{0}\actionsocg{ocg01}{}{}{A}\end{ocg}
\item \begin{ocg}{Bul02}{ocg02}{0}\actionsocg{ocg02}{}{}{B}\end{ocg}
\item \begin{ocg}{Bul03}{ocg03}{0}\actionsocg{ocg03}{}{}{C}\end{ocg}
\item \begin{ocg}{Bul04}{ocg04}{0}\actionsocg{ocg04}{}{}{D}\end{ocg}
\item \begin{ocg}{Bul05}{ocg05}{0}\actionsocg{ocg05}{}{}{E}\end{ocg}
\item \begin{ocg}{Bul06}{ocg06}{0}\actionsocg{ocg06}{}{}{...}\end{ocg}
\end{itemize}
\end{block}
\end{frame}
\end{document}
Martin
  • 511
1

This makes the item bullets (triangles, actually) clickable in order to show/hide the following text, using OCGs:

\documentclass[ngerman]{beamer}
\usepackage{ocgx2}

\begin{document}
\begin{frame}
\begin{block}{Questions}
\begin{itemize}
  \item[\switchocg{ocg01}{\usebeamertemplate{itemize item}}]\mbox{}\begin{ocg}{Bul01}{ocg01}{0}A\end{ocg}
  \item[\switchocg{ocg02}{\usebeamertemplate{itemize item}}]\mbox{}\begin{ocg}{Bul02}{ocg02}{0}B\end{ocg}
  \item[\switchocg{ocg03}{\usebeamertemplate{itemize item}}]\mbox{}\begin{ocg}{Bul03}{ocg03}{0}C\end{ocg}
  \item[\switchocg{ocg04}{\usebeamertemplate{itemize item}}]\mbox{}\begin{ocg}{Bul04}{ocg04}{0}D\end{ocg}
  \item[\switchocg{ocg05}{\usebeamertemplate{itemize item}}]\mbox{}\begin{ocg}{Bul05}{ocg05}{0}E\end{ocg}
  \item[\switchocg{ocg06}{\usebeamertemplate{itemize item}}]\mbox{}\begin{ocg}{Bul06}{ocg06}{0}\dots\end{ocg}
\end{itemize}
\end{block}
\end{frame}
\end{document}
AlexG
  • 54,894