加载 pgfmath 时出现“未定义控制序列 \pgfkeys”

加载 pgfmath 时出现“未定义控制序列 \pgfkeys”

整理 David Carlisle 对此问题的回答名词和动词的排列组合

\input{pgfutil-common}
\input{pgfmath.code}

补充回答是否可以在不加载完整的 pgf 包的情况下加载 pgfmath?,即以下代码

\documentclass{article}
\usepackage{pgfmath,color}
\input{pgfutil-common}
\input{pgfmath.code}


\def\noun{%
{{Fu}},{Fa}{ra},{{Uta}},{Ma}{ma},%
{Ma}{mi},{{Ralf}},{La}{ra},%
{Ma}{ra},{Mu}{rat},{Mar}{ta},%
{Ma}{mut},{Ir}{a},{Mir}{a},{Ma}{ri}{a}%
}

\def\verb{{malt},{ruft},{um}{armt}%
}

\def\zc{\expandafter\zzblue}
\def\zzblue#1{%
\ifx\relax#1\else\textcolor{blue}{#1}%
\expandafter\zzred
\fi}

\def\zzred#1{%
\ifx\relax#1\else\textcolor{red}{#1}%
\expandafter\zzblue
\fi}

\begin{document}

\makeatletter


\@for\za:=\noun\do{%
\@for\zb:=\noun\do{%
\ifx\za\zb\else
\@for\v:=\verb\do{
\par\zc\za\relax\ \zc\v\relax\ \zc\zb\relax
\pgfmathparse{random(2)}%
\ifnum\pgfmathresult=1\ \textcolor{blue}{mit mir}\fi.

}%
\fi
}}

\end{document}

我收到以下错误(第一个错误的日志文件):

This is pdfTeX, Version 3.1415926-1.40.11 (MiKTeX 2.9)
entering extended mode
(D:/PSch/Stack/mami2.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, 
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese, 
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
(D:\PSch\Stack\article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\math\pgfmath.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmath.code.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathcalc.code.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathutil.code.tex")
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathparser.code.tex")
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.code.tex"
! Undefined control sequence.
l.108 \pgfkeys
              {%
? 

我做错了什么?

相关内容