[Tex/LaTex] PGF/TikZ error when using chains

errorstikz-pgf

I'm trying to learn how to use PGF/TikZ to draw pictures, in particular a chain of nodes.

I have the following picture:

\begin{tikzpicture}[start chain, node distance=5mm]
  \node [on chain,join] {$t_\mathrm{opt flow}$};  
  \node [on chain,join] {$foo$};
\end{tikzpicture}

I would expect this to yield two nodes connected by a simple
line. Instead, when I run LaTex, I get the following error:

./NIQ_Principles.tex:39: Package PGF Math Error: Unknown function `of'.
./NIQ_Principles.tex:40: Extra }, or forgotten \endgroup.\endpgfpicture ... \pgf@y }\endgroup \hss \egroup 
                                                  \pgf@insertlayers \endgrou...

Can someone help me understand what I'm doing wrong?

UPDATE

Here is my complete example:

\documentclass{scrartcl}

\usepackage{tikz}
\usetikzlibrary{chains}

\begin{document}

\begin{tikzpicture} [start chain, node distance=5mm]
  \node [on chain,join] {foo};  
  \node [on chain,join] {bar};
\end{tikzpicture}

\end{document}

And here is the output I get:

ERROR: Package PGF Math Error: Unknown function `of'.

--- TeX said ---

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

l.10   \node [on chain,join]
                             {bar};
--- HELP ---
From the .log file...

This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.

I can't really claim that I'm as smart as Mr Poirot, so can someone
point me in the right direction?

Best Answer

I found that the pgf package installed under Ubuntu was version 2.00, whereas the latest version (and the one from whose documentation I was trying the examples) was 2.10.

Installing the latest version of pgf under my local texmf tree solved the problem.