1

I'm trying to compile the first example from Section 46.2 "Starting and Continuing a Chain" of the pgfmanual v3.0.1a (p. 541):

\begin{tikzpicture}[start chain]
% The chain is called just "chain"
\node [on chain] {A};
\node [on chain] {B};
\node [on chain] {C};
\end{tikzpicture}

my code is:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains}
\begin{document}

\begin{tikzpicture}
% Same as above, using the scope shorthand
{ [start chain=1]
\node [on chain] {A};
\node [on chain] {B};
\node [on chain] {C};
}
\end{tikzpicture}

\end{document}

And this is the error message:

! Package tikz Error: Unknown chain ``chain''.

See the tikz package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.9 \node [on chain]
                     {A};
? 
! Emergency stop.
 ...                                              

l.9 \node [on chain]
                     {A};
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on debug.log.

Version of my packages via

\documentclass{minimal}
\listfiles
\usepackage{tikz}
\usetikzlibrary{chains}
\begin{document}
\end{document}

is

tikz.sty    2015/08/07 v3.0.1a (rcs-revision 1.151)
 pgf.sty    2015/08/07 v3.0.1a (rcs-revision 1.15)
3

You missed the relevant library scopes (for the shorthand).

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

\begin{tikzpicture}
% Same as above, using the scope shorthand
{[start chain=1]
\node [on chain] {A};
\node [on chain] {B};
\node [on chain] {C};
}
\end{tikzpicture}

\end{document}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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