我正在尝试 Andrew 提供的标注代码如何在投影仪幻灯片中打开临时的漫画状气球?,但我收到一个错误:
Undefined control sequence. \pgf@sh@bg@ellipse callout ...pgf@sh@np@\pgf@test \noexpand \endcsname }\ede... l.20 \end{frame}
我在 Mac OS X Lion(10.7.2)上使用 TexLive-2011。
答案1
这是 PGF/TikZ 2.1 的一个已知错误(请参阅http://groups.google.com/group/comp.text.tex/browse_thread/thread/b41b47158ac5d221/b7428bd8ca1084ae?pli=1)
将以下补丁另存为pgflibraryshapes.callouts.code.tex.diff
并将其应用于文件pgflibraryshapes.callouts.code.tex
(您可能需要先创建备份),例如
patch -i pgflibraryshapes.callouts.code.tex.diff ${TEXMF}/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex
(其中${TEXMF}
是您的本地目录的路径TEXMF
)
@@ -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%
答案2
http://old.nabble.com/callout-absolute-pointer---desired-effect-but-compile-error-td30937456.html给出了一个干扰更少的解决方案:
确保在序言中包含以下内容:
\usetikzlibrary{shapes.callouts}
\usetikzlibrary{decorations.text}
第二个库是非直观的部分;它定义了缺失的\pgf@test
。
确实,pgf 2.10-1(ubuntu 12.04)对我有用。
答案3
有一个类似的问题TikZ「callout」定位问题。我从互联网上找到了其他解决方案,我们可以用 替换\pgf@test
所有\pgf@node@name
内容pgflibraryshapes.callouts.code.tex
。