TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have just recently upgraded my TeXLive from version 2010 to 2011 (OS versions Ubuntu 10.10/Maverick 32-bit and Windows 7/64 bit).

This is pdfTeX, Version 3.1415926-2.3-1.40.12 (Web2C 2011)
(format=pdflatex 2011.8.10) 15 AUG 2011 09:34

To test the new version I thought it would be a good idea to try to compile some of my older documents. It all went flawlessly until I got to a paper that had some TikZ graphics, which produced errors. After some investigation I had found that the problem was caused by some positioning elements of TikZ. Here is a MWE:



\begin{tikzpicture}[remember picture, note/.style={rectangle callout, fill=#1}]
\draw [help lines] grid(3,2);
\node [note=red!50, callout relative pointer={(0,2)}] at (0,0) {Good};
\node [note=blue!50, callout relative pointer={(0,2)}] at (2,0) {Good};
%\node [note=blue!50, callout absolute pointer={(0,2)}] at (2,0) {Error};

The above code is a slightly modified version of the sample found in the TikZ & PGF Manual Version 2.10, page 454 (2nd sample). The error is caused by the commented line. Whenever absolute positioning is used, an error is generated like the one below:

! Undefined control sequence.
\pgf@sh@bg@rectangle callout ...f@sh@np@\pgf@test 
                                              \noexpand \endcsname }\ede...
l.24 ...lute pointer={(0,1)}] at (1,0) {Absolute};

I would appreciate any pointers. Cheers.

share|improve this question
There is now a fuller answer to this question at tex.stackexchange.com/q/31921/86 – Loop Space Oct 18 '11 at 16:49
up vote 5 down vote accepted

Update: See Daniel's answer at callout and beamer for a fuller patch.

This appears to be a bug in PGF. Looking at the relevant line in pgflibraryshapes.callouts.code.tex, I see the following code:

% \pgf@test = the shape name (from \pgfmultipartnode)
    % Now hack an extra saved anchor \calloutpointeranchor,
    % with the new anchor for the callout pointer.
    \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@test\noexpand\endcsname}%

But when I looked at the definition of \pgfmultipartnode I couldn't find a place where \pgf@test is assigned to the shape name. Instead, I found \def\shape@name{#1}% CJ. And when I replaced \pgf@test by \shape@name in pgflibraryshapes.callouts.code.tex then I get what appears to be the right behaviour. (This might not be the only fix needed: \pgf@test is used a couple more times in that library; the others aren't documented and aren't needed to fix this code.)

Long-term fix: report this on the PGF bug tracker.

Short-term fix: copy the file pgflibraryshapes.callouts.code.tex somewhere where it will be read first (personal texmf directory, for example) and modify it in line with the above (ie replace \pgf@test by \shape@name).

share|improve this answer
Thank you, Andrew. It solves the problem temporarily. I'll try to report this to the PGF maintainers. – Heisenb0rg Aug 15 '11 at 10:09
@Heisenb0rg The code compiles fine with pgf 2.1 CVS ! – Alain Matthes Aug 15 '11 at 11:42
@Altermundus: Thanks for the info. My version is 2.10, not from CVS though. – Heisenb0rg Aug 15 '11 at 13:30

A permanent solution, as pointed out in the comments, is to upgrade TikZ to version 3.0, either from their website or using your tex distribution's packet management tool.

If you can or do not wish to go that route, the simplest solution I found was this non-accepted answer to a related question (referenced in the answer above). The trick is to also include the decorations.text TikZ library, like so:

share|improve this answer
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – Christian Hupfer Jun 17 '14 at 12:29
Welcome to TeX.SX! After having spent a few time here, you will gain the sufficient reputation to vote up the questions you believe better. – Claudio Fiandrino Jun 17 '14 at 12:31
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – zeroth Jun 17 '14 at 12:33
This issue is resolved on TikZ version 3.00. So it doesn't need any workarounds. – percusse Jun 17 '14 at 13:04

Your Answer


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.