[Tex/LaTex] Weird tikz/pgfkeys error while trying example from the tikz manual.

pgfkeystikz-pgf

I am still learning to use tikz from the manual. I got an error for this code:

\documentclass[twocolumn,english]{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
  \centering
  \begin{tikzpicture}
    \node[fill=yellow,text width=3cm,align=center]{This is a
      demonstration text for showing how line breaking works.};
  \end{tikzpicture}
  \caption{Dim}
  \label{fig:dim}
\end{figure}
\end{document}

Here is the error in pgfkeys (is this package related to pgf/tikz?):

! Package pgfkeys Error: I do not know the key '/tikz/align' and I am going to 
ignore it. Perhaps you misspelled it.

What am I doing wrong?

Best Answer

I can confirm that your example produces this error with TikZ 2.00 which is shipped with Ubuntu 10.10.

With TikZ 2.00 use the key text centered:

\node[fill=yellow,text width=3cm,text centered]{This is a
  demonstration text for showing how line breaking works.};

alt text

This may help if you don't like to update pgf manually but wish to wait for an update in the ubuntu repositories. You could download the current version of pgf on http://sourceforge.net/projects/pgf/ as tds file and extract that to the appropriate place and run sudo texhash.

Perhaps somebody builds a debian package which is easy to install (sudo dpkg -i packagename.deb). At least the update for Debian (thus for Ubuntu as well) is on the wishlist. When it is packaged, you may find it on http://packages.debian.org/pgf .

Related Question