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.

Does someone know how I must compile the example of the tikz/pgf user manual (v2.10) in section 28.5:

\usetikzlibrary{chains}

\begin{tikzpicture}[every on chain/.style=join,every join/.style=->,
node distance=2mm and 1cm]
{ [start chain=trunk]
\node [on chain] {A};
\node [on chain] {B};
{ [start branch=numbers going below]
\node [on chain] {1};
\node [on chain] {2};
\node [on chain] {3};
}
{ [start branch=greek going above]
\node [on chain] {$\alpha$};
\node [on chain] {$\beta$};
\node [on chain] {$\gamma$};
}
\node [on chain,join=with trunk/numbers-end,join=with trunk/greek-end] {C};
{ [start branch=symbols going below]
\node [on chain] {$\star$};
\node [on chain] {$\circ$};
\node [on chain] {$\int$};
}
}
\end{tikzpicture}

Like this I get

Line 6: Package tikz Error: Unknown chain ``chain''.
share|improve this question
1  
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. Can you please complete your MWE so it is running? (\documentclass... til \end{document}) –  Kurt Sep 25 '12 at 21:49
add comment

1 Answer

up vote 12 down vote accepted

Load the scopes library:

\usetikzlibrary{chains,scopes}

The complete example:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains,scopes}

\begin{document}

\begin{tikzpicture}[every on chain/.style=join,every join/.style=->,
node distance=2mm and 1cm]
{ [start chain=trunk]
\node [on chain] {A};
\node [on chain] {B};
{ [start branch=numbers going below]
\node [on chain] {1};
\node [on chain] {2};
\node [on chain] {3};
}
{ [start branch=greek going above]
\node [on chain] {$\alpha$};
\node [on chain] {$\beta$};
\node [on chain] {$\gamma$};
}
\node [on chain,join=with trunk/numbers-end,join=with trunk/greek-end] {C};
{ [start branch=symbols going below]
\node [on chain] {$\star$};
\node [on chain] {$\circ$};
\node [on chain] {$\int$};
}
}
\end{tikzpicture}

\end{document}

enter image description here

The presence of an opening brace followed by some options (inside square brackets) usually indicates the syntax for a scope provided by the scopes library.

share|improve this answer
    
Is this documented anywhere reasonably findable? The tikz manual has the frustrating habit of almost never including complete examples. Given the size of the manual, this makes it extremely difficult to learn. The expectation seems to be that you'll somehow intuit the necessary additions. Even knowing I want the scopes library, I can't find anything about it ;). The only entry in the index points to page 128 which is about quotes not scopes! –  cfr Mar 30 at 3:25
    
@cfr Section 12.3.2 Shorthand for Scope Environments (page 128) of the manual for version 3.0.0. –  Gonzalo Medina Mar 31 at 16:56
    
Thanks. I have no idea why the link from the index took me to quotes before. –  cfr Mar 31 at 20:55
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.