パッケージ PGF 数学エラー: 不明な関数 `of'

パッケージ PGF 数学エラー: 不明な関数 `of'

tikzpictures のブロックが 1 つあれば、ドキュメントはコンパイルされます。コードを参照してください。

\documentclass[12pt]{article}

\usepackage{amssymb}
\usepackage{amsmath}

\usepackage{graphicx}
\graphicspath{{images/}}

\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage{mdframed}
\usepackage{amsthm}
\usepackage{framed}
\colorlet{shadecolor}{gray!50}   

\begin{document} 

\begin{mdframed} [everyline=true, splitbottomskip = 10mm, splittopskip = 10mm, innertopmargin = 10mm, innerbottommargin = 10mm] 

\noindent \textit{\textbf{Example(s) 3.3 and 3.4:}} Consider two games modeled by the following figures. \vspace{3mm}
\begin{center}

\usetikzlibrary{positioning} \begin{tikzpicture}[xscale=6, yscale=8,>=stealth] 
\tikzstyle{v}=[circle, minimum size=1mm,draw,thick] \node[v] 
(a) {$a$}; \node[] (x)
 [right=of a]{}; \node[v] (c) [below=of x]{$c$}; \draw[thick,->] (a) to node {}(c);
\node[] (y)
 [left=of a]{};  \node[v] (b) [below=of y]{$b$}; \draw[thick,->] (a) to node {}(b);
\draw[thick,->] (b) to node {}(c);
\node[v] (e) [below=of c]{$e$};
\node[v] (d) [below=of b]{$d$};
 \draw[thick,->] (b) to node {}(d);
 \draw[thick,->] (c) to node {}(e);
 \draw[thick,->] (c) to node {}(d);
\end{tikzpicture} \vspace{3mm}

\textit{Figure 3.5} \vspace{3mm}

\begin{tikzpicture}[xscale=6, yscale=8,>=stealth] 
\tikzstyle{v}=[circle, minimum size=1mm,draw,thick] \node[v] 
(a) {$a$}; \node[] (x)
 [right=of a]{}; \node[v] (c) [below=of x]{$c$}; \draw[thick,->] (a) to node {}(c);
\node[] (y)
 [left=of a]{};  \node[v] (b) [below=of y]{$b$}; \draw[thick,->] (a) to node {}(b);
\draw[thick,->] (b) to node {}(c);
\node[v] (e) [below=of c]{$e$};
\node[v] (d) [below=of b]{$d$};
\node[v] (f) [right=of c]{$f$};
\node[v] (i) [left=of d]{$i$};
\node[v] (h) [below=of e]{$h$};
 \draw[thick,->] (d) to node {}(f);
\draw[thick,->] (e) to node {}(h);
\draw[thick,->] (h) to node {}(f);
 \draw[thick,->] (b) to node {}(i);
\draw[thick,->] (i) to node {}(c);
\draw[thick,->] (d) to node {}(h);
 \draw[thick,->] (b) to node {}(d);
 \draw[thick,->] (a) to node {}(e);
 \draw[thick,->] (c) to node {}(d);
 \draw[thick,->] (e) to node {}(d);
 \draw[thick,->] (i) to node {}(d);
\end{tikzpicture} \vspace{3mm}

\textit{Figure 3.6}
\end{center}

\end{mdframed} \vspace{5mm}


\end{document} 

その後、tikzpictures ブロックの後にテキストを追加し、新しい tikzpicture 環境を追加すると、ドキュメントはコンパイルされません。コードを参照してください。

\documentclass[12pt]{article}

\usepackage{amssymb}
\usepackage{amsmath}

\usepackage{graphicx}
\graphicspath{{images/}}

\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage{mdframed}
\usepackage{amsthm}
\usepackage{framed}
\colorlet{shadecolor}{gray!50} 

\begin{document} 

\begin{mdframed} [everyline=true, splitbottomskip = 10mm, splittopskip = 10mm, innertopmargin = 10mm, innerbottommargin = 10mm] 

\noindent \textit{\textbf{Example(s) 3.3 and 3.4:}} Consider two games modeled by the following figures. \vspace{3mm}
\begin{center}

\usetikzlibrary{positioning} \begin{tikzpicture}[xscale=6, yscale=8,>=stealth] 
\tikzstyle{v}=[circle, minimum size=1mm,draw,thick] \node[v] 
(a) {$a$}; \node[] (x)
 [right=of a]{}; \node[v] (c) [below=of x]{$c$}; \draw[thick,->] (a) to node {}(c);
\node[] (y)
 [left=of a]{};  \node[v] (b) [below=of y]{$b$}; \draw[thick,->] (a) to node {}(b);
\draw[thick,->] (b) to node {}(c);
\node[v] (e) [below=of c]{$e$};
\node[v] (d) [below=of b]{$d$};
 \draw[thick,->] (b) to node {}(d);
 \draw[thick,->] (c) to node {}(e);
 \draw[thick,->] (c) to node {}(d);
\end{tikzpicture} \vspace{3mm}

\textit{Figure 3.5} \vspace{3mm}

\begin{tikzpicture}[xscale=6, yscale=8,>=stealth] 
\tikzstyle{v}=[circle, minimum size=1mm,draw,thick] \node[v] 
(a) {$a$}; \node[] (x)
 [right=of a]{}; \node[v] (c) [below=of x]{$c$}; \draw[thick,->] (a) to node {}(c);
\node[] (y)
 [left=of a]{};  \node[v] (b) [below=of y]{$b$}; \draw[thick,->] (a) to node {}(b);
\draw[thick,->] (b) to node {}(c);
\node[v] (e) [below=of c]{$e$};
\node[v] (d) [below=of b]{$d$};
\node[v] (f) [right=of c]{$f$};
\node[v] (i) [left=of d]{$i$};
\node[v] (h) [below=of e]{$h$};
 \draw[thick,->] (d) to node {}(f);
\draw[thick,->] (e) to node {}(h);
\draw[thick,->] (h) to node {}(f);
 \draw[thick,->] (b) to node {}(i);
\draw[thick,->] (i) to node {}(c);
\draw[thick,->] (d) to node {}(h);
 \draw[thick,->] (b) to node {}(d);
 \draw[thick,->] (a) to node {}(e);
 \draw[thick,->] (c) to node {}(d);
 \draw[thick,->] (e) to node {}(d);
 \draw[thick,->] (i) to node {}(d);
\end{tikzpicture} \vspace{3mm}

\textit{Figure 3.6}
\end{center}

\end{mdframed} \vspace{5mm}

text stuff

\begin{tikzpicture}[xscale=6, yscale=8,>=stealth] 
\tikzstyle{v}=[circle, minimum size=1mm,draw,thick] \node[v] 
(a) {$a$}; \node[] (x)
 [right=of a]{}; \node[v] (c) [below=of x]{$c$}; \draw[thick,->] (a) to node {}(c);
\node[] (y)
 [left=of a]{};  \node[v] (b) [below=of y]{$b$}; \draw[thick,->] (a) to node {}(b);
\draw[thick,->] (b) to node {}(c);
\node[v] (e) [below=of c]{$e$};
\node[v] (d) [below=of b]{$d$};
\node[v] (f) [right=of c]{$f$};
\node[v] (i) [left=of d]{$i$};
\node[v] (h) [below=of e]{$h$};
 \draw[thick,->] (d) to node {}(f);
\draw[thick,->] (e) to node {}(h);
\draw[thick,->] (h) to node {}(f);
 \draw[thick,->] (b) to node {}(i);
\draw[thick,->] (i) to node {}(c);
\draw[thick,->] (d) to node {}(h);
 \draw[thick,->] (b) to node {}(d);
 \draw[thick,->] (a) to node {}(e);
 \draw[thick,->] (c) to node {}(d);
 \draw[thick,->] (e) to node {}(d);
 \draw[thick,->] (i) to node {}(d);
\end{tikzpicture} \vspace{3mm}


\end{document} 

TikZ/PGF マニュアルをざっと読みましたが、答えが見つかりません。何が間違っているのか、何かアドバイスはありますか?

答え1

次のエラーが発生します:

! Package PGF Math Error: Unknown function `of' (in 'of a').

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

l.76  [right=of a]
                  {}; \node[v] (c) [below=of x]{$c$}; \draw[thick,->] (a) to...

?

構文はright=of aライブラリの拡張機能/機能ですpositioning。したがって、ライブラリをロードすることでエラーは修正されます。次の行をプリアンブルに追加します。

\usetikzlibrary{positioning}

関連情報