1

Using temporal it is possible to get a transitioning effect on one slide. The following example creates an error on one of the lines.

Essentially:

This does work: node at (ONE) [select on=<1>]{ONE}

This does work: node at (ONE) [select on=<3>]{ONE}

This does work: node at (ONE) [select on=<1-3>]{ONE}

This does not work: node at (ONE) [select on=<1,3>]{ONE}

\documentclass[c]{beamer}

\usepackage{tikz,times}

\begin{document}

\begin{frame}[fragile]

\newcommand{\magic}{1}
\newcommand{\interesting}{2}
\newcommand{\selected}{3}

\resizebox{0.485\textwidth}{!}{
\begin{tikzpicture}[baseline={(ONE.base)}]
\tikzset{
    normal/.style={fill=white, align=center, draw},
    selected/.style={fill=orange, align=center, thick, draw},
    temporal/.code args={<#1>#2#3#4}{\temporal<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}{\pgfkeysalso{#4}}},
    select on/.style={temporal=#1{normal}{selected}{normal}}
  }

\coordinate (ONE) at (0,0);
\coordinate (TWO) at (4,1);
\coordinate (THREE) at (8,-1);

\draw (ONE) -- (TWO) -- (THREE);

\draw
    %ERROR HERE
    node at (ONE)   [select on=<\magic,\selected>]{ONE}
    %node at (ONE)   [select on=<1,3>]{ONE} <- same error
    %node at (ONE)   [select on=<\magic>]{ONE} <- no error
    node at (TWO)   [select on=<\interesting>]{TWO}
    node at (THREE) [select on=<\selected>]{THREE}
    ;
\end{tikzpicture}
}
\begin{minipage}[t]{0.485\textwidth}
\scriptsize
\begin{overprint}
\onslide<\magic>
\textcolor{orange}{\emph{Magic}} -- 
The selected nodes are magic, the audience applaudes.

\onslide<\interesting>
\textcolor{orange}{\emph{Interesting}} -- 
The selected nodes are interesting, an author wrote a book.

\onslide<\selected>
\textcolor{orange}{\emph{Selected}} --
The selected nodes are selected. This may or may not be obvious.

\end{overprint}
\end{minipage}

%DO NOT INDENT THE END OF A FRAGILE FRAME
\end{frame}
\end{document}

To sort and present my data the way i want to i need the selections to show up multiple times in the presentation in different constellations.

How can i fix this in a way that gets node at (ONE) [select on=<\magic,\selected>]{ONE} to work. Normal on all slides but 1 and 3 where the nodes show up as selected.

2

The problem is the comma inside the <,>, which confuses tikz parser which takes it as a key separator.

The solution is to enclose in braces that part, i.e:

\draw    
     node at (ONE)   [select on=<{\magic,\selected}>]{ONE}
     ...;

Result

  • nice, thanks - i was hoping for something like this. – Johannes Jul 14 '14 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.