2

Compiling David Carlisle's answer to this question Going through permutations of nouns and verbs with

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

added as in the answer to Is it possible to load pgfmath without loading the full pgf package?, i.e., the following code

\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}

I am obtaining the following error (the log file to the first error):

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
              {%
? 

What I am doing wrong?

4
  • 3
    This is 'works for me' with an up-to-date TeX Live with or without the two \input lines: I suspect you might need to update your installation.
    – Joseph Wright
    Sep 30, 2014 at 17:18
  • 1
    You are referring to an old version of the package. The up-to-date PGF requires only \usepackage{pgfmath} but what you encounter was a bug in v2.10 (it needed pgfkeys too, and sometimes even the whole pgf) so I guess you need to update.
    – percusse
    Sep 30, 2014 at 18:13
  • @JosephWright and percusse Over an hour of updating, but you were right! Now it works perfectly. Thank you! Sep 30, 2014 at 18:43
  • 2
    This question appears to be off-topic because it is about a problem solved with a software update
    – egreg
    Jan 3, 2015 at 23:30

0

Browse other questions tagged .