8

I was creating a mindmap for a presentation using as reference Mindmap tikzpicture in beamer (reveal step by step). My code is:

\documentclass{beamer}
\usepackage{lmodern}
\usetheme{Copenhagen}

\usepackage{tikz}
\usetikzlibrary{mindmap}

\tikzset{
    invisible/.style={opacity=0},
    visible on/.style={alt=#1{}{invisible}},
    alt/.code args={<#1>#2#3}{%
    \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
  },
}

\tikzset{level 1 concept/.append style={font=\sf, sibling angle=90,level distance = 25mm}}
\tikzset{every node/.append style={scale=0.6,text=white}}

\begin{document}
\begin{frame}{Title}
\begin{center}
\begin{tikzpicture}[mindmap,text=white, concept color=blue]
\node[concept,visible on=<1->]{Root Concept}[clockwise from=315]
 child [concept color=violet,visible on=<2,3>] {node[concept] (c1){Child 1}                                
 }
 child [concept color=orange,visible on=<3>]{node [concept](c2){Child 2}
 };
\end{tikzpicture}
\end{center}
\end{frame}

\end{document}

which causes as error:

! Argument of \pgfkeys@code has an extra }.
<inserted text> 
                \par 
l.38 \end{frame}

I suspect the problem arises along the line:

child [concept color=violet,visible on=<2,3>] {node[concept] (c1){Child 1}}

in particular in presence of <2,3> (simply writing <2> or <2-> the compilation is fine), but I don't see any way to fix it and even (worst) I don't understand the reasons behind this error.

4
  • <3-4> works, too. Sep 26, 2012 at 15:47
  • @Qrrbrbirlbel: yes.. also in this way it works. Thanks :) Sep 26, 2012 at 15:54
  • 1
    This is hardly a minimal example. I've been playing with it and have been able to remove several statements and still reproduce the same error. In the interest of saving other people's time, I suggest you trim this down as best as you can.
    – user10274
    Sep 26, 2012 at 15:57
  • 1
    A simple rule to use pgfkeys: It is permissible to surround both the key or the value in curly braces (which are removed). Especially putting the value in curly braces needs to be done quite often, namely whenever the value contains an equal-sign or a comma. Sep 26, 2012 at 17:25

1 Answer 1

6

With

child  [concept color=violet,visible on=<{3,4}>] {node [concept](c13){Child 1-3}}

Your code runs fine.

1
  • Oh.. that's right, it works! It didn't come in my mind. Thank you very much :) Sep 26, 2012 at 15:53

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.