Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

1 Answer

up vote 5 down vote accepted

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.

share|improve this answer
1  
Reported as sourceforge.net/p/pgf/bugs/249 –  Joseph Wright Jul 6 '13 at 17:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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