27

This question led to a new package:
aobs-tikz

  1. Is it possible to alter the code in the following MWE to the effect that “ABCD” is visible on both slides but only on the second it has the red node as background?

    \documentclass{beamer}
    \usepackage{tikz}
    \tikzset{
        invisible/.style={opacity=0,text opacity=0},
        visible on/.style={alt=#1{}{invisible}},
        alt/.code args={<#1>#2#3}{%
          \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} 
        },
      }
    \begin{document}
    \frame{\frametitle{Title}
    \tikz[remember picture,baseline=(A.base)] \node[fill=red!30,anchor=base,rounded corners,visible on=<2>] (A) {ABCD};
    }
    \end{document}
    
  2. Using similar code, I would also like to have itemizations such that on all slides all items are visible but they are successively highlighted in the same way as the “ABCD” in the previous MWE. (This differs from the standard alert mode in that at every time all items are visible and instead of changing the color of the item one uses a red background box.)

lpdbw
  • 8,330
  • \node[alt=<2>{fill=red!30,rounded corners}{},anchor=base] (A) {ABCD}; 2. Are you thinking of something like \foreach \i in {1,...,4} \tikz[remember picture,baseline] \node[alt=<\i>{fill=red!30,rounded corners}{},anchor=base] (A) {ABCD};? In the last example <\i> can be substituted by <+>.
  • – Qrrbrbirlbel Nov 27 '12 at 18:10
  • That works fine, thanks! 2. I am thinking of \begin{itemize}\item abc\item cde\item fgh\item ijk\end{itemize} such that on all slides all items are visible but item i is highlighted by a node as before on slide i only. Not sure whether that's what you had in mind ...(?)
  • – lpdbw Nov 27 '12 at 19:13
  • Ah, I am stupid. 2) can be solved exactly in the same way as 1)! So please write your comment into an asnwer so that I can accept it. Thanks. – lpdbw Nov 27 '12 at 19:18