此代码片段在 Windows 7 上编译良好。但是,当我在 Linux 上运行它时,编译器抱怨找不到键/tikz/align
。显然,删除该选项align=flush center
解决了编译器错误,但结果是我没有得到预期的显示。我是否在这里缺少其他一些软件包?或者 TeXLive 和 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}