Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I was creating a mindmap for a presentation using as reference tikzpicture in beamer. 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.

share|improve this question
    
<3-4> works, too. –  Qrrbrbirlbel Sep 26 '12 at 15:47
    
@Qrrbrbirlbel: yes.. also in this way it works. Thanks :) –  Claudio Fiandrino Sep 26 '12 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. –  Marc van Dongen Sep 26 '12 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. –  Paul Gaborit Sep 26 '12 at 17:25
add comment

1 Answer

up vote 5 down vote accepted

With

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

Your code runs fine.

share|improve this answer
    
Oh.. that's right, it works! It didn't come in my mind. Thank you very much :) –  Claudio Fiandrino Sep 26 '12 at 15:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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