漏洞搜寻

漏洞搜寻

我对“tikz-timing”包的“advnodes”库有疑问。下面的示例代码生成以下错误消息并指向 advnodes 库的“.sty”文件:

Package: tikz-timing-advnodes 2011/01/09 v0.7d TikZ-Timing Library for advanced nodes
! Undefined control sequence.
<argument> ...ter {\csname pgf@anchor@\shape@name
                   @center\endcsname }\nodepa...
l.188 }

示例代码:

\documentclass{article}

\usepackage{tikz-timing}
\usetikztiminglibrary{advnodes}

\begin{document}
    \section{First Section}
    Some text.
\end{document}

重新安装 Tikz-Timing-Package 也没有用。尽管有此消息,但文档还是被创建了。但如果能生成一个没有此错误消息的文档就太好了。有人知道这个问题的原因和解决方案吗?

非常感谢你的帮助。

答案1

漏洞搜寻

这是我在编译时遇到的错误:

(/usr/local/texlive/2014/texmf-dist/tex/latex/tikz-timing/tikz-timing-advnodes.
sty
! Undefined control sequence.
<argument> ...ter {\csname pgf@anchor@\shape@name 
                                                  @center\endcsname }\nodepa...
l.188 }

好的。所以这告诉我们问题可能出在文件中/usr/local/texlive/2014/texmf-dist/tex/latex/tikz-timing/tikz-timing-advnodes.sty。它还告诉我们未定义的东西是行末的东西

<argument> ...ter {\csname pgf@anchor@\shape@name 

\csname表示控制序列,即很可能以反斜杠开头的序列。因此,我们可能希望将其\pgf@anchor@\shape@name表示为\csname pgf@anchor@\shape@name

现在\pgf@anchor@\shape@name“看起来不对劲”。 后面的内容中间有一个反斜杠\csname。 这看起来很奇怪。

但即使它看起来并不奇怪——或者即使它看起来很奇怪,但这并不比其他部分更奇怪——那并不重要。你仍然知道问题可能出在控制序列上。所以你仍然在寻找pgf@anchor@\shape@name

我刚刚在相关文件中搜索了此内容。不过,您也可以使用错误最后一行中的信息

l.188 }

这说明 TeX 意识到第 188 行有问题。然而,这在这里用处不大,因为该行是一个长定义的结尾,而它最终意味着该长定义中某处有问题。相比之下,搜索pgf@anchor@\shape@name不仅可以找到该定义中存在问题的确切位,还可以找到相同有问题的控制序列的另外 2 个出现位置。

错误

问题是由于使用 引起的\pgfanchor@\shape@name。我是猜测应该是\pgfanchor@shape@name。相应地更改库文件允许 MWE 进行编译。但是,我不使用这个库,因此没有测试这是否会破坏库本身。(另一方面,如果它使用未定义的控制序列,它很可能已经损坏了。)

碾碎

这是我的库的混乱版本:

%% MANGLED by cfr! Do not blame the author of tikz-timing-advnodes.sty!
%%
%% Copyright for original file:
%%
%% Copyright (C) 2009-2011 by Martin Scharrer <[email protected]>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008/05/04 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Martin Scharrer.
%%
%% This work consists of the files tikz-timing.dtx, tikz-timing.ins
%% and the derived file tikz-timing.sty.
%%
\RequirePackage{svn-prov}[2009/05/03]
\ProvidesPackageSVN[tikz-timing-advnodes-cfr]
  {$Id: tikz-timing.dtx 2038 2011-01-09 20:44:26Z martin $}
  [v0.7d MANGLED by cfr!
   TikZ-Timing Library for
   advanced nodes]
\GetFileInfoSVN*%
\RequirePackage{tikz-timing}[\filedate]%
\DefineFileInfoSVN

\RequirePackage{tikz-timing}

\let\tikztiming@orig@oldnodecenter\tikztiming@oldnodecenter

\tikzset{timing/nodes/.cd,
  simple/.code={%
    \let\tikztiming@oldnodecenter\tikztiming@orig@oldnodecenter
    \tikzset{%
      timing/inline node/.style={shape=coordinate},
    }%
  },
  advanced/.code={%
    \let\tikztiming@oldnodecenter\@gobble
    \tikzset{%
      timing/inline node/.style={shape=tikztiming coordinate},
      timing/nodes/new center,
    }%
  },
  old center/.code={%
    \let\tikztiming@nodecenteranchor\tikztiming@old@nodecenteranchor
  },%
  new center/.code={%
    \let\tikztiming@nodecenteranchor\empty
  },%
}
\tikzset{timing/nodes/.cd,advanced,new center}

\def\anchoralias#1#2{%
  \expandafter\def
  \csname pgf@anchor@shape@name @#1\expandafter\endcsname
  \expandafter{\csname pgf@anchor@shape@name @#2\endcsname}%
}

\def\tikztiming@anchorpoint#1#2#3{%
  \pgf@xa=#2\relax
  \pgf@ya=#3\relax
  \expandafter\edef\csname#1\endcsname{%
    \pgf@x=\the\pgf@xa\relax
    \pgf@y=\the\pgf@ya\relax
  }%
  \expandafter\addtosavedmacro\csname#1\endcsname
}
\def\tikztiming@tryanchor#1#2{%
  \let\tikztiming@next\relax
  \ifnum\tikztiming@debug>2
    \message{^^J Try Anchor: '#1' '#2' ^^J }%
    \def\tikztiming@next{\message{^^J TERM ^^J}}%
  \fi
  \ifx\relax#1\empty\else
  \ifx\relax#2\empty\else
    \def\tikztiming@next{%
      \@ifundefined{tikztiming@anchors@#1@#2}%
        {%
          \edef\@tempa{%
            {\csname tikztiming@alias@#1\endcsname}%
            {\csname tikztiming@alias@#2\endcsname}%
          }%
          \expandafter\tikztiming@tryanchor@\@tempa{#1}{#2}%
        }%
        {\let\tikztiming@tryanchor\@gobbletwo
         \ifnum\tikztiming@debug>2
           \message{^^J Anchor: '#1' '#2' ^^J }%
         \fi
         \@nameuse{tikztiming@anchors@#1@#2}%
        }%
    }%
  \fi\fi
  \tikztiming@next
}
\def\tikztiming@tryanchor@#1#2#3#4{%
  \tikztiming@tryanchor{#3}{#2}%
  \tikztiming@tryanchor{#1}{#4}%
  \tikztiming@tryanchor{#1}{#2}%
  \let\tikztiming@tryanchor@\@gobblefour
  \tikztiming@tryanchor{#3}{}%
  \tikztiming@tryanchor{}{#4}%
}
\pgfdeclareshape{tikztiming coordinate}{%
  \savedmacro\anchorpoints{%
    \let\anchorpoint\tikztiming@anchorpoint
    \let\slope\@tempdima
    \let\dslope\@tempdimb
    \let\zslope\@tempdimc
    \let\height\pgf@yb
    \let\fromchar\tikztiming@node@fromchar
    \let\tochar\tikztiming@node@tochar
    %
    \ifnum\tikztiming@debug>2
      \message{^^J Node: \fromchar \tochar ^^J}%
    \fi
    %
    \edef\@tempa{{timing/\tochar}}%
    \expandafter\lowercase\expandafter
      {\expandafter\tikzset\@tempa}%
    \pgfpointxy{\timingslope}{0}%
    \slope=\pgf@x\relax
    \pgfpointxy{\timingdslope}{0}%
    \dslope=\pgf@x\relax
    \pgfpointxy{\timingzslope}{0}%
    \zslope=\pgf@x\relax
    \pgfpointxy{0}{\timingheight}%
    \height=\pgf@y\relax
    \edef\anchorpoints{%
      \noexpand\pgf@yb=\the\height\relax
      \let\noexpand\height\noexpand\pgf@yb
    }%
    %
    \tikztiming@tryanchor{\fromchar}{\tochar}%
  }
  \savedanchor\lowpoint{%
    \pgfpointanchor{timing/start base}{center}%
    \pgf@x=0pt
  }%
  \anchor{origin}{%
    \pgfpointorigin
    \anchorpoints
    \@nameuse{originoffset}
    \pgf@x=-\pgf@x
    \pgf@y=-\pgf@y
  }%
  \anchor{old center}{%
    \pgfpointorigin
    \tikztiming@old@nodecenteranchor
  }%
  \anchor{new center}{\pgfpointorigin}%
  \anchor{center}{%
    \pgfpointorigin
    \tikztiming@nodecenteranchor
  }%
  \anchor{MID}{\tikztiming@useanchor{HIGH}\advance\pgf@y by -.5\height\relax }%
  \anchor{LOW}{\tikztiming@useanchor{HIGH}\advance\pgf@y by -\height\relax   }%
  \anchor{HIGH}{\tikztiming@useanchor{HIGH}}%
  \anchor{TOP}{%
    \tikztiming@nodes@getoffset
    \tikztiming@useanchor{HIGH}
    \advance\pgf@y by  \pgf@ya\relax
  }%
  \anchor{BOTTOM}{%
    \tikztiming@nodes@getoffset
    \tikztiming@useanchor{HIGH}
    \advance\pgf@y by -\pgf@ya\relax
    \advance\pgf@y by -\height\relax
  }%
  \anchor{mid}{\tikztiming@useanchor{mid}}%
  \anchor{low}{\tikztiming@useanchor{low}}%
  \anchor{high}{\tikztiming@useanchor{high}}%
  \anchor{low2}{\tikztiming@useanchor{low2}}%
  \anchor{high2}{\tikztiming@useanchor{high2}}%
  %
  \expandafter\anchorborder\expandafter{\csname pgf@anchor@shape@name @center\endcsname}%
  %
  \nodeparts{}%
}

\def\tikztiming@nodes@getoffset{%
  \begingroup
    \pgfpointxy{0}{1}%
    \pgfmathsetresultunitscale{\pgf@y}%
    \pgfpoint{0}{\tikztiming@nodes@offset}%
    \global\pgf@ya=\pgf@y
  \endgroup
}

\tikzset{%
  timing/nodes/.cd,
  offset/.store in=\tikztiming@nodes@offset,
  offset=0.25,
}

\def\tikztiming@nodecenteranchor{}

\def\tikztiming@old@nodecenteranchor{%
    \anchorpoints
    \@ifundefined{oldcenter}%
      {\@nameuse{originoffset}%
       \pgf@x=-\pgf@x\relax
       \pgf@y=-\pgf@y\relax
      }%
      {\@nameuse{oldcenter}}%
}

\def\tikztiming@useanchor#1{%
  \anchorpoints
  \@ifundefined{#1}%
   {\PackageError{tikz-timing}%
      {No such anchor '#1' defined for this transition!}{}%
    \pgfpointorigin
   }%
   {\@nameuse{#1}}%
}

\tikzset{%
  every tikztiming coordinate node/.style={anchor=origin},
}
\def\tikztiming@anchors#1#2{%
  \@namedef{tikztiming@anchors@#1@#2}%
}
\def\tikztiming@anchorslet#1#2#3#4{%
  \expandafter\let
  \csname tikztiming@anchors@#1@#2\expandafter\endcsname
  \csname tikztiming@anchors@#3@#4\endcsname
}

\tikztiming@anchors{@}{D}{%
  \anchorpoint{originoffset}{0pt}{.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{0pt}{.5\height}%
  \anchorpoint{low}{0pt}{-.5\height}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}

\tikztiming@anchors{@}{H}{%
  \anchorpoint{originoffset}{0pt}{\height}%
  \anchorpoint{high}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{0pt}%
}

\tikztiming@anchors{@}{L}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{low}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{\height}%
}

\tikztiming@anchors{@}{T}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{low}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{\height}%
}

\tikztiming@anchors{@}{Z}{%
  \anchorpoint{originoffset}{0pt}{.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}

\tikztiming@anchors{D}{D}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
  \anchorpoint{high}{0pt}{.5\height}%
  \anchorpoint{low}{0pt}{-.5\height}%
}

\tikztiming@anchors{L}{H}{%
  \anchorpoint{originoffset}{.5\slope}{.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{.5\slope}{.5\height}%
  \anchorpoint{low}{-.5\slope}{-.5\height}%
  \anchorpoint{HIGH}{-.5\slope}{.5\height}%
}

\tikztiming@anchors{E}{H}{%
  \anchorpoint{originoffset}{-.5\slope}{-.5\height}%
  \anchorpoint{oldcenter}{-.5\slope}{-.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{.5\slope}{.5\height}%
  \anchorpoint{low}{-.5\slope}{-.5\height}%
  \anchorpoint{HIGH}{-.5\slope}{.5\height}%
}

\tikztiming@anchors{T}{T}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{-.5\slope}{.5\height}%
  \ifnum 1=\c@tikztimingtrans
    \anchorpoint{originoffset}{.5\slope}{-.5\height}%
    \anchorpoint{high}{-.5\slope}{.5\height}%
    \anchorpoint{low}{.5\slope}{-.5\height}%
  \else
    \anchorpoint{originoffset}{.5\slope}{.5\height}%
    \anchorpoint{high}{.5\slope}{.5\height}%
    \anchorpoint{low}{-.5\slope}{-.5\height}%
  \fi
}
\tikztiming@anchorslet{T}{E}{T}{T}%

\tikztiming@anchors{T}{@}{%
  \ifnum 1=\c@tikztimingtrans
    \anchorpoint{high}{0pt}{0pt}%
    \anchorpoint{HIGH}{0pt}{0pt}%
  \else
    \anchorpoint{low}{0pt}{0pt}%
    \anchorpoint{HIGH}{0pt}{\height}%
  \fi
}

\tikztiming@anchors{H}{H}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{high}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{0pt}%
}

\tikztiming@anchors{L}{L}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{low}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{\height}%
}

\tikztiming@anchors{Z}{Z}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}

\tikztiming@anchors{E}{E}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \ifnum 1=\c@tikztimingtrans
    \anchorpoint{originoffset}{.5\slope}{.5\height}%
    \anchorpoint{HIGH}{-.5\slope}{.5\height}%
    \anchorpoint{high}{.5\slope}{.5\height}%
    \anchorpoint{low}{-.5\slope}{-.5\height}%
  \else
    \anchorpoint{originoffset}{-.5\slope}{.5\height}%
    \anchorpoint{oldcenter}{-.5\slope}{-.5\height}%
    \anchorpoint{HIGH}{-.5\slope}{.5\height}%
    \anchorpoint{high}{-.5\slope}{.5\height}%
    \anchorpoint{low}{.5\slope}{-.5\height}%
  \fi
}

\tikztiming@anchors{H}{L}{%
  \anchorpoint{originoffset}{.5\slope}{-.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{-.5\slope}{.5\height}%
  \anchorpoint{HIGH}{-.5\slope}{.5\height}%
  \anchorpoint{low}{.5\slope}{-.5\height}%
}
\tikztiming@anchorslet{H}{E}{H}{L}%

\tikztiming@anchors{E}{L}{%
  \anchorpoint{originoffset}{-.5\slope}{.5\height}%
  \anchorpoint{oldcenter}{-.5\slope}{-.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{-.5\slope}{.5\height}%
  \anchorpoint{HIGH}{-.5\slope}{.5\height}%
  \anchorpoint{low}{.5\slope}{-.5\height}%
}

\tikztiming@anchors{E}{T}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{-.5\slope}{.5\height}%
  \ifnum 1=\c@tikztimingtrans
    \anchorpoint{originoffset}{-.5\slope}{-.5\height}%
    \anchorpoint{oldcenter}{-.5\slope}{-.5\height}%
    \anchorpoint{high}{.5\slope}{.5\height}%
    \anchorpoint{low}{-.5\slope}{-.5\height}%
  \else
    \anchorpoint{originoffset}{-.5\slope}{.5\height}%
    \anchorpoint{oldcenter}{-.5\slope}{-.5\height}%
    \anchorpoint{high}{-.5\slope}{.5\height}%
    \anchorpoint{low}{.5\slope}{-.5\height}%
  \fi
}

\tikztiming@anchors{E}{Z}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{oldcenter}{-\zslope}{-.5\height}%
  \anchorpoint{HIGH}{-\zslope}{.5\height}%
  \anchorpoint{high}{-\zslope}{.5\height}%
  \anchorpoint{low}{-\zslope}{-.5\height}%
}

\tikztiming@anchors{Z}{D}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
  \anchorpoint{high}{.5\dslope}{.5\height}%
  \anchorpoint{low}{.5\dslope}{-.5\height}%
}

\tikztiming@anchors{D}{Z}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{oldcenter}{-.5\dslope}{-.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{-.5\dslope}{.5\height}%
  \anchorpoint{high}{-.5\dslope}{.5\height}%
  \anchorpoint{low}{-.5\dslope}{-.5\height}%
}

\tikztiming@anchors{D}{H}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{oldcenter}{-.5\dslope}{-.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{-.5\dslope}{.5\height}%
  \anchorpoint{high}{.5\dslope}{.5\height}%
  \anchorpoint{high2}{-.5\dslope}{.5\height}%
  \anchorpoint{low}{-.5\dslope}{-.5\height}%
}

\tikztiming@anchors{D}{L}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{oldcenter}{-.5\dslope}{-.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{-.5\dslope}{.5\height}%
  \anchorpoint{high}{-.5\dslope}{.5\height}%
  \anchorpoint{low2}{-.5\dslope}{-.5\height}%
  \anchorpoint{low}{.5\dslope}{-.5\height}%
}
\tikztiming@anchorslet{D}{T}{D}{L}%

\tikztiming@anchors{D@edge@}{D}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{oldcenter}{-.5\dslope}{-.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{-.5\dslope}{.5\height}%
  \anchorpoint{high}{-.5\dslope}{.5\height}%
  \anchorpoint{high2}{.5\dslope}{.5\height}%
  \anchorpoint{low}{-.5\dslope}{-.5\height}%
  \anchorpoint{low2}{.5\dslope}{-.5\height}%
}
\tikztiming@anchorslet{D}{U}{D@edge@}{D}
\tikztiming@anchorslet{U}{D}{D@edge@}{D}
\tikztiming@anchorslet{D}{D@edge@}{D@edge@}{D}
\tikztiming@anchorslet{D@edge@}{D@edge@}{D@edge@}{D}
\tikztiming@anchorslet{D}{E}{D@edge@}{D}
\tikztiming@anchorslet{E}{D}{D@edge@}{D}

\tikztiming@anchorslet{L}{E}{L}{H}%
\tikztiming@anchorslet{L}{T}{L}{H}%
\tikztiming@anchorslet{H}{T}{H}{L}%
\tikztiming@anchorslet{T}{H}{H}{L}%

\tikztiming@anchors{D}{D}{%
  \anchorpoint{originoffset}{0pt}{0pt}%
  \anchorpoint{oldcenter}{0pt}{-.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{0pt}{.5\height}%
  \anchorpoint{low}{0pt}{-.5\height}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}
\tikztiming@anchorslet{D}{@}{D}{D}
\tikztiming@anchorslet{E}{@}{D}{D}
\tikztiming@anchorslet{U}{U}{D}{D}

\tikztiming@anchorslet{@}{E}{@}{D}

\tikztiming@anchors{L}{D}{%
  \anchorpoint{originoffset}{.5\dslope}{.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{.5\dslope}{.5\height}%
  \anchorpoint{low}{-.5\dslope}{-.5\height}%
  \anchorpoint{low2}{.5\dslope}{-.5\height}%
  \anchorpoint{HIGH}{-.5\dslope}{.5\height}%
}

\tikztiming@anchors{T}{D}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{-.5\dslope}{.5\height}%
  \ifnum 1=\c@tikztimingtrans
    \anchorpoint{originoffset}{.5\dslope}{-.5\height}%
    \anchorpoint{high}{-.5\dslope}{.5\height}%
    \anchorpoint{high2}{.5\dslope}{.5\height}%
    \anchorpoint{low}{.5\dslope}{-.5\height}%
  \else
    \anchorpoint{originoffset}{.5\dslope}{.5\height}%
    \anchorpoint{high}{.5\dslope}{.5\height}%
    \anchorpoint{low}{-.5\dslope}{-.5\height}%
    \anchorpoint{low2}{.5\dslope}{-.5\height}%
  \fi
}

\tikztiming@anchors{H}{D}{%
  \anchorpoint{originoffset}{.5\dslope}{-.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{-.5\dslope}{.5\height}%
  \anchorpoint{high}{-.5\dslope}{.5\height}%
  \anchorpoint{high2}{.5\dslope}{.5\height}%
  \anchorpoint{low}{.5\dslope}{-.5\height}%
}

\tikztiming@anchors{Z}{E}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{\zslope}{.5\height}%
  \anchorpoint{low}{\zslope}{-.5\height}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}

\tikztiming@anchors{Z}{H}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{\zslope}{.5\height}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}

\tikztiming@anchors{Z}{T}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
  \ifnum1=\c@tikztimingtrans\relax
    \anchorpoint{low}{\zslope}{-.5\height}%
  \else
    \anchorpoint{high}{\zslope}{.5\height}%
  \fi
}

\tikztiming@anchors{T}{H}{%
  \ifnum1=\c@tikztimingtrans\relax
    \anchorpoint{high}{0pt}{0pt}%
    \anchorpoint{HIGH}{0pt}{0pt}%
  \else
    \anchorpoint{originoffset}{.5\slope}{.5\height}%
    \anchorpoint{low}{-.5\slope}{-.5\height}%
    \anchorpoint{mid}{0pt}{0pt}%
    \anchorpoint{high}{.5\slope}{.5\height}%
    \anchorpoint{HIGH}{-.5\slope}{.5\height}%
  \fi
}

\tikztiming@anchors{T}{L}{%
  \ifnum1=\c@tikztimingtrans\relax
    \anchorpoint{originoffset}{.5\slope}{-.5\height}%
    \anchorpoint{low}{.5\slope}{-.5\height}%
    \anchorpoint{mid}{0pt}{0pt}%
    \anchorpoint{high}{-.5\slope}{.5\height}%
    \anchorpoint{HIGH}{-.5\slope}{.5\height}%
  \else
    \anchorpoint{low}{0pt}{0pt}%
    \anchorpoint{HIGH}{0pt}{\height}%
  \fi
}

\tikztiming@anchors{T}{Z}{%
  \ifnum1=\c@tikztimingtrans\relax
    \anchorpoint{high}{0pt}{0pt}%
    \anchorpoint{mid}{\zslope}{-.5\height}%
    \anchorpoint{HIGH}{0pt}{0pt}%
  \else
    \anchorpoint{low}{0pt}{0pt}%
    \anchorpoint{mid}{\zslope}{.5\height}%
    \anchorpoint{HIGH}{0pt}{\height}%
  \fi
}

\tikztiming@anchors{Z}{L}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{low}{\zslope}{-.5\height}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}

\tikztiming@anchors{H}{Z}{%
  \anchorpoint{high}{0pt}{0pt}%
  \anchorpoint{mid}{\zslope}{-.5\height}%
  \anchorpoint{HIGH}{0pt}{0pt}%
}

\tikztiming@anchors{L}{Z}{%
  \anchorpoint{low}{0pt}{0pt}%
  \anchorpoint{mid}{\zslope}{.5\height}%
  \anchorpoint{HIGH}{0pt}{\height}%
}

\tikztiming@anchors{Z}{Z}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}

\tikztiming@anchors{H}{@}{%
  \anchorpoint{high}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{0pt}%
}

\tikztiming@anchors{L}{@}{%
  \anchorpoint{low}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{\height}%
}

\tikztiming@anchors{Z}{@}{%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}

\tikztiming@anchors{}{@}{%
  \anchorpoint{originoffset}{0pt}{.5\height}%
  \anchorpoint{mid}{0pt}{0pt}%
  \anchorpoint{high}{0pt}{.5\height}%
  \anchorpoint{low}{0pt}{-.5\height}%
  \anchorpoint{HIGH}{0pt}{.5\height}%
}

\RequirePackage{pgfopts}
\ProcessPgfOptions{/tikz/timing/node}
\endinput
%%
%% End of file `tikz-timing-advnodes-cfr.sty'.

然后,改编后的 MWE 可以毫无问题地进行编译:

\documentclass{article}

\usepackage{tikz-timing}
\usetikztiminglibrary{advnodes-cfr}

\begin{document}
    \section{First Section}
    Some text.
\end{document}

答案2

正如所提到的成本加运费,问题是 \shape@name 没有定义,正如提到的维尔施莱伯这与 TikZ 中的更新有关。我发现另一个答案 “在较新版本的 PGF 中,\shape@name 现在是 \pgf@sm@shape@name”。事实上,在我的系统(Fedora 25,TikZ 版本 1.151 2015/08/07)中,我可以通过将所有出现的 \shape@name 替换为 \pgf@sm@shape@name 来使用 tikz-timing-advnodes.sty。这是我的差异:

--- /usr/share/texlive/texmf-dist/tex/latex/tikz-timing/tikz-timing-advnodes.sty2011-01-11 00:37:47.000000000 +0000
+++ tikz-timing-advnodes.sty    2017-06-02 07:56:07.510477641 +0000
@@ -62,8 +62,8 @@

 \def\anchoralias#1#2{%
   \expandafter\def
-  \csname pgf@anchor@\shape@name @#1\expandafter\endcsname
-  \expandafter{\csname pgf@anchor@\shape@name @#2\endcsname}%
+  \csname pgf@anchor@\pgf@sm@shape@name @#1\expandafter\endcsname
+  \expandafter{\csname pgf@anchor@\pgf@sm@shape@name @#2\endcsname}%
 }

 \def\tikztiming@anchorpoint#1#2#3{%
@@ -182,7 +182,7 @@
   \anchor{low2}{\tikztiming@useanchor{low2}}%
   \anchor{high2}{\tikztiming@useanchor{high2}}%
   %
-  \expandafter\anchorborder\expandafter{\csname pgf@anchor@\shape@name @center\endcsname}%
+  \expandafter\anchorborder\expandafter{\csname pgf@anchor@\pgf@sm@shape@name @center\endcsname}%
   %
   \nodeparts{}%
 }

答案3

上述答案提供了一种解决方法,但不幸的是,并不是完整的解决方案。语法错误消失了,但一些功能仍然被破坏,正如发帖人已经怀疑的那样。我实际上使用了“高级节点”。前段时间,我可以使用这样的 tikz-timing 节点作为箭头的端点。现在,这不再起作用了;我必须改用 (myNode.center)。

当我将 TikZ 基础包从版本 base-2-10.zip 升级到 base-3-0-0.zip 时,问题就开始出现了。

我还将当前的 tikz-timing-7d.zip 与之前的 tikz-timing-2010-01-17.zip 进行了比较。有很多变化,但上面讨论的地方都没有变化。所以这不是 tikz-timing 包本身的问题。当前版本适用于旧的 TikZ 基础包。

结论:TikZ 基础包的更新破坏了 tikz-timing 包。它们不再兼容。

相关内容