3

I'm trying to follow the example from the tikz manual (2.10-CVS development version), but I'm not meeting success. Here's my MWE

\documentclass{article}
\usepackage{pgfkeys}
\pgfkeys
  {
    /handlers/first char syntax=true,
    /handlers/first char syntax/the character "/.initial=\hello,
  }
\newcommand{\hello}[1]{Quoted: #1.}

\pagestyle{empty}
\begin{document}

Hello: \pgfkeys{"Does this work"}
\end{document}

But I'm getting the following error:

! Undefined control sequence.
\pgfkeys@syntax@handlers ->\pgfutil@ifnextchar 
                                               \relax \pgfkeys@syntax@@handl...
l.8   }

? 

Any suggestions?

  • Which version of the docs are you looking at: I don't see first char syntax in the PGF v2.10 manual. (I get an error about an unknown key, not the internal one you get.) – Joseph Wright Jul 6 '13 at 16:38
  • @JosephWright I'm using the 2.10 CVS version copied per the instruction found here – A.Ellett Jul 6 '13 at 16:40
  • Use pgf instead of pgfkeys... – Paul Gaborit Jul 6 '13 at 16:50
5

The \pgfutil@ifnextchar macro is defined as part of the 'basic utilities' of pgf but not as part of the pgfkeys code (pgfkeys.code.tex). As such, you need to load pgf rather than just pgfkeys to make this work:

\documentclass{article}
\usepackage{pgf}
\pgfkeys
  {
    /handlers/first char syntax=true,
    /handlers/first char syntax/the character "/.initial=\hello,
  }
\newcommand{\hello}[1]{Quoted: #1.}

\pagestyle{empty}
\begin{document}

Hello: \pgfkeys{"Does this work"}
\end{document}

Note that I've had to had modify the \newcommand line subtly, compared to the MWE in the question.


As the question relates to the development version of pgf, and as the code comments in pgfkeys.code.tex describe it as self-contained, I would regard this as an issue in the code, which should be reported to the developers.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.