This code snippet compiles fine on Windows 7. However, when I ran it on Linux, the compiler complained that it couldn't find the key /tikz/align. Obviously, get rid of the option align=flush center solved the compiler errors, but the consequence was I don't get my expected display. Am I missing some other packages here? or there are several differences between TeXLive and MikTeX?
\documentclass[10pt,letterpaper]{article}
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{ntheorem}
\usepackage{polynomial}
\usepackage{layouts}
\usepackage{enumerate}
\usepackage{mdwtab}
\usepackage[version=0.96]{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,automata,backgrounds,petri,positioning}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{decorations.fractals}
\usetikzlibrary{decorations.footprints}
\usetikzlibrary{shadows}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\usepackage[bookmarksopen,bookmarksdepth=3]{hyperref}
\usepackage{titlesec}
\usepackage{xcolor}
%define new colors
\definecolor{dark-red}{rgb}{0.4,0.15,0.15}
\definecolor{dark-blue}{rgb}{0.15,0.15,0.4}
\definecolor{medium-blue}{rgb}{0,0,0.5}
%set up color for table of contents
\hypersetup{
colorlinks, linkcolor={medium-blue},
citecolor={dark-blue}, urlcolor={medium-blue}
}
\usepackage{tocloft}
%preven linebreak between subsection header and its content
\usepackage{titlesec}
\titleformat{\subsection}[runin]{\normalfont\bfseries}{\thesubsection.}{3pt}{}
\titleformat{\section}[runin]{\normalfont\bfseries}{\thesection.}{3pt}{}
%title
\title{\textbf{Solution for Chapter 1}}
\begin{document}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]
\node[state,initial] (q_1) {$q_1$};
\node[state,accepting] (q_2) [right=of q_1] {$q_2$};
\node[state] (q_3) [below right=of q_1] {$q_3$};
\path[->]
(q_1) edge [bend left] node {a} (q_2)
(q_1) edge [loop above] node {b} (q_1)
(q_2) edge [bend left] node {a,b} (q_3)
(q_3) edge [bend left] node {a} (q_2)
(q_3) edge [bend left] node {b} (q_1);
\node [below=1cm, align=flush center,text width=8cm] at (q_3)
{
$M_1$
};
\end{tikzpicture}
\end{document}
\pgfversionafter\begin{document}; the version will then be printed in your document. I suspect your Linux version is older than 2.1, and should really be updated. – Jake Aug 05 '11 at 05:06