13

I am trying the callout code that Andrew has provided at How to open a temporary comics-like balloon in a beamer slide?, but I am getting an error:

Undefined control sequence. \pgf@sh@bg@ellipse callout ...pgf@sh@np@\pgf@test \noexpand \endcsname }\ede... l.20 \end{frame}

I am using TexLive-2011 on Mac OS X Lion (10.7.2).

Tamer
  • 131

3 Answers3

13

This is a known bug with PGF/TikZ 2.1 (see http://groups.google.com/group/comp.text.tex/browse_thread/thread/b41b47158ac5d221/b7428bd8ca1084ae?pli=1)

Save the following patch as pgflibraryshapes.callouts.code.tex.diff and apply it to the file pgflibraryshapes.callouts.code.tex (you might want to create a backup first), e.g. by

patch -i pgflibraryshapes.callouts.code.tex.diff ${TEXMF}/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex

(where ${TEXMF} is the path to your local TEXMF directory)

@@ -247,9 +247,9 @@
            \pgf@lib@callouts@shortenpointer%
            \pgf@lib@ellipsecallout@getpoints%  
            \calloutpointeranchor%  
-           \ifx\pgf@test\pgfutil@empty%
+           \ifx\pgf@node@name\pgfutil@empty%
            \else%
-               \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@test\noexpand\endcsname}%
+               \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@node@name\noexpand\endcsname}%
                \edef\pgf@sh@@@temp{%
                    \noexpand\def\noexpand\calloutpointeranchor{%
                        \noexpand\pgf@x\the\pgf@x%
@@ -568,15 +568,15 @@
            \pgfmathsetlengthmacro\pointerwidth{\pgfkeysvalueof{/pgf/callout pointer width}}%
            \pgf@lib@rectanglecallout@pointer%
            %
-           % \pgf@test = the shape name (from \pgfmultipartnode)
+           % \pgf@node@name = the shape name (from \pgfmultipartnode)
            %
-           \ifx\pgf@test\pgfutil@empty%
+           \ifx\pgf@node@name\pgfutil@empty%
            \else%
                %
                % 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}%
+               \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@node@name\noexpand\endcsname}%
                \edef\pgf@sh@@@temp{%
                    \noexpand\def\noexpand\calloutpointeranchor{%
                        \noexpand\pgf@x\the\pgf@x%
@@ -862,9 +862,9 @@
            \pgfextract@process\calloutpointer{%
                \pgfpointanchor{pgf@lib@callout@pointer}{center}%
            }%
-           \ifx\pgf@test\pgfutil@empty%
+           \ifx\pgf@node@name\pgfutil@empty%
            \else%
-               \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@test\noexpand\endcsname}%
+               \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@node@name\noexpand\endcsname}%
                \edef\pgf@sh@@@temp{%
                    \noexpand\def\noexpand\calloutpointeranchor{%
                        \noexpand\pgf@x\the\pgf@x%
Daniel
  • 37,517
  • The suggested patch fails with the following error: (Patch is indented 4 spaces.) patching file pgflibraryshapes.callouts.code.tex Hunk #1 FAILED at 247. Hunk #2 FAILED at 568. Hunk #3 FAILED at 862. 3 out of 3 hunks FAILED -- saving rejects to file pgflibraryshapes.callouts.code.tex.rej

    Any idea why?

    – 01es Apr 11 '12 at 17:06
  • +1 Applying the patch by manually modifying the file worked. Thanx for the patch. – 01es Apr 11 '12 at 17:28
  • @01es: The indentation of the patch was indeed the culprit: The the @@ lines must start with column 1. All others: I have edited the patch so that a simple Copy&Paste should now work. – Daniel Apr 11 '12 at 18:10
9

http://old.nabble.com/callout-absolute-pointer---desired-effect-but-compile-error-td30937456.html gives a much less intrusive solution:
Make sure you have the following in the preamble:

\usetikzlibrary{shapes.callouts}
\usetikzlibrary{decorations.text}

The second library is the non-intuitive part; it defines the missing \pgf@test.

Indeed worked for me with pgf 2.10-1 (ubuntu 12.04).

anps
  • 115
  • in addition to user7725's post, in my case the decoration.text solution worked, while the patching produced wrong output (callout pointing to (0,0) in place of the specified point) – Davide Dec 10 '12 at 18:42
  • This works for me. – hengxin Nov 23 '13 at 14:06
3

There is a similar question TikZ “callout” positioning problem. I find other solution from internet, we can replace all \pgf@test by \pgf@node@name in pgflibraryshapes.callouts.code.tex.

Pig Cry
  • 479