diff options
author | Karl Berry <karl@freefriends.org> | 2009-12-11 01:03:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-12-11 01:03:36 +0000 |
commit | dc9526cb9ac65af66d74d5b44c78647df15e5b13 (patch) | |
tree | ebcff6b7777c4f463e59ea5dc1ec7481f202cf92 /Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty | |
parent | 74b4962e535420c873e7047cf77c79a8277743f1 (diff) |
tikz-timing 0.7 (9dec09)
git-svn-id: svn://tug.org/texlive/trunk@16348 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty | 2060 |
1 files changed, 1416 insertions, 644 deletions
diff --git a/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty b/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty index 1328131562c..d2ff15dc603 100644 --- a/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty +++ b/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty @@ -27,8 +27,8 @@ %% \RequirePackage{svn-prov}[2009/05/03] \ProvidesPackageSVN - {$Id: tikz-timing.dtx 1158 2009-07-28 09:14:00Z martin $} - [v0.6a + {$Id: tikz-timing.dtx 1580 2009-12-09 11:14:01Z martin $} + [v0.7 Digital Timing Diagrams using TikZ] \DefineFileInfoSVN[tikztiming] @@ -42,89 +42,148 @@ {\RequirePackage{environ}} {\RequirePackage{amsmath}} \fi - -\newcommand*\usetikztiminglibrary[2][]{% - \edef\tikztiming@library@options{#1}% - \@ifnextchar{[}%] - {\tikztiming@library{#2}}% - {\tikztiming@library{#2}[]}% -} -\def\tikztiming@library#1[#2]{% - \edef\tikztiming@library@date{#2}% - \tikztiming@library@#1,\relax -} - -\def\tikztiming@library@#1,{% - \IfFileExists{tikz-timing-#1.sty}% - {\RequirePackage[\tikztiming@library@options]{tikz-timing-#1}% - [\tikztiming@library@date]}% - {\PackageError{tikz-timing}% - {No tikz-timing library `#1' found!}% - {}{}{}{}% - }% - \@ifnextchar\relax{}{\tikztiming@library@}% -} - \def\tikztimingwidth{0.0} \newcount\tikztiming@numint \newcount\tikztiming@numfrac -\def\tikztiming@num{1.0}% +\def\tikztiming@wscale{1.0}% +\def\tikztimingsetwscale#1{% + \pgfmathparse{#1}% + \let\tikztiming@wscale\pgfmathresult +} +\def\tikztiming@num{0.0}% \let\tikztiming@back\empty \newlength\tikztiming@xunit \newlength\tikztiming@yunit +\setlength{\tikztiming@xunit}{1.6ex}% +\setlength{\tikztiming@yunit}{1.6ex}% + +\def\tikztiming@setnum#1{% + \pgfmathparse{#1}% + \global\let\tikztiming@num\pgfmathresult +} + +\newcount\tikztiming@debug + +\def\tikztiming@xsep{0pt} +\def\tikztiming@ysep{0pt} \newcounter{tikztiming@nrows}% \def\tikztiming@rowdist{2}% \def\tikztiming@coldist{1}% -\def\tikztiminglabel#1{#1}% -\def\tikztiming@prefix{tikztiming@trans@} +\def\tikztiming@prefix{tikztiming@trans@}% +\def\tikztiming@ttt#1#2#3{#1#2#3}% +\def\tikztiming@pfxtr{% + \tikztiming@prefix\expandafter\tikztiming@ttt +} + +\def\timingwidth{1}% +\def\timingheight{1}% -\tikzset{timing/.style={% - x=1.6ex, y=1.6ex, +\tikzset{% + timing/.style={% line cap=round, line join=round, - /utils/exec={\setlength{\tikztiming@xunit}{1.6ex}\setlength{\tikztiming@yunit}{1.6ex}}, - }% + timing/adjust@xy + },% } \tikzset{% timing/.cd, + adjust@xy/.style={% + /utils/exec={% + \tikz@textfont + \setlength{\tikztiming@xunit}{1.6ex}% + \setlength{\tikztiming@yunit}{1.6ex}% + },% + /tikz/x=1.6ex, /tikz/y=1.6ex, + }, + font/.style={% + /tikz/font={#1}, + /tikz/timing/adjust@xy + },% initchar/.value required, - initchar/.code={\ifx\lastchar\empty\uppercase{\def\lastchar{#1}}\fi}, - metachar/.code 2 args={\tikztimingmetachar{#1}{#2}}, + initchar/.code={\uppercase{\gdef\tikztiming@lastchar{#1}}}, + metachar/.code={\tikztimingmetachar#1}, grid/.style={timing,help lines}, + @grid/.code={\texttiminggrid}, + draw grid/.style={% + timing/before text/.append style={timing/@grid},% + timing/before/.append style={timing/@grid}% + }, + no grid/.style={timing/@grid/.code={}}, + before/.code={}, + after/.code={}, + before text/.code={\texttimingbefore}, + after text/.code={\texttimingafter}, picture/.style={timing,line width=0.15ex}, intext/.style={timing,line width=0.15ex}, inline node/.style={shape=coordinate}, - table/.style={timing,line width=0.15ex,font=\sffamily}, + inline node/from char/.store in=\tikztiming@node@fromchar, + inline node/to char/.store in=\tikztiming@node@tochar, + table/.style={font=\sffamily,timing,line width=0.15ex}, + before table/.code={}, + after table/.code={}, coord/.style={coordinate}, - save/.style={coordinate,/utils/exec=\tikztiming@savesettings}, - restore/.style={/utils/exec=\tikztiming@restoresettings}, - name/.style={inner sep=0pt,outer sep=0pt}, + save/.style={coordinate}, + restore/.style={/utils/exec={\expandafter\tikzset\expandafter{\tikztiming@saved@options}}}, + option/.style={/utils/exec={\g@addto@macro\tikztiming@saved@options{#1,}},#1}, + nooptions/.style={/utils/exec={\gdef\tikztiming@saved@options{}}}, + name/.style={inner sep=0pt,outer sep=0pt,minimum size=0pt}, + text format/.store in=\tikztiming@textformat, + @/.style={}, + D/.style={timing/d}, + D/text/.style={timing/d/text}, + D/background/.style={timing/d/background}, + D@edge@/.style={timing/d@edge@}, + D@edge@/text/.style={timing/d@edge@/text}, + D@edge@/background/.style={timing/d@edge@/background}, + U/.style={timing/u}, + U/text/.style={timing/u/text}, + U/background/.style={timing/u/background}, + U@edge@/.style={timing/u@edge@}, + U@edge@/text/.style={timing/u@edge@/text}, + U@edge@/background/.style={timing/u@edge@/background}, + H/.style={timing/h}, + L/.style={timing/l}, + E/.style={timing/e}, + E/background/.style={timing/e/background}, + M/decoration/.style={timing/m/decoration}, + M/base/.style={timing/m/base}, + M/.style={timing/m}, + G/.style={timing/g}, + Z/.style={timing/z}, + T/.style={timing/t}, + C/.style={timing/c}, + X/.style={timing/x}, + d/.style={}, d/text/.style={timing,scale=0.6,font=\sffamily}, - d/background/.style={}, + d/background/.style={draw=none}, + d@edge@/.style={timing/d}, + d@edge@/text/.style={timing/d/text}, + d@edge@/background/.style={timing/d/background}, + u/.style={}, + u/background/.style={draw=none,fill=gray}, + u@edge@/.style={timing/u}, + u@edge@/text/.style={timing/u/text}, + u@edge@/background/.style={timing/u/background}, h/.style={}, l/.style={}, - d/.style={}, e/.style={}, - e/background/.style={}, - a/.style={->}, - w/.style={<-}, - m/.style={black!40!brown}, - m/decoration/.style={decorate,decoration={zigzag,segment - length=.25\tikztiming@xunit,amplitude=.225\tikztiming@yunit}}, - k/.style={black!40!blue,semitransparent}, - u/background/.style={fill=gray}, - u/.style={}, - o/background/.style={}, - o/.style={timing/d,line width=0.10ex,dotted}, - g/.style={}, + e/background/.style={draw=none}, + m/decoration/.style={decorate,% + decoration={zigzag,segment length=.25\tikztiming@xunit, + amplitude=.225\tikztiming@yunit}}, + m/base/.style={black!40!brown}, + m/.style={timing/m/base,timing/m/decoration}, + g/.style={decorate=false}, z/.style={blue}, t/.style={}, - c/.style={timing/slope=0.0}, + c/.style={timing/lslope=0.0}, x/.style={red}, table/grid/.style={timing/grid}, table/lines/.style={}, table/rules/.style={line width=0.08em,line cap=butt}, + table/midrules/.style={line width=0.05em,line cap=butt}, + table/header/.style={timing/name}, slope/.code={% \tikztimingsetslope{#1}% \tikztimingsetdslope{2*#1}% @@ -133,8 +192,25 @@ lslope/.code={\tikztimingsetslope{#1}}, dslope/.code={\tikztimingsetdslope{#1}}, zslope/.code={\tikztimingsetzslope{#1}}, + wscale/.code={\tikztimingsetwscale{#1}}, coldist/.store in=\tikztiming@coldist, rowdist/.store in=\tikztiming@rowdist, + outer xsep/.store in=\tikztiming@xsep, + outer ysep/.store in=\tikztiming@ysep, + outer sep/.style={/tikz/timing/outer xsep=#1,/tikz/timing/outer ysep=#1}, + % + debug/level/.code={\tikztiming@debug=#1\relax}, + debug/level/.value required, + debug/scope/.style={font=\sffamily\tiny,gray}, + debug/node/.style={above,inner sep=2pt}, + debug/nodes/.style={% + /tikz/timing/after table/.append code={\tikztiming@marknodes{\tikztiming@namednodes}}, + /tikz/timing/after text/.append code={\tikztiming@marknodes{\tikztiming@namednodes}} + }, + debug/markcmd/.store in={\tikztiming@markcmd}, +} +\tikzset{timing/inline node/.cd, + from char={}, to char={} } \def\texttimingbefore{} \def\texttimingafter{} @@ -144,179 +220,308 @@ } \DeclareRobustCommand*\texttiming[2][]{% \begingroup - \tikztiming@init + \let\tikztiming@lastchar\empty + \let\tikztiming@settings\empty + \tikzset{timing/before/.append style={timing/before text}}% + \tikzset{timing/after/.prefix style={timing/after text}}% \ifx\relax#1\relax\else \tikztiming@testoptarg#1\relax\relax% \fi - \def\@tempa{\begin{tikzpicture}[timing/intext,}%]}[ - \expandafter\@tempa\settings] - \@ifundefined{tikztiming@initcode@\lastchar}% - {}% - {\@nameuse{tikztiming@initcode@\lastchar}}% - \ifx\lastchar\empty\else - \@ifundefined{\tikztiming@prefix\lastchar @start}% - {\PackageWarning{tikz-timing}{Start value for timing character '\lastchar' - is not defined and will be ignored!}{}{}{}}% - {\tikztiming@nameaddtostr{\lastchar @start}{}}% - \fi - \tikztiming@#2\relax - %\message{^^J\meaning\tikztiming@str^^J}% - \path[use as bounding box] (0,0) rectangle - (\timingwidth*\tikztimingwidth,\timingheight);% - \texttimingbefore - \tikztiming@str;% - \node [shape=tikztiming@shape,anchor=origin,name=last texttiming] at (0,0) - {}; - \texttimingafter + \begin{tikzpicture}[timing/intext,baseline={(0,0)}] + \tikztiming@picinit + \def\@tempa{\expandafter\timing\expandafter[\tikztiming@settings] at (0,0)}% + \expandafter\@tempa\expandafter{\expandafter[\tikztiming@lastchar]#2};% \end{tikzpicture}% \endgroup } \def\tikztiming@testoptarg#1#2\relax{% \ifx\relax#2\relax - \uppercase{\def\lastchar{#1}}% + \uppercase{\def\tikztiming@lastchar{#1}}% \else - \def\settings{#1#2}% + \def\tikztiming@settings{#1#2}% \fi } +\def\tikztiming@picinit{% + \global\let\tikztiming@namednodes\empty +} +\let\tikztiming@namednodes\empty \def\tikztiming@init{% - \let\lastchar\empty% - \let\currentchar\empty - \let\settings\empty + \def\tikztiming@lastchar{@}% + \def\tikztiming@num{0}% + \let\tikztiming@currentchar\empty + \let\tikztiming@settings\empty + \let\tikztiming@fromchar\empty + \let\tikztiming@tochar\empty + \let\setwscale\tikztimingsetwscale + \def\wscale{\tikztiming@wscale}% + \let\xunit\tikztiming@xunit + \let\yunit\tikztiming@yunit + \def\slope{\timingslope}% + \def\lslope{\timingslope}% + \def\zslope{\timingzslope}% + \def\dslope{\timingdslope}% + \gdef\tikztiming@saved@settings{}% + \gdef\tikztiming@saved@options{}% + \gdef\tikztiming@oldnodecenter@{}% \def\tikztimingwidth{0.0}% \setcounter{tikztimingtrans}{-1}% \setcounter{tikztimingtranspos}{0}% - \def\tikztiming@str{\draw (0,0) coordinate (timing/start base) }% + \def\tikztiming@str{% + \useasboundingbox (0,0) rectangle (\tikztimingwidth,\timingheight); + \draw (0,0) + coordinate (timing@refa) + coordinate [shift={(0,\timingheight)}] (timing@refb) + coordinate [shift={(0,\timingheight/2)}] (timing@ref) + coordinate (timing/start) + coordinate (timing/start base) + }% } -\def\timing{% +\def\tikz@timing{% \@ifnextchar{[}% - {\timing@}% - {\timing@[]}% + {\tikz@timing@}% + {\tikz@timing@[]}% +} +\g@addto@macro\tikz@installcommands{% + \let\tikz@origtiming=\timing% + \let\timing=\tikz@timing% } -\def\timing@[#1]{% +\g@addto@macro\tikz@uninstallcommands{% + \let\timing=\tikz@origtiming% +} +\def\tikz@timing@[#1]{% \@ifnextchar{a}% - {\timing@at{#1}}% + {\tikz@timing@at{#1}}% {\PackageWarning{tikz-timing}{The \string\timing\space command awaits now an `at' before the coordinate, like the \string\node\space command is doing. Please update your source code to ensure compatibility with newer versions}{}{}{}% \@ifnextchar{+}% - {\timing@@{#1}}% + {\tikz@timing@@{#1}}% {\@ifnextchar(%) - {\timing@@{#1}}% - {\timing@@{#1}++(0,0)}% + {\tikz@timing@@{#1}}% + {\tikz@timing@@{#1}++(0,0)}% }% }% } -\def\timing@at#1at#2(#3){% - \timing@@@{#1}{#2(#3)}% +\def\tikz@timing@at#1at#2(#3){% + \tikz@timing@@@{#1}{#2(#3)}% } -\def\timing@@#1#2(#3){% - \timing@@@{#1}{#2(#3)}% +\def\tikz@timing@@#1#2(#3){% + \tikz@timing@@@{#1}{#2(#3)}% } -\def\timing@@@#1#2#3{% +\def\tikz@timing@@@#1#2#3{% \begingroup \tikztiming@init \let\tikz@alias=\pgfutil@empty% \begin{scope}[shift={#2},timing,#1]% \@ifnextchar{[}% - {\timing@@@init}% - {\timing@@@init[]}% + {\tikz@timing@@@init}% + {\tikz@timing@@@init[]}% #3\relax - %\message{^^J\meaning\tikztiming@str^^J}% + \ifnum\tikztiming@debug>1 + \message{^^J\meaning\tikztiming@str^^J}% + \ifnum\tikztiming@debug>2 + {% + \def\@protect##1{\def##1{\noexpand##1}}% + \@protect\useasboundingbox + \@protect\draw + \@protect\p + \@protect\n + \@protect\x + \@protect\y + \@protect\tikztiming@overlay@save + \edef\@tempa{\tikztiming@str}% + \message{^^J\meaning\@tempa^^J}% + }% + \fi + \fi + \tikzset{timing/before}% \tikztiming@str;% \node [shape=tikztiming@shape,anchor=origin,#1] at (0,0) {}; + \tikzset{timing/after}% \end{scope}% \endgroup - \timing@@@end + \tikz@timing@@@end } -\def\timing@@@end#1;{% - \ifx;#1;\else - \PackageError{tikz-package}{Can not parse timing path}{}{}{}% - \fi +\def\tikz@timing@@@end{% + \@ifnextchar{;}% + {\@gobble}% + {\PackageError{tikz-package}{Can not parse timing path}{}{}{}}% } -\def\timing@@@init[#1]{% +\def\tikz@timing@@@init[#1]{% + \begingroup \ifx\relax#1\relax\else - \uppercase{\def\lastchar{#1}}% + \uppercase{\def\tikztiming@lastchar{#1}}% \fi - \@ifundefined{tikztiming@initcode@\lastchar}% + \@ifundefined{tikztiming@initcode@\tikztiming@lastchar}% {}% - {\@nameuse{tikztiming@initcode@\lastchar}}% - \ifx\lastchar\empty\else - \@ifundefined{\tikztiming@prefix\lastchar @start}% - {\PackageWarning{tikz-timing}{Start value for timing character '\lastchar' - is not defined and will be ignored!}{}{}{}}% - {\tikztiming@nameaddtostr{\lastchar @start}{}}% + {\@nameuse{tikztiming@initcode@\tikztiming@lastchar}}% + \if @\tikztiming@lastchar\relax\else + \tikztiming@iftrans{@\tikztiming@lastchar}% + {\tikztiming@nameaddtostr{@}{\tikztiming@lastchar}{}}% + {\PackageWarning{tikz-timing}{Start value for timing character + '\tikztiming@lastchar' is not defined and will be ignored!}{}{}{}}% \fi - \tikztiming@ -} -\let\tikztiming@trans@\@gobble -\def\tikztiming@aftercode@T{% - \tikztiming@output@flush -} -\def\tikztiming@aftercode@t{% - \tikztiming@aftercode@T + \tikztiming@parser } -\def\tikztiming@aftercode@C{% - %\tikztiming@output@flush -} -\def\tikztiming@aftercode@c{% - \tikztiming@aftercode@C -} -\def\tikztiming@aftercode@G{% - \let\lastchar\secondlastchar - \let\tikztimingwidth\lasttikztimingwidth -} -\def\tikztiming@aftercode@g{% - \let\lastchar\secondlastchar - \let\tikztimingwidth\lasttikztimingwidth -} -\def\tikztiming@aftercode@S{% - \let\lastchar\secondlastchar -} -\def\tikztiming@aftercode@s{% - \let\lastchar\secondlastchar +\def\tikztiming@trans@#1#2#3#4{% + \csname\tikztiming@prefix #2#3#4\endcsname{#1}{#2}{#3}{#4}% } \def\tikztiming@beforenextcode@D@edge@{% - \if D\currentchar\else - \if d\currentchar\else - \def\lastchar{D}% - \fi + \if D\tikztiming@currentchar\else + \gdef\tikztiming@lastchar{D}% \fi } -\def\tikztiming@beforenextcode@d@edge@{% - \if D\currentchar\else - \if d\currentchar\else - \def\lastchar{D}% - \fi +\def\tikztiming@beforenextcode@U@edge@{% + \if U\tikztiming@currentchar\else + \gdef\tikztiming@lastchar{U}% \fi } +\def\tikztiming@initcode@{% + \gdef\tikztiming@lastchar{@}% +} \def\tikztiming@initcode@D{% - \def\lastchar{D@edge@}% + \gdef\tikztiming@lastchar{D@edge@}% } -\def\tikztiming@initcode@d{% - \def\lastchar{d@edge@}% +\def\tikztiming@initcode@U{% + \gdef\tikztiming@lastchar{U@edge@}% } -\def\tikztiming@{% - \@ifnextchar\bgroup - {\tikztiming@testfornum}% +\def\tikztiming@parser{% + \@ifnextchar\relax + {\tikztiming@parser@end}% {\tikztiming@testfornum}% } -\def\tikztiming@eaddtostr#1{% +\def\tikztiming@eaddto#1#2{% \begingroup - \tikztiming@internaldefs{}% - \@temptokena\expandafter{\tikztiming@str}% - \xdef\tikztiming@str{% + \tikztiming@internaldefs + \@temptokena\expandafter{#1}% + \xdef#1{% \the\@temptokena - #1% + #2% }% \endgroup } +\def\tikztiming@eaddtostr{% + \tikztiming@eaddto\tikztiming@str +} \def\tikztiming@addtostr{% \g@addto@macro\tikztiming@str } +\def\tikztiming@makeglobal#1{% + \global\let#1#1\relax\relax +} +\def\tikztiming@trans{}% +\def\tikztiming@iftrans#1{% + \tikztiming@iftrans@#1\empty\empty\empty\relax +} +\def\tikztiming@iftrans@#1#2#3#4\relax{% + \begingroup + \xdef\tikztiming@trans{#1#2}% + \ifx\tikztiming@trans\empty + \gdef\tikztiming@trans{{@}{}{@}}% + \else + \global\let\tikztiming@trans\relax + % Use triple macros before double macros + \@ifundefined{tikztiming@triple@#2}% + {\@ifundefined{\tikztiming@prefix#1#2}% + {}% + {\xdef\tikztiming@trans{{#1}{#2}{}}}% + }% + {% + \@ifundefined{\tikztiming@prefix#1#2#3}% + {}% + {\xdef\tikztiming@trans{{#1}{#2}{#3}}}% + }% + % If both do not exist, search for aliases: + \ifx\tikztiming@trans\relax + \@ifundefined{tikztiming@alias@#1}% + {\edef\chara{#1}}% + {\edef\chara{#1,\csname tikztiming@alias@#1\endcsname}}% + \@ifundefined{tikztiming@alias@#2}% + {\edef\charb{#2}}% + {\edef\charb{#2,\csname tikztiming@alias@#2\endcsname}}% + \@ifundefined{tikztiming@triple@#2}% + {\def\charc{\empty}}% + {% + \@ifundefined{tikztiming@alias@#3}% + {\edef\charc{#3,}}% + {\edef\charc{#3,\csname tikztiming@alias@#3\endcsname,}}% + }% + \ifx\charb\empty + \def\charb{\empty}% + \fi + \let\tikztiming@next\relax + \foreach \b in \charb {% + \foreach \a in \chara {% + \foreach \c in \charc {% + %\message{ ^^J Testing: \a\b\c ^^J}% + \@ifundefined{\tikztiming@prefix\a\b\c}% + {}{% + \xdef\tikztiming@trans{{#1}{#2}{#3}}% + \expandafter\tikztimingcpy\expandafter + {\tikztiming@trans}{\a\b\c}% + \ifnum\tikztiming@debug>0 + \message{^^J DEBUG: '#1#2#3' = '\a\b\c' ^^J}% + \fi + \expandafter\tikztiming@makeglobal + \csname\tikztiming@pfxtr\tikztiming@trans\endcsname + \ifnum\tikztiming@debug>1 + \ifnum\tikztiming@debug>2 + \expandafter\show\csname\tikztiming@pfxtr\tikztiming@trans\endcsname + \else + \message{^^J\tikztiming@trans: + \expandafter\meaning\csname\tikztiming@pfxtr\tikztiming@trans\endcsname^^J}% + \message{^^J\a\b\c: + \expandafter\meaning\csname\tikztiming@prefix\a\b\c\endcsname^^J}% + \fi + \fi + \global\let\tikztiming@next\breakforeach + }% + \tikztiming@next + }% + \tikztiming@next + }% + \tikztiming@next + }% + \fi + \fi + \endgroup + \ifx\tikztiming@trans\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi +} +\def\tikztiming@nameaddtostr#1#2#3{% + \tikztiming@iftrans{{#1}{#2}{#3}}% + {% + \edef\@tempa{\noexpand\tikztiming@trans@{\tikztiming@num}\tikztiming@trans}% + \expandafter\g@addto@macro + \expandafter\tikztiming@str + \expandafter{\@tempa}% + }% + {\PackageWarning{tikz-timing}{No transitions '#1#2' (or '#1#2#3') defined!}}% +} +\def\tikztiming@output@addcode#1{% + \g@addto@macro\tikztiming@output@bufcode{\unexpanded{ #1 }}% +} +\def\tikztiming@output@eaddcode#1{% + \g@addto@macro\tikztiming@output@bufcode{ #1 }% +} +\def\tikztiming@output@Eaddcode{% + \tikztiming@eaddto\tikztiming@output@bufcode% +} +\def\tikztiming@output@bufchara{}% +\def\tikztiming@output@bufcharb{}% +\def\tikztiming@output@bufnum{0}% +\def\tikztiming@output@bufcode{}% +\def\tikztiming@output@nextchar{}% \def\tikztiming@output#1#2{% + \edef\tikztiming@fromchar{#1}% + \edef\tikztiming@tochar{#2}% \ifx\relax#2\relax - \tikztiming@nameaddtostr{#1}% + %\tikztiming@output@codeflush + \tikztiming@nameaddtostr{}{#1}{}% \else \ifcase0% \ifx\tikztiming@output@bufchara\empty @@ -327,61 +532,65 @@ % not empty \edef\tikztiming@output@currentchar{#2}% \ifcase0% - \expandafter\ifx\csname tikztiming@nocombine@#2\endcsname\relax - \ifx\tikztiming@output@currentchar\tikztiming@output@bufcharb - 1% - \fi\fi + \ifx\tikztiming@output@bufcode\empty% Stop combining if code was inserted + \expandafter\ifx\csname tikztiming@nocombine@#2\endcsname\relax + \ifx\tikztiming@output@currentchar\tikztiming@output@bufcharb + 2% + \fi + \fi + \else + 1% + \fi \relax + \edef\tikztiming@output@nextchar{#2}% + \tikztiming@output@flush + \xdef\tikztiming@output@bufchara{#1}% + \xdef\tikztiming@output@bufcharb{#2}% + \or + \edef\tikztiming@output@nextchar{#2}% \tikztiming@output@flush - \edef\tikztiming@output@bufchara{#1}% - \edef\tikztiming@output@bufcharb{#2}% + \xdef\tikztiming@output@bufchara{#1}% + \xdef\tikztiming@output@bufcharb{#2}% \or \pgfmathparse{\tikztiming@output@bufnum + \tikztiming@num}% - \let\tikztiming@output@bufnum\pgfmathresult - \def\tikztiming@num{1.0}% + \global\let\tikztiming@output@bufnum\pgfmathresult \fi \else % empty - \edef\tikztiming@output@bufchara{#1}% - \edef\tikztiming@output@bufcharb{#2}% - \let\tikztiming@output@bufnum\tikztiming@num - \def\tikztiming@num{1.0}% + \tikztiming@output@codeflush + \xdef\tikztiming@output@bufchara{#1}% + \xdef\tikztiming@output@bufcharb{#2}% + \global\let\tikztiming@output@bufnum\tikztiming@num \fi \fi } -\def\tikztiming@output@bufchara{}% -\def\tikztiming@output@bufcharb{}% -\def\tikztiming@output@bufnum{0}% \def\tikztiming@output@flush{% + \tikztiming@output@charflush + \tikztiming@output@codeflush +} +\def\tikztiming@output@codeflush{% + \tikztiming@eaddtostr{\tikztiming@output@bufcode}% + \global\let\tikztiming@output@bufcode\empty% +} +\def\tikztiming@output@charflush{% \begingroup \let\tikztiming@num\tikztiming@output@bufnum - \tikztiming@nameaddtostr{% - \tikztiming@output@bufchara - \tikztiming@output@bufcharb - }% + \tikztiming@nameaddtostr + {\tikztiming@output@bufchara}% + {\tikztiming@output@bufcharb}% + {\tikztiming@output@nextchar}% \endgroup% + \gdef\tikztiming@output@nextchar{}% \gdef\tikztiming@output@bufchara{}% \gdef\tikztiming@output@bufcharb{}% \global\let\tikztiming@output@bufnum\tikztiming@num - \gdef\tikztiming@num{1.0}% } -\def\tikztiming@nameaddtostr#1{% +\newcommand\tikztiming@nameedef[4]{% + \def\@gtempa##1{#4}% \begingroup - \edef\@tempa{\tikztiming@num}% - \expandafter\g@addto@macro - \expandafter\tikztiming@str - \expandafter{\csname\tikztiming@prefix#1\expandafter\endcsname - \expandafter{\@tempa} }% + \tikztiming@internaldefs + \xdef\@gtempa##1##2##3##4{\@gtempa{\width}}% \endgroup - \def\tikztiming@num{1.0}% -} -\newcommand\tikztiming@nameedef[3][A]{% - \def\@gtempa##1{#3}% - \expandafter\let\csname\tikztiming@prefix#2@general\endcsname\@gtempa - \begingroup - \tikztiming@internaldefs{#1}% - \xdef\@gtempa##1{\@gtempa{\width}}% - \endgroup - \expandafter\let\csname\tikztiming@prefix#2\endcsname\@gtempa + \expandafter\let\csname\tikztiming@prefix#1#2#3\endcsname\@gtempa \let\@gtempa\empty } \newcommand\tikztiming@namelet[2]{% @@ -398,7 +607,10 @@ \csname\tikztiming@prefix#2\endcsname \fi } -\def\tikztiming@@end{% +\def\tikztiming@parser@end{% + \def\tikztiming@output@nextchar{@}% + \let\tikztiming@fromchar\tikztiming@tochar + \edef\tikztiming@tochar{@}% \tikztiming@output@flush \global\let\tikztimingwidth\tikztimingwidth \tikztiming@addtostr{ coordinate (timing/end) @@ -406,42 +618,29 @@ coordinate (timing/end base) at (\x2,\y1) coordinate (timing/end top) at (\x2,1+\y1) }% + \endgroup + \tikztiming@endhook% } -\def\tikztiming@@#1{% +\let\tikztiming@endhook\relax +\def\tikztiming@parser@#1{% \ifx\relax#1\empty - \expandafter\tikztiming@@end + \expandafter\tikztiming@parser@end \else - \let\lasttikztimingwidth\tikztimingwidth \tikztiming@iflower{#1}% - {\pgfmathparse{\tikztiming@num/2.0}\let\tikztiming@num\pgfmathresult}% + {\tikztiming@setnum{\tikztiming@num/2}}% {}% \ifx\tikztiming@back\empty\else - \pgfmathparse{\tikztiming@num-\tikztiming@back}% - \let\tikztiming@num\pgfmathresult - \let\tikztiming@back\empty + \tikztiming@setnum{\tikztiming@num - \tikztiming@back}% + \global\let\tikztiming@back\empty \fi \pgfmathparse{\tikztimingwidth + \tikztiming@num}% - \let\tikztimingwidth\pgfmathresult - \def\currentchar{#1}% - \uppercase{\def\currentcharuc{#1}}% - \@ifundefined{tikztiming@beforenextcode@\lastchar}% - {}% - {\@nameuse{tikztiming@beforenextcode@\lastchar}}% - \@ifundefined{tikztiming@beforecode@\currentchar}% - {}% - {\@nameuse{tikztiming@beforecode@\currentchar}}% - \@ifundefined{\tikztiming@prefix\lastchar\currentchar}% - {\@ifundefined{\tikztiming@prefix\lastchar\currentcharuc}% - {\PackageWarning{tikz-timing}{Timing transition '\lastchar\currentchar' - is not defined and will be ignored!}{}{}{}}% - {\tikztiming@output{\lastchar}{\currentcharuc}}% - }% - {\tikztiming@output{\lastchar}{\currentchar}}% - \let\secondlastchar\lastchar - \let\lastchar\currentcharuc - \@ifundefined{tikztiming@aftercode@\currentcharuc}% - {}% - {\@nameuse{tikztiming@aftercode@\currentcharuc}}% + \global\let\tikztimingwidth\pgfmathresult + \uppercase{\gdef\tikztiming@currentchar{#1}}% + \@nameuse{tikztiming@beforenextcode@\tikztiming@lastchar}% + \@nameuse{tikztiming@beforecode@\tikztiming@currentchar}% + \tikztiming@output{\tikztiming@lastchar}{\tikztiming@currentchar}% + \global\let\tikztiming@lastchar\tikztiming@currentchar + \@nameuse{tikztiming@aftercode@\tikztiming@currentchar}% \expandafter \tikztiming@testfortext \fi @@ -449,58 +648,90 @@ \def\tikztiming@testfortext{% \@ifnextchar\bgroup {\tikztiming@handletext}% - {\tikztiming@}% + {\tikztiming@parser}% } \def\tikztiming@handletext#1{% + \@ifnextchar\relax + {\def\tikztiming@output@nextchar{@}\tikztiming@handletext@{#1}}% + {\def\tikztiming@output@nextchar{Z}\tikztiming@handletext@{#1}}% +} +\def\tikztiming@handletext@#1{% \@ifnextchar{[}% - {\tikztiming@handletext@}% - {\tikztiming@handletext@[]}% - #1\relax + {\tikztiming@handletext@@}% + {\tikztiming@handletext@@[]}% + #1\tikztiming@endoftext } -\def\tikztiming@handletext@[#1]#2\relax{% - \begingroup +\def\tikztiming@handletext@@[#1]#2\tikztiming@endoftext{% + \@ifnextchar{\relax}% + {\def\tikztiming@output@nextchar{@}% + \tikztiming@handletext@@@{#1}{#2}}% + {\tikztiming@handletext@@@{#1}{#2}}% +} +\def\tikztiming@handletext@@@#1#2{% \expandafter\lowercase\expandafter{% - \expandafter\def\expandafter\currentcharlc - \expandafter{\currentchar}% + \expandafter\def\expandafter\@tempa + \expandafter{\tikztiming@currentchar}% }% - \pgfkeysifdefined{/tikz/timing/\currentcharlc/text/.@cmd}% + \pgfkeysifdefined{/tikz/timing/\@tempa/text/.@cmd}% {% - \tikztiming@output@flush - \tikztiming@eaddtostr{% - node (timing@dend) at +(\dslope/2.0,\height/2.0) {} - node [%] - shift={($ (timing@dstart)!0.5!(timing@dend) $)},% - timing/\currentcharlc/text,% - }% - \endgroup - \tikztiming@addtostr{%[ - #1% - ] {#2}% - }% - \def\lastchar{D@edge@}% + \edef\@tempa{node [timing/\@tempa/text,}% + \expandafter\tikztiming@output@addcode\expandafter{% + \@tempa + #1] at ($ (timing@dstart) !.5! (timing@dend) $) + {\tikztiming@textformat{#2}} + }% + \ifcase0% + \if @\tikztiming@output@bufchara + 1% + \else + \ifx\tikztiming@output@bufchara\tikztiming@currentchar + 1% + \fi + \fi + \relax + \else + \fi + \xdef\tikztiming@output@bufcharb{\tikztiming@currentchar @edge@}% + \xdef\tikztiming@lastchar{\tikztiming@currentchar @edge@}% }{% \endgroup \PackageWarning{tikz-timing}{Ignoring text for character - '\currentchar'!}{}{}{}% + '\tikztiming@currentchar'!}{}{}{}% }% - \tikztiming@ + \tikztiming@parser } +\let\tikztiming@textformat\empty \def\tikztiming@defcode#1{% \@namedef{tikztiming@code@\meaning#1}% } +\tikztiming@defcode{@}#1{% + #1\relax + \tikztiming@parser +} +\begingroup + \expandafter\let\expandafter\temp + \csname tikztiming@code@\meaning @\endcsname + \makeatother + \expandafter\global\expandafter\let + \csname tikztiming@code@\meaning @\endcsname\temp +\endgroup +\tikztiming@defcode$#1${% + \pgfmathparse{#1}% + \expandafter + \tikztiming@parser\pgfmathresult +} \tikztiming@defcode{,}{% - \tikztiming@output@flush - \tikztiming@eaddtostr{% + \tikztiming@output@eaddcode{% \newdraw }% - \tikztiming@ + \tikztiming@parser } \tikztiming@defcode{;}{% - \tikztiming@output@flush - \tikztiming@eaddtostr{% + \endgroup\begingroup + \tikztiming@output@eaddcode{% \newdrawns }% - \tikztiming@ + \tikztiming@parser } \tikztiming@defcode{N}{% \@ifnextchar[%] @@ -512,6 +743,53 @@ {\tikztiming@addnode@getoptions}% {\tikztiming@addnode@getoptions[]}% } +\tikztiming@defcode{B}{% + \pgfmathparse{\tikztiming@back+\tikztiming@num}% + \global\let\tikztiming@back\pgfmathresult + \tikztiming@parser +} +\tikztiming@defcode{b}{% + \pgfmathparse{\tikztiming@back+\tikztiming@num/2}% + \global\let\tikztiming@back\pgfmathresult + \tikztiming@parser +} +\tikztiming@defcode{F}{% + \pgfmathparse{\tikztiming@back-\tikztiming@num}% + \global\let\tikztiming@back\pgfmathresult + \tikztiming@parser +} +\tikztiming@defcode{f}{% + \pgfmathparse{\tikztiming@back-\tikztiming@num/2}% + \global\let\tikztiming@back\pgfmathresult + \tikztiming@parser +} +\tikztiming@defcode[{%}]{ + \@ifnextchar[%] + {\tikztiming@bothoption}% + {\@ifnextchar{!}% + {\tikztiming@parseroption}% + {\@ifnextchar{|}% + {\tikztiming@onceoption}% + {\tikztiming@addoption}% + }% + }% +} +\def\tikztiming@parseroption!#1!]{% + \pgfqkeys{/tikz/timing}{#1}% + \tikztiming@parser +} +\def\tikztiming@addoption#1]{% + \tikztiming@output@addcode{ [timing/option={#1}] }% + \tikztiming@parser +} +\def\tikztiming@bothoption[#1]]{% + \tikzset{#1}%[ + \tikztiming@addoption{#1}]% +} +\def\tikztiming@onceoption|#1|]{% + \tikztiming@output@addcode{ [#1] }% + \tikztiming@parser +} \def\tikztiming@addnode@getoptions[#1]{% \@ifnextchar(%) {\tikztiming@addnode@getname{#1}}% @@ -523,25 +801,54 @@ {\tikztiming@addnode@{#1}{#2}{}}% } \def\tikztiming@addnode@#1#2#3{% - \tikztiming@output@flush + \def\@tempa{#2}% + \ifx\@tempa\empty + \def\@tempa{ node [timing/inline node,% + timing/inline node/from char={\tikztiming@fromchar},% + timing/inline node/to char={\tikztiming@tochar},% + \unexpanded{#1}] }% + \def\@tempb{}% + \else + \def\@tempa{ node [timing/inline node,% + timing/inline node/from char={\tikztiming@fromchar},% + timing/inline node/to char={\tikztiming@tochar},% + \unexpanded{#1}] (\unexpanded{#2}) }% + \xdef\tikztiming@namednodes{\tikztiming@namednodes,#2}% + \fi + \expandafter\tikztiming@output@eaddcode\expandafter{\@tempa \unexpanded{{#3}}}% + \tikztiming@parser +} +\newcommand*\tikztiming@marknodes[2][]{% + \scope[timing/debug/scope,#1] + \edef\@tempa{floor((\noexpand\y1-\tikztiming@xunit) / \tikztiming@rowdist\tikztiming@xunit) * \tikztiming@rowdist\tikztiming@xunit}% + \foreach \N in #2 {% + \ifx\N\empty\else + \tikztiming@markcmd + \path let \p1=(\N) in + node [timing/debug/node] at ($ (\x1,\noexpand\@tempa) + (0,1) $) {\N}; + \fi + }% + \endscope +} +\def\tikztiming@markcmd{ \draw (\N) circle (1pt); }% +\newcommand*\tikztiming@mark@nodes[2][]{% \begingroup \def\@tempa{#2}% - \ifx\@tempa\empty - \def\@tempa{ node [timing/inline node,#1] }% - \else - \def\@tempa{ node [timing/inline node,#1] (#2) }% - \fi - \expandafter\tikztiming@addtostr\expandafter{\@tempa {#3} }% + \ifx\@tempa\empty \let\@tempa\tikztiming@namednodes \fi + \ifx\@tempa\space \let\@tempa\tikztiming@namednodes \fi + \def\@tempb{\tikztiming@marknodes[#1]}% + \expandafter\@tempb\expandafter{\expandafter{\@tempa}}% \endgroup - \tikztiming@ } \def\tikztiming@testforcode{% \@ifnextchar{!}% {\tikztiming@testforcode@}% {\@ifundefined{tikztiming@code@\meaning\@let@token}% - {\tikztiming@@}% - {\csname tikztiming@code@\meaning\@let@token\expandafter - \endcsname\@gobble}% + {\tikztiming@parser@}% + {\expandafter\afterassignment + \csname tikztiming@code@\meaning\@let@token\endcsname + \let\@let@token=% + }% }% } \def\tikztiming@testforcode@#1{% @@ -550,40 +857,15 @@ {% \PackageWarning{tikz-timing}{Missing braces after '!' character. Ignoring this character}{}{}{}% - \tikztiming@ + \tikztiming@parser }% } -\tikztiming@defcode{B}{% - \pgfmathparse{\tikztiming@back+\tikztiming@num}% - \let\tikztiming@back\pgfmathresult - \tikztiming@ -} -\tikztiming@defcode{b}{% - \pgfmathparse{\tikztiming@back+\tikztiming@num/2}% - \let\tikztiming@back\pgfmathresult - \tikztiming@ -} -\tikztiming@defcode{F}{% - \pgfmathparse{\tikztiming@back-\tikztiming@num}% - \let\tikztiming@back\pgfmathresult - \tikztiming@ -} -\tikztiming@defcode{f}{% - \pgfmathparse{\tikztiming@back-\tikztiming@num/2}% - \let\tikztiming@back\pgfmathresult - \tikztiming@ -} \def\tikztiming@handlecode#1{% - \tikztiming@output@flush - \tikztiming@addtostr{ #1 }% - \tikztiming@ -} -\tikztiming@defcode[#1]{% - \tikztiming@addtostr{ [#1] }% - \tikztiming@ + \tikztiming@output@addcode{ #1 }% + \tikztiming@parser } - \def\tikztiming@testfornum{% + \global\let\tikztiming@num\tikztiming@wscale \let\tikztiming@numchars\empty \tikztiming@numfrac0\relax \afterassignment @@ -607,6 +889,9 @@ \fi } \def\tikztiming@testfornum@{% + \ifx0\@let@token + \let\tikztiming@next\tikztiming@testfornum@@ + \else \ifnum0<\tikztiming@numint \let\tikztiming@next\tikztiming@testfornum@@ \else @@ -616,18 +901,17 @@ {% \tikztiming@numint1\relax \tikztiming@numfrac0\relax - \def\tikztiming@num{1.0}% + \global\let\tikztiming@num\tikztiming@wscale \if@tikztiming@metachar {\def\@tempa{\expandafter\expandafter\expandafter - \tikztiming@testfornum@@@@ - \expandafter\expandafter\expandafter{% - \csname tikztiming@metachar@\meaning\@let@token\endcsname}}% - \expandafter\@tempa\@gobble + \tikztiming@parser + \csname tikztiming@metachar@\meaning\@let@token\endcsname{1}}% + \expandafter\@tempa\@gobble }% {\tikztiming@testforcode}% }% }% - \fi + \fi\fi \tikztiming@next } \def\tikztiming@testfornum@@{% @@ -636,7 +920,8 @@ {\tikztiming@testfornum@@@}% } \def\tikztiming@testfornum@@@{% - \xdef\tikztiming@num{\the\tikztiming@numint.\expandafter\@gobble\the\tikztiming@numfrac}% + \edef\tikztiming@num{\the\tikztiming@numint.\expandafter\@gobble\the\tikztiming@numfrac}% + \tikztiming@setnum{\tikztiming@wscale * \tikztiming@num}% \@ifnextchar\bgroup {% \expandafter\tikztiming@numfrac\expandafter0\expandafter @@ -646,31 +931,21 @@ \PackageWarning{tikz-timing}% {Can not repeat group by a non-integer factor!^^J% Rounding '\tikztiming@num' to '\pgfmathresult'.}{}{}{}% - \let\tikztiming@num\pgfmathresult + \global\let\tikztiming@num\pgfmathresult \fi \tikztiming@testfornum@@@@ }% {% \if@tikztiming@metachar {\def\@tempa{\expandafter\expandafter\expandafter - \tikztiming@testfornum@@@@ - \expandafter\expandafter\expandafter{% - \csname tikztiming@metachar@\meaning\@let@token\endcsname}}% + \tikztiming@parser + \csname tikztiming@metachar@\meaning\@let@token\expandafter\endcsname + \expandafter{\tikztiming@num}}% \expandafter\@tempa\@gobble }% {\tikztiming@testforcode}% }% } -\def\tikztimingmetachar#1#2{% - \ifx\relax#2\relax - \expandafter\let\csname tikztiming@metachar@\meaning#1\endcsname\@undefined - \else - \@namedef{tikztiming@metachar@\meaning#1}{#2}% - \fi -} -\def\if@tikztiming@metachar#1#2{% - \@ifundefined{tikztiming@metachar@\meaning\@let@token}{#2}{#1}% -} \def\tikztiming@testfornum@@@@#1{% \begingroup \@temptokena{#1}% @@ -678,43 +953,67 @@ \endgroup \tikztiming@numint1\relax \tikztiming@numfrac0\relax - \expandafter\tikztiming@\tikztiming@numchars + \expandafter\tikztiming@parser\tikztiming@numchars +} +\def\tikztimingmetachar#1{% + \@ifnextchar{[}%] + {\tikztiming@metachar{#1}}% + {\tikztiming@metachar{#1}[]}% +} +\def\tikztiming@metachar#1[#2]#3{% + \ifx\relax#3\relax + \expandafter\let\csname tikztiming@metachar@\meaning#1\endcsname\@undefined + \else + \@namedef{tikztiming@metachar@\meaning#1}{}% + \ifx\relax#2\relax + \expandafter\renewcommand\expandafter*% + \csname tikztiming@metachar@\meaning#1\expandafter + \endcsname\expandafter[1]{##1{#3}}% + \else + \expandafter\renewcommand\expandafter*% + \csname tikztiming@metachar@\meaning#1\expandafter + \endcsname\expandafter[#2]{#3}% + \fi + \fi +} +\def\if@tikztiming@metachar#1#2{% + \@ifundefined{tikztiming@metachar@\meaning\@let@token}{#2}{#1}% } \newcounter{tikztimingrows} -\def\tikztiming@extracode{\@gobble{EXTRACODE}}% - +\def\abc{\tracingassigns=1} \newenvironment{tikztimingtable}[1][]{% \begingroup \setcounter{tikztiming@nrows}{0}% \def\tikztiming@maxwidth{0.0}% \let\extracode\tikztiming@extracode + \let\endextracode\tikztiming@endextracode \let\tablegrid\tikztiming@tablegrid \let\fulltablegrid\tikztiming@fulltablegrid \let\horlines\tikztiming@horlines \let\vertlines\tikztiming@vertlines - \let\tablerules\tikztiming@tablerules + \let\marknodes\tikztiming@mark@nodes + \def\background{\pgfonlayer{background}\scope}% + \def\endbackground{\endscope\endpgfonlayer}% + \def\tablerules{\tikztiming@tablerules}% + \def\tableheader{\tikztiming@tableheader}% \def\rowdist{\tikztiming@rowdist}% \def\coldist{\tikztiming@coldist}% \def\nrows{\the\c@tikztiming@nrows}% \def\twidth{\tikztiming@maxwidth}% \tikzpicture[timing/table,#1]% \coordinate (last row) at (0,\rowdist); - \coordinate (label pos) at (-1*\coldist,0); + \coordinate (label pos) at (-1*{(\coldist)},0); \coordinate (timing/table/top left) at (0,1); \coordinate (timing/table/bottom right) at (0,0); - \collect@body\tikztiming@table + \tikztiming@picinit + \tikzset{timing/before table}% + \tikztimingtable@checkrow }{% -} - -\def\tikztiming@table#1{% - \tikztimingtable@row#1\endtikztimingtable@ + \tikzset{timing/after table}% \endtikzpicture \endgroup } - -\def\endtikztimingtable@{\@gobble{ENDTIKSTIMING}} - -\long\def\tikztimingextracode#1#2\endtikztimingtable@{% +\def\tikztiming@extracode{% \path let \p1 = (timing/table/top left), \p2 = (timing/table/bottom right) @@ -723,15 +1022,53 @@ coordinate (timing/table/top right) at (\x2,\y1) coordinate (timing/table/size) at (\x2-\x1,\y1-\y2) ; - #2% + \@ifnextchar[{\tikztiming@oset}{} +} +\def\tikztiming@endextracode{% + \@ifnextchar\@checkend + {\aftergroup\expandafter\aftergroup\tikztimingtable@checkrow}% + {\tikztimingtable@checkrow}% +}% +\def\tikztimingtable@checkrow{% + \@ifnextchar\end + {}% + {\ifx\@let@token\extracode + \let\tikztiming@next\empty + \else + \ifx\@let@token\begin + \def\tikztiming@next{\tikztimingtable@chkbegec}% + \else + \def\tikztiming@next{\tikztimingtable@row}% + \fi + \fi + \tikztiming@next + }% +} +\def\tikztimingtable@chkbegec\begin#1{ + \begingroup + \def\@tempa{#1}% + \def\@tempb{extracode}% + \ifx\@tempa\@tempb + \endgroup + \def\tikztiming@next{\begin{extracode}}% + \else + \endgroup + \def\tikztiming@next{\tikztimingtable@row\begin{#1}}% + \fi + \tikztiming@next +} +\def\tikztiming@oset[#1]{% + \let\tikz@options\pgfutil@empty + \tikzset{#1}% + \tikz@options } \def\tikztiming@emptycell{% \@gobble{tikztiming@emptycell}% } -\def\tikztimingtable@row#1\\{% +\long\def\tikztimingtable@row#1\\{% \tikztimingtable@row@#1&\tikztiming@emptycell&\\ } -\def\tikztimingtable@row@#1\\{% +\long\def\tikztimingtable@row@#1\\{% \ifx\\#3\\\else \begingroup \def\@tempa{\tikztiming@emptycell&}% @@ -744,17 +1081,17 @@ \endgroup \fi \ifx\tikztiming@emptycell#2% - \def\next{\tikztimingtable@row@@{#1}{}}% + \def\tikztiming@next{\tikztimingtable@row@@{#1}{}}% \else - \def\next{\tikztimingtable@row@@{#1}{#2}}% + \def\tikztiming@next{\tikztimingtable@row@@{#1}{#2}}% \fi - \next + \tikztiming@next }% -\def\tikztimingtable@row@@#1#2{% +\long\def\tikztimingtable@row@@#1#2{% \addtocounter{tikztiming@nrows}{1}% - \path ($ (last row) + (0,-1*\rowdist) $) coordinate (last row); - \path ($ (last row) + (-1*\coldist,0) $) node [anchor=base east,timing/name] - {\tikztiminglabel{#1}}; + \coordinate (last row) at ($ (last row) - (0,\tikztiming@rowdist) $); + \node [anchor=base east,timing/name] (last row text) + at ($ (last row) - (\tikztiming@coldist,0) $) {\ignorespaces #1\unskip}; \@ifnextchar{[}% {\tikztiming@tabletiming}% {\tikztiming@tabletiming[]}% @@ -764,26 +1101,21 @@ % \pgfmathparse{max(\tikztiming@maxwidth,\tikztimingwidth)}% \let\tikztiming@maxwidth\pgfmathresult - \@ifnextchar\extracode - {% - \let\extracode\relax - \tikztimingextracode - }% - {% - \@ifnextchar\endtikztimingtable@ - {\@gobble}{\tikztimingtable@row}% - }% + \tikztimingtable@checkrow } \def\tikztiming@tabletiming[#1]#2\relax{% - \let\lastchar\empty - \let\settings\empty + \let\tikztiming@lastchar\empty + \let\tikztiming@settings\empty \ifx\relax#1\relax\else \tikztiming@testoptarg#1\relax\relax \fi - \edef\@tempa{\noexpand\timing[name=row\the\c@tikztiming@nrows,\settings] + \ifx\tikztiming@lastchar\empty + \def\tikztiming@lastchar{@}% + \fi + \edef\@tempa{\noexpand\timing[name=row\the\c@tikztiming@nrows,\tikztiming@settings] at (last row)}% - \expandafter\@tempa\expandafter{\expandafter[\lastchar]#2}; + \expandafter\@tempa\expandafter{\expandafter[\tikztiming@lastchar]#2}; } \newcommand*\tikztiming@fulltablegrid[1][]{% @@ -795,27 +1127,62 @@ \endscope \end{pgfonlayer} } -\newcommand*\tikztiming@tablegrid[1][]{% +\def\tikztiming@tablegrid{% + \@ifnextchar{*}% + {\tikztiming@tablegrid@{row\row.high end}}% + {\tikztiming@tablegrid@{timing/table/top right}}% +} +\def\tikztiming@tablegrid@#1{% + \@ifnextchar{[}%] + {\tikztiming@tablegrid@@{#1}}% + {\tikztiming@tablegrid@@{#1}[]}% +} +\def\tikztiming@tablegrid@@#1[#2]{% \begin{pgfonlayer}{background} - \scope[xstep={\timingwidth/2.},ystep={\timingheight/2.},timing/table/grid,#1] - \foreach \y in {1,...,\nrows} {% - \draw {[shift={($ (timing/table/bottom left) + (0,\y*\rowdist) - - (0,\rowdist) $)}] let \p1 = (timing/table/bottom right) in (0,0) grid - (\x1,1)}; + \scope[xstep={\timingwidth/2.},ystep={\timingheight/2.},timing/table/grid,#2] + \foreach \row in {1,...,\nrows} {% + \draw {[shift={(row\row.low start)}] + let \p1 = (#1) in (0,0) grid (\x1,1)}; }% \endscope \end{pgfonlayer} } +\newcommand*\tikztiming@tableheader[3][]{% + \path [timing/table/header,#1] + (-1*{(\tikztiming@coldist)},1.5*{(\tikztiming@rowdist)}) node + [anchor=base east] {\ignorespaces #2\unskip\strut} + (0,1.5*{(\tikztiming@rowdist)}) node + [anchor=base west] {\ignorespaces #3\unskip\strut} + ; + \tikztiming@tableheadtrue +} +\newif\iftikztiming@tablehead \newcommand*\tikztiming@tablerules[1][]{% - \draw [timing/table/rules,#1] let - \p1 = (current bounding box.north west), - \p2 = (current bounding box.south east), + \begin{scope}[#1] + \coordinate (NW) at (current bounding box.north west); + \coordinate (SE) at (current bounding box.south east); + % + \draw [timing/table/rules] + let + \p1 = (NW), + \p2 = (SE), \p3 = (last row) in + ($ (\x1-\tabcolsep,\y3) - (0,.5*{(\rowdist)}) $) -- + ($ (\x2+\tabcolsep,\y3) - (0,.5*{(\rowdist)}) $) + \iftikztiming@tablehead + (\x1-\tabcolsep,2.5*{(\rowdist)}) -- (\x2+\tabcolsep,2.5*{(\rowdist)}) + \fi + ; + \draw + \iftikztiming@tablehead [timing/table/midrules] \else [timing/table/rules] \fi + let + \p1 = (NW), + \p2 = (SE) + in (\x1-\tabcolsep,\rowdist) -- (\x2+\tabcolsep,\rowdist) - ($ (\x1-\tabcolsep,\y3) - (0,\rowdist-1) $) -- - ($ (\x2+\tabcolsep,\y3) - (0,\rowdist-1) $) ; + \end{scope} } \newcommand*\tikztiming@horlines[2][]{% \begingroup @@ -823,11 +1190,12 @@ \ifx\list\empty \def\list{1,2,...,\nrows}% \fi - \foreach \row in \list% + \foreach \row in \list {% \draw [timing/table/lines,#1] let \p1 = (timing/table/bottom right) in - (0,\rowdist-\row*\rowdist) -- +(\x1,0); + ($ (0,\rowdist) - (0,\row * {(\rowdist)}) $) -- +(\x1,0); + }% \endgroup } \newcommand*\tikztiming@vertlines[2][]{% @@ -897,6 +1265,18 @@ \pgfpointborderrectangle{\pgfpoint{\@tempdima}{\@tempdimb}}{\northeastborder}% }% } +\gdef\tikztiming@oldnodecenter@{}% +\tikzset{timing/old@node@center/.code={\xdef\tikztiming@oldnodecenter@{% + ++($ (0,0) - #1 $) + [timing/no@old@node@center]}}% +}% +\tikzset{timing/no@old@node@center/.code={\gdef\tikztiming@oldnodecenter@{}}}% + +\def\tikztiming@oldnodecenter#1{% + [timing/old@node@center={#1}] + ++#1 +} + \def\tikztiming@iflower#1{% \begingroup \edef\@tempa{`#1}% @@ -910,12 +1290,15 @@ \@secondoftwo \fi } -\def\timingwidth{1}% -\def\timingheight{1}% -\def\tikztiming@internaldefs#1{% - \def\draw{\noexpand\draw}% - \def\path{\noexpand\path}% - \def\fill{\noexpand\fill}% +\def\tikztiming@internaldefs{% + \let\draw\relax + \let\path\relax + \let\p\relax + \let\x\relax + \let\y\relax + \let\n\relax + \let\tikztiming@oldnodecenter\relax + \let\tikztiming@oldnodecenter@\relax \def\width{####1*\noexpand\timingwidth}% \def\fwidth{\noexpand\timingwidth}% \def\height{\noexpand\timingheight}% @@ -923,10 +1306,9 @@ \def\zslope{\noexpand\timingzslope}% \def\dslope{\noexpand\timingdslope}% \def\gslope{0}% - \lowercase{% - \def\style{timing/#1}% - \def\bgstyle{timing/#1/background}% - }% + \def\style{timing/####3}% + \def\bgstyle{draw=none,timing/####3/background}% + \def\nstyle{timing/####4}% \def\newdraw{\tikztiming@newdraw}% \def\newdrawns{\tikztiming@newdraw@nosave}% \def\code##1{ [/utils/exec={\unexpanded{##1}}] }% @@ -950,39 +1332,41 @@ \tikztimingsetslope{0.10}% \tikztimingsetdslope{0.20}% \tikztimingsetzslope{0.05}% -\def\tikztiminguse#1{% - \@ifundefined{\tikztiming@prefix#1@general}% - {\PackageWarning{Can not use transition macro for '#1'.}{}{}{}}% - {\@nameuse{\tikztiming@prefix#1@general}}% +\def\tikztiminguse#1#2{% + \@nameuse{\tikztiming@prefix#1}{#2}{##2}{##3}{##4}% } \def\tikztimingdef#1{% - \tikztimingdef@#1\relax% + \tikztimingdef@#1\empty\empty\relax } -\def\tikztimingdef@#1#2\relax#3{% - \ifx\relax#2\relax - \tikztiming@nameedef[#1]{#1}{#3}% +\def\tikztimingdef@#1#2#3\relax#4{% + \ifx\empty#2\empty + \tikztiming@nameedef{}{#1}{}{#4}% \else - \tikztiming@nameedef[#2]{#1#2}{#3}% + \tikztiming@nameedef{#1}{#2}{#3}{#4}% \fi } -\def\tikztiminglet#1#2{% - \tikztiminglet@#1\relax#2\relax -} -\def\tikztiminglet@#1#2\relax#3#4\relax{% - \tikztiming@namelet{#1#2}{#3#4}% - \tikztiming@namelet{#1#2@general}{#3#4@general}% - \tikztiming@iflower{#1}{}% - {\tikztiming@iflower{#2}% - {% - \lowercase{\tikztiminglet@{#1}{#2}\relax{#3}{#4}}\relax - }% - {% - \uppercase{\lowercase{% - \uppercase{\lowercase{\tikztiminglet@{#1}}{#2}}\relax{#3}}{#4}}\relax - \lowercase{\uppercase{% - \lowercase{\uppercase{\tikztiminglet@{#1}}{#2}}\relax{#3}}{#4}}\relax +\def\tikztimingcpy#1#2{% + \begingroup + \edef\tikztimingcpy@a{#1}% + \edef\tikztimingcpy@b{#2}% + \ifx\tikztimingcpy@a\tikztimingcpy@b + \endgroup + %\message{^^J Copy macro '#2' to '#1' skipped.^^J}% + \else + \endgroup + \@ifundefined{\tikztiming@pfxtr#2\empty\empty\empty}% + {\ifnum\tikztiming@debug>0\relax + \message{^^J Copy macro '#2' to '#1' failed.^^J}\fi}% + {\ifnum\tikztiming@debug>0\relax + \message{^^J Copy macro '#2' to '#1'.^^J}\fi + \expandafter\let + \csname\tikztiming@pfxtr#1\empty\empty\empty\expandafter\endcsname + \csname\tikztiming@pfxtr#2\empty\empty\empty\endcsname }% - }% + \fi +} +\def\tikztiminglet#1#2{% + \tikztiming@namelet{#1}{#2}% } \def\tikztiming@chars#1{} \def\tikztiming@ifcharexists#1{% @@ -1006,98 +1390,108 @@ \tikztiming@addchar{#1}% \tikztimingchar@{#1}}% } -\expandafter\def\csname\tikztiming@prefix @start\endcsname#1{}% +\@namedef{\tikztiming@prefix @@}#1#2#3#4{ coordinate (timing/start)}% \def\tikztimingchar@#1#2#3{% - \tikztiming@nameedef[#1]{#1@start}{#2 coordinate (timing/start) }% - \tikztiming@nameedef[#1]{#1}{#2 coordinate (timing/start) #3}% - \tikztimingdef{#1#1}{#3}% + \tikztiming@nameedef{@}{#1}{}{#2 coordinate (timing/start) #3}% + \tikztimingdef{{#1}{#1}}{#3}% } -\def\tikztimingalias#1#2{% - \uppercase{\tikztimingalias@{#1}{#2}}% +\def\tikztimingecopy#1#2{% + \@namedef{tikztiming@alias@#1}{#2}% + \tikztiming@addchar{#1}% + \expandafter\let + \csname tikztiming@triple@#1\expandafter\endcsname + \csname tikztiming@triple@#2\endcsname + \expandafter\let + \csname tikztiming@nocombine@#1\expandafter\endcsname + \csname tikztiming@nocombine@#2\endcsname } -\def\tikztimingalias@#1#2{% - \tikztiming@namelet{#1}{#2}% - \tikztiming@namelet{#1@start}{#2@start}% - \lowercase{% - \tikztiming@namelet{#1}{#2}% - \tikztiming@namelet{#1@start}{#2@start}% - }% - \tikztiminglet{#1#1}{#2#2}% - \@for\@tempa:=\tikztiming@chars\do{% - \expandafter\tikztiminglet@@ - \expandafter{\@tempa}{#1}{#2}% - }% +\def\tikztiming@newdraw{% + node [timing/save] (timing@save) {};% + \draw [timing/restore] (timing@save) ++(0,0) } -\def\tikztimingecopy#1#2{% - \uppercase{\tikztimingecopy@{#1}{#2}}% -} -\def\tikztimingecopy@#1#2{% - \tikztimingchar{#1}{}{}% - \tikztimingdef{#1}{\tikztiminguse{#2}{##1}}% - \tikztiming@nameedef[#1]{#1@start}{\tikztiminguse{#2@start}{##1}}% - \lowercase{% - \@ifundefined{\tikztiming@prefix#2}{}{% - \tikztimingdef{#1}{\tikztiminguse{#2}{##1}}% - \tikztiming@nameedef[#1]{#1@start}{\tikztiminguse{#2@start}{##1}}% - }% - }% - \tikztimingdef{#1#1}{\tikztiminguse{#2#2}{##1}}% - \@for\@tempa:=\tikztiming@chars\do{% - \expandafter\tikztimingdef@@ - \expandafter{\@tempa}{#1}{#2}% - \expandafter\lowercase\expandafter{\expandafter\def\expandafter\@tempb - \expandafter{\@tempa}}% - \@ifundefined{\tikztiming@prefix#2\@tempb}{}{% - \expandafter\tikztimingdef@@ - \expandafter{\@tempb}{#1}{#2}% - }% + +\def\tikztiming@newdraw@nosave{% + node [timing/coord] (timing@save) {};% + \draw [timing/nooptions] (timing@save) ++(0,0) +} +\def\tikztiming@baseline{% + node [timing/save] (timing@save) {};% + \draw [timing/restore] let \p1 = (timing@save) in (\x1,0) ++(0,0) +} +\def\tikztiming@chars{H,L,Z,X,M,D,U,T,C}% +\tikztiming@defcode{S}{% + \pgfmathparse{\tikztimingwidth + \tikztiming@num}% + \global\let\tikztimingwidth\pgfmathresult + \tikztiming@output@Eaddcode{% + coordinate (timing@ref) at ($ (timing@ref) + (\tikztiming@num,0) $) + coordinate (timing@refa) at ($ (timing@refa) + (\tikztiming@num,0) $) + coordinate (timing@refb) at ($ (timing@refb) + (\tikztiming@num,0) $) + ++(\tikztiming@num,0) }% + \tikztiming@parser } -\def\tikztiminglet@@#1#2#3{% - \tikztiminglet@@@#1#2#3% - % Should stay, cause no harm: - \lowercase{\tikztiminglet@@@#1}#2#3% - \lowercase{\tikztiminglet@@@#1#2#3}% - \lowercase{\uppercase{\tikztiminglet@@@#1}#2#3}% + +\tikztiming@defcode{s}{% + \pgfmathparse{\tikztimingwidth + \tikztiming@num/2}% + \global\let\tikztimingwidth\pgfmathresult + \tikztiming@output@Eaddcode{% + coordinate (timing@ref) at ($ (timing@ref) + (\tikztiming@num/2,0) $) + coordinate (timing@refa) at ($ (timing@refa) + (\tikztiming@num/2,0) $) + coordinate (timing@refb) at ($ (timing@refb) + (\tikztiming@num/2,0) $) + ++(\tikztiming@num/2,0) + }% + \tikztiming@parser } -\def\tikztiminglet@@@#1#2#3{% - \tikztiminglet{#1#2}{#1#3}% - \tikztiminglet{#2#1}{#3#1}% +\tikztiming@defcode{G}{% + \tikztiming@output@addcode{% + \tikztiming@glitch + }% + \tikztiming@parser } -\def\tikztimingdef@@#1#2#3{% - \tikztimingdef{#1#2}{\tikztiminguse{#1#3}{##1}}% - \tikztimingdef{#2#1}{\tikztiminguse{#3#1}{##1}}% +\tikztiming@defcode{g}{% + \tikztiming@output@addcode{% + \tikztiming@glitch + }% + \tikztiming@parser } -\def\tikztiming@savesettings{% - \xdef\tikztiming@saved@settings{% - {\tikztiming@slope}% - {\tikztiming@dslope}% - {\tikztiming@zslope}% - {\the\pgflinewidth}% + +\def\tikztiming@glitch{% + {[timing/g] let \p1 = +(0,0) in (\x1,0) -- (\x1,\timingheight) + coordinate (timing@dstart) at (\x1,\timingheight/2) (\x1,\y1) }% } -\def\tikztiming@restoresettings{% - \expandafter\tikztiming@restoresettings@ - \tikztiming@saved@settings\relax +\tikztimingchar{H}{++(0,\height)}{-- ++(#1,0)} + +\tikztimingdef{HH}{ + -- ++(#1,0) } -\def\tikztiming@restoresettings@#1#2#3#4\relax{% - \tikztimingsetslope{#1}% - \tikztimingsetdslope{#2}% - \tikztimingsetzslope{#3}% - \pgfsetlinewidth{#4}% + +\tikztimingdef{LH}{ + -- +(\slope, \height) + -- ++(#1, \height) } -\def\tikztiming@newdraw{% - node [timing/save] (timing@save) {};% - \draw [timing/restore] (timing@save) ++(0,0) + +\tikztimingdef{ZH}{ + \newdraw + -- ++(\zslope,+\height/2.) + -- ++($ (#1,0) - (\zslope,0) $) } -\def\tikztiming@newdraw@nosave{% - node [timing/coord] (timing@save) {};% - \draw (timing@save) ++(0,0) +\tikztimingdef{DH}{ + \tikztiming@oldnodecenter@% + \newdraw [\style] + -- +(\dslope/2.,\height/2.) + -- ($ (timing@ref) + (#1,\height/2) $) +} + +\tikztimingdef{DL}{ + \tikztiming@oldnodecenter@ + \newdraw [\style] + -- +(\dslope/2.,-\height/2.) + -- ($ (timing@ref) + (#1,-\height/2) $) } -\tikztimingchar{H}{++(0,\height)}{-- ++(#1,0)} \tikztimingchar{L}{++(0,0)}{-- ++(#1,0)} @@ -1106,30 +1500,7 @@ -- ++(#1,0) } -\tikztimingchar{X}{}{}% -\tikztimingchar{D}{}{}% -\tikztimingchar{U}{}{}% -\tikztimingchar{M}{}{}% - -\tikztimingchar{G}{++(0,0)}{-- ++(\gslope,\height) -- ++(\gslope,-\height)} -\tikztimingchar{S}{++(0,0)}{++(#1,0)} - -\tikztimingdef{DD}{ - node [timing/save] (timing@save) {}; \path [\bgstyle] (timing@save) ++(0,0) - +(0.5*\dslope,0.5*\height) -- +(\dslope,0) - -- +(#1,0) - -- +($ (#1,0) + 0.5*(\dslope,\height) $) - -- +(#1,\height) - -- +(\dslope,\height) -- cycle; - \draw [timing/restore,\style] (timing@save) ++(0,0) - node [timing/save] (timing@dstart) at +(\dslope/2.,\height/2.) {} - -- +(\dslope,+\height) -- +(#1,+\height) ++(0,+\height) - -- +(\dslope,-\height) -- ++(#1,-\height) -} -\tikztiming@namelet{D@edge@D}{DD} -\tikztiming@namelet{D@edge@D@general}{DD@general} - -\tikztimingchar{D}{++(0,0)}{ +\tikztimingchar{D}{++(0,\height/2.)}{ node [timing/save] (timing@save) {}; \path [\bgstyle] (timing@save) ++(0,0) -- +(#1,0) -- +($ (#1,0) + 0.5*(\dslope,\height) $) @@ -1142,21 +1513,10 @@ -- ++(#1,0) ++(0,-\height) } -\tikztimingdef{DD}{ - node [timing/save] (timing@save) {}; \path [\bgstyle] (timing@save) ++(0,0) - -- +(#1,0) - -- +($ (#1,0) + 0.5*(\dslope,\height) $) - -- +(#1,\height) - -- +(0,\height) - -- cycle; - \newdraw [\style] - -- +(#1,0) ++(0,+\height) - -- ++(#1,0) ++(0,-\height) -} - -\tikztiming@namelet{D@edge@@start}{D@start} -\tikztiming@namelet{d@edge@@start}{d@start} - +\def\tikztiming@triple@D{}% +\def\tikztiming@triple@D@edge@{}% +\def\tikztiming@nocombine@D@edge@{}% +\def\tikztiming@alias@D@edge@{D}% \def\tikztiming@trans@D@fill#1#2{% node [timing/save] (timing@save) {}; \path [\bgstyle] (timing@save) ++(0,0) -- +(0.5*\dslope,-0.5*\height) @@ -1168,138 +1528,470 @@ \draw [timing/restore,\style] (timing@save) ++(0,0) node [timing/save] (timing@dstart) {} } -\tikztimingdef{HH}{-- ++(#1,0)} -\tikztimingdef{LL}{-- ++(#1,0)} -\tikztimingdef{HL}{-- ++(\slope,-\height) \tikztiminguse{HH}{#1-\slope}} -\tikztimingdef{LH}{-- ++(\slope, \height) \tikztiminguse{LL}{#1-\slope}} - -\tikztimingdef{HG}{-- ++(\gslope,-\height) -- ++(\gslope,+\height)} -\tikztimingdef{LG}{-- ++(\gslope,+\height) -- ++(\gslope,-\height)} -\tikztimingdef{ZG}{ - -- ++(\gslope,-\height/2.0) - -- ++(\gslope,+\height) - -- ++(\gslope,-\height/2.0) +\tikztimingdef{LL}{ + -- ++(#1,0) } -\tikztiminglet{DG}{LG} -\tikztiminglet{HS}{S} -\tikztiminglet{LS}{S} -\tikztiminglet{ZS}{S} -\tikztiminglet{DS}{S} -\tikztiminglet{TS}{S} +\tikztimingdef{HL}{ + -- ++(\slope,-\height) + \tikztiminguse{HH}{#1-\slope} +} \tikztimingdef{LZ}{ \newdraw [\style] - -- ++(\zslope,+\height/2.) -- ++($ (#1,0) - (\zslope,0) $) + -- ++(\zslope,+\height/2.) + -- ++($ (#1,0) - (\zslope,0) $) } \tikztimingdef{HZ}{% \newdraw [\style] - -- ++(\zslope,-\height/2.) -- ++($ (#1,0) - (\zslope,0) $) -} -\tikztimingdef{ZH}{ - \newdraw - -- ++(\zslope,+\height/2.) -- ++($ (#1,0) - (\zslope,0) $) + -- ++(\zslope,-\height/2.) + -- ++($ (#1,0) - (\zslope,0) $) } \tikztimingdef{ZL}{% \newdraw - -- ++(\zslope,-\height/2.) -- ++($ (#1,0) - (\zslope,0) $) + -- ++(\zslope,-\height/2.) + -- ++($ (#1,0) - (\zslope,0) $) } \tikztimingdef{DZ}{ - -- ++( \dslope/2.,+\height/2.) - ++(-\dslope/2.,+\height/2.) - -- ++( \dslope/2.,-\height/2.) + \tikztiming@oldnodecenter@ \newdraw [\style] - -- ++($ (#1,0) - (\dslope/2.,0) $) + -- ($ (timing@ref) + (#1,0) $) } -\tikztimingdef{ZD}{ - \tikztiming@trans@D@fill{#1}{0}% - -- ++(\dslope/2.,\height/2.) -- ++($ (#1,0) - (\dslope/2.,0) $) - ++($ -1*(#1,0) + (0,-\height/2.) $) - -- ++(\dslope/2.,-\height/2.) -- ++($ (#1,0) - (\dslope/2.,0) $) +\def\tikztiming@chard#1{% + \newdraw [\style,preaction={\bgstyle}] + coordinate (timing@dstart) + -- +(\dslope/2,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + -- +(\dslope/2,-\height/2) + -- +(0,-\height) + -- ($ (timing@dstart) + (\dslope/2,-\height/2) $) + -- (timing@dstart) + ($ (timing@ref) + (#1,0) $) + coordinate (timing@ref) + ++(\dslope/2,0) + coordinate (timing@dend) + \tikztiming@oldnodecenter{% + (-\dslope/2,-\height/2) + }% + \newdraw } -\tikztimingdef{LD}{ - -- ++(0.5*\dslope,0.5*\height) - \tikztiming@trans@D@fill{#1}{0.5*\dslope}% - -- ++(0.5*\dslope,0.5*\height) - -- ++($ (#1,0) - (\dslope,0) $) - ++($ -1*(#1,0) + (0,-\height) $) ++(\dslope/2.,+\height/2.) - -- ++(\dslope/2.,-\height/2.) -- ++($ (#1,0) - (\dslope,0) $) +\def\tikztiming@chard@#1{% + \newdraw [\bgstyle] + -- +(\dslope/2,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + -- +(0,-\height)% + -- ($ (timing@save) + (\dslope/2,-\height/2) $) + -- (timing@save) + \newdraw [\style] + coordinate (timing@dstart) + -- +(\dslope/2,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + +(0,-\height)% + -- ($ (timing@save) + (\dslope/2,-\height/2) $) + -- (timing@save) + ($ (timing@ref) + (#1,0) $) + coordinate (timing@ref) + coordinate [shift={(\dslope/2,0)}] (timing@dend) + \tikztiming@oldnodecenter{% + (0,-\height/2) + }% + \newdraw } -\tikztimingdef{DL}{ - -- ++( \dslope/2.,+\height/2.) - ++(-\dslope/2.,+\height/2.) - -- ++(\dslope/2.,-\height/2.) +\def\tikztiming@@chard#1{% + ++(0,\height/2) + \newdraw [\bgstyle] + -- +(0,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + -- +(\dslope/2,-\height/2) + -- +(0,-\height) + -- ($ (timing@save) + (0,-\height/2) $) + -- (timing@save) \newdraw [\style] - -- ++(\dslope/2.,-\height/2.) - -- ++($ (#1,0) - (\dslope,0) $) + +(0,0) + coordinate (timing/start) + +(-\dslope/2,0) + coordinate (timing@dstart) + +(0,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + -- +(\dslope/2,-\height/2) + -- +(0,-\height) + -- ($ (timing@save) + (0,-\height/2) $) + ($ (timing@ref) + (#1,0) $) + coordinate (timing@ref) + ++(\dslope/2,0) + coordinate (timing@dend) + \tikztiming@oldnodecenter{% + (-\dslope/2,-\height/2) + }% + \newdraw } -\tikztimingdef{HD}{ - -- ++(0.5*\dslope,-0.5*\height) - \tikztiming@trans@D@fill{#1}{0.5*\dslope}% - -- ++(0.5*\dslope,-0.5*\height) - -- ++($ (#1,0) - (\dslope,0) $) - ++($ -1*(#1,0) + (0,+\height) $) ++(\dslope/2.,-\height/2.) - -- ++(\dslope/2.,+\height/2.) -- ++($ (#1,0) - (\dslope,0) $) - ++(0,-\height) +\def\tikztiming@@chard@#1{% + ++(0,\height/2) + \newdraw [\bgstyle] + -- +(0,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + -- +(0,-\height) + -- ($ (timing@save) + (0,-\height/2) $) + -- (timing@save) + \newdraw [\style] + +(0,0) + coordinate (timing/start) + coordinate (timing@ref) + coordinate [shift={(-\dslope/2,0)}] (timing@dstart) + +(0,\height/2) + -- +(#1,\height/2) + +(#1,-\height/2) + -- ($ (timing@save) + (0,-\height/2) $) + ++(#1,\height/2) + coordinate (timing@ref) + coordinate [shift={(\dslope/2,0)}] (timing@dend) + \tikztiming@oldnodecenter{% + (0,-\height/2) + }% + \newdraw } -\tikztimingdef{DH}{ - ++(0,+\height) - -- ++(+\dslope/2.,-\height/2.) - ++(-\dslope/2.,-\height/2.) - -- ++(\dslope/2.,+\height/2.) +\def\tikztiming@dchardu#1{% + \tikztiming@oldnodecenter@ + \newdraw [\bgstyle] + -- +(0,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + -- +(\dslope/2,-\height/2) + -- +(0,-\height) + -- ($ (timing@save) + (0,-\height/2) $) + -- (timing@save) \newdraw [\style] - -- ++(\dslope/2.,+\height/2.) - -- ++($ (#1,0) - (\dslope,0) $) + +(0,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + -- +(\dslope/2,-\height/2) + -- +(0,-\height) + -- ($ (timing@save) + (0,-\height/2) $) + ($ (timing@ref) + (#1,0) $) + coordinate (timing@ref) + ++(\dslope/2,0) + coordinate (timing@dend) + \tikztiming@oldnodecenter{% + (-\dslope/2,-\height/2) + }% + \newdraw } -\tikztimingalias{M}{Z} -\tikztimingchar{M}{++(0,\height/2.)}{ - \newdraw [\style/decoration,\style] - -- ++(#1,0) +\def\tikztiming@uchardd#1{% + \tikztiming@oldnodecenter@ + \newdraw [\bgstyle] + -- +(\dslope/2,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + -- +(0,-\height) + -- ($ (timing@save) + (\dslope/2,-\height/2) $) + -- (timing@save) + \newdraw [\style] + coordinate (timing@dstart) + -- +(\dslope/2,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + +(0,-\height) + -- ($ (timing@save) + (\dslope/2,-\height/2) $) + -- (timing@save) + ($ (timing@ref) + (#1,0) $) + coordinate (timing@ref) + coordinate [shift={(\dslope/2,0)}](timing@dend) + \tikztiming@oldnodecenter{% + ($ (0,0) - (0,\height/2) $) + }% + \newdraw +} + +\tikztimingdef{DD}{% + \tikztiming@dchardu{#1}% +} + +\tikztimingdef{UU}{% + \tikztiming@dchardu{#1}% +} + +\def\tikztiming@dchard@#1{% + \tikztiming@oldnodecenter@ + \newdraw [\bgstyle] + -- +(0,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + -- +(0,-\height) + -- ($ (timing@save) + (0,-\height/2) $) + -- (timing@save) + \newdraw [\style] + +(0,\height/2) + -- ($ (timing@ref) + (#1,\height/2) $) + +(0,-\height) + -- ($ (timing@save) + (0,-\height/2) $) + ($ (timing@ref) + (#1,0) $) + coordinate (timing@ref) + coordinate [shift={(\dslope/2,0)}] (timing@dend) + \tikztiming@oldnodecenter{% + (0,-\height/2) + }% + \newdraw +} + +\tikztimingdef{DD@}{ + \tikztiming@dchard@{#1}% +} + +\tikztimingcpy{DDD}{DD@} +\tikztimingcpy{UUU}{DDD} + +\tikztimingdef{{D@edge@}{D@edge@}}{% + \tikztiming@oldnodecenter@ + \tikztiming@chard{#1}% +}% + +\tikztimingdef{@{D@edge@}}{% + \tikztiming@@chard@{#1}% +}% + +\tikztimingdef{@{D@edge@}@}{% + \tikztiming@@chard@{#1}% +}% + +\tikztimingdef{@{D@edge@}D}{% + \tikztiming@@chard{#1}% +} + +\tikztimingdef{D{D@edge@}}{% + \tikztiming@dchardu{#1}% +} + +\tikztimingdef{U{U@edge@}}{% + \tikztiming@dchardu{#1}% +} + +\tikztimingdef{U{D@edge@}}{% + \tikztiming@oldnodecenter@ + \tikztiming@chard{#1}% +} + +\tikztimingdef{U{D@edge@}@}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard@{#1}% +} + +\tikztimingdef{D{U@edge@}}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard{#1}% +} + +\tikztimingdef{D{U@edge@}@}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard@{#1}% +} + +\tikztimingdef{D{D@edge@}@}{% + \tikztiming@dchard@{#1}% +}% + +\tikztimingdef{U{U@edge@}@}{% + \tikztiming@dchard@{#1}% +}% + +\tikztimingdef{{D@edge@}{D@edge@}@}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard@{#1}% +}% + +\tikztimingdef{@{D@edge@}}{% + \tikztiming@@chard{#1}% +}% + +\tikztimingdef{{D@edge@}D}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard{#1}% +}% + +\tikztimingdef{{D@edge@}D@}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard@{#1}% +}% + +\tikztimingdef{ZDZ}{ + coordinate (timing@ref) + \tikztiming@chard{#1} +} +\tikztimingcpy{ZDX}{ZDZ} +\tikztimingcpy{XDX}{ZDZ} +\tikztimingcpy{XDZ}{ZDZ} + +\tikztimingdef{ZDD}{ + coordinate (timing@ref) + \tikztiming@chard@{#1} +} + +\tikztimingdef{ZDU}{ + coordinate (timing@ref) + \tikztiming@chard{#1} +} + +\tikztimingcpy{ZUD}{ZDU} +\tikztimingcpy{ZUU}{ZDD} + +\tikztimingdef{ZD}{ + coordinate (timing@ref) + \tikztiming@chard{#1} +} + +\tikztimingdef{@DD}{% + \tikztiming@@chard@{#1}% +} + +\tikztimingdef{ZD@}{% + coordinate (timing@ref) + \tikztiming@chard@{#1}% +} + +\tikztimingdef{HD@}{% + coordinate [shift={(0,-\height/2)}] (timing@ref) + -- ++(\dslope/2, -\height/2) + \tikztiming@chard@{#1}% +} + +\tikztimingdef{TD@}{% + coordinate [shift={(0,-\height/2 * \value{tikztimingtrans})}] (timing@ref) + -- ++(\dslope/2, -\height/2 * \value{tikztimingtrans}) + \tikztiming@chard@{#1}% +} + +\tikztimingdef{TD}{% + \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}} + coordinate [shift={(0,\height/2 * \value{tikztimingtrans})}] (timing@ref) + -- ++(\dslope/2, \height/2 * \value{tikztimingtrans}) + \tikztiming@chard{#1}% +} + +\tikztimingdef{TDD}{% + \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}} + coordinate [shift={(0,\height/2 * \value{tikztimingtrans})}] (timing@ref) + -- ++(\dslope/2, \height/2 * \value{tikztimingtrans}) + \tikztiming@chard@{#1}% +} + +\tikztimingdef{TUD}{% + \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}} + coordinate [shift={(0,\height/2 * \value{tikztimingtrans})}] (timing@ref) + -- ++(\dslope/2, \height/2 * \value{tikztimingtrans}) + \tikztiming@chard{#1}% +} + +\tikztimingcpy{TDU}{TUD} +\tikztimingcpy{TUU}{TDD} + +\tikztimingdef{LD@}{% + coordinate [shift={(0,\height/2)}] (timing@ref) + -- ++(\dslope/2, \height/2) + \tikztiming@chard@{#1}% +} + +\tikztimingdef{@D}{% + \tikztiming@@chard@{#1}% +} + +\tikztimingdef{@D@}{% + \tikztiming@@chard@{#1}% +} + +\tikztimingcpy{H{D@edge@}@}{HD@} +\tikztimingcpy{L{D@edge@}@}{LD@} +\tikztimingcpy{Z{D@edge@}@}{ZD@} +\tikztimingcpy{T{D@edge@}@}{TD@} + +\tikztimingdef{@DZ}{% + \tikztiming@@chard{#1}% +} +\tikztimingdef{@DH}{% + \tikztiming@@chard{#1}% +} +\tikztimingdef{@DL}{% + \tikztiming@@chard{#1}% +} +\tikztimingdef{@DT}{% + \tikztiming@@chard{#1}% +} + +\tikztimingdef{LD}{ + coordinate [shift={(0,\height/2)}] (timing@ref) + -- ++(\dslope/2, \height/2) + \tikztiming@chard{#1}% } -\tikztimingdef{MG}{ - \newdraw [timing/m] - -- ++(\gslope,-\height/2.0) - -- ++(\gslope,+\height) - -- ++(\gslope,-\height/2.0) + +\tikztimingdef{LDD}{ + coordinate [shift={(0,\height/2)}] (timing@ref) + -- ++(\dslope/2, \height/2) + \tikztiming@chard@{#1} +} + +\tikztimingdef{LDU}{ + coordinate [shift={(0,\height/2)}] (timing@ref) + -- ++(\dslope/2, \height/2) + \tikztiming@chard{#1} +} + +\tikztimingcpy{LUD}{LDU} +\tikztimingcpy{LUU}{LDD} + +\tikztimingdef{HD}{ + coordinate [shift={(0,-\height/2)}] (timing@ref) + -- ++(\dslope/2, -\height/2) + \tikztiming@chard{#1} } -\tikztimingdef{MZ}{ +\tikztimingdef{HDD}{ + coordinate [shift={(0,-\height/2)}] (timing@ref) + -- ++(\dslope/2, -\height/2) + \tikztiming@chard@{#1} +} + +\tikztimingdef{HDU}{ + coordinate [shift={(0,-\height/2)}] (timing@ref) + -- ++(\dslope/2, -\height/2) + \tikztiming@chard{#1} +} +\tikztimingcpy{HUD}{HDU} +\tikztimingcpy{HUU}{HDD} + +\tikztimingecopy{M}{Z} +\tikztimingchar{M}{++(0,\height/2.)}{ \newdraw [\style] - \tikztiminguse{ZZ}{#1} + -- ++(#1,0) + \newdraw [\style/base] } \tikztimingdef{ZM}{ \newdraw [\style] - \tikztiminguse{MM}{#1} + -- ++(#1,0) + \newdraw [\style/base] } \tikztimingdef{LM}{ - \newdraw [\style] + \newdraw [\style/base] -- ++($ (1/8,0) + (0,\height/2) $) - \newdraw [\style/decoration,\style] + \newdraw [\style] -- ++($ (-1/8,0) + (#1,0) $) + \newdraw [\style/base] } \tikztimingdef{HM}{ - \newdraw [\style] + \newdraw [\style/base] -- ++($ (1/8,0) + (0,-1*\height/2) $) - \newdraw [\style/decoration,\style] + \newdraw [\style] -- ++($ (-1/8,0) + (#1,0) $) + \newdraw [\style/base] } \tikztimingdef{DM}{ - -- +($ (1/8,0) + (0,\height*.50) $) - +(0,\height) - -- ++($ (1/8,0) + (0,\height*.50) $) - \newdraw [\style/decoration,\style] - -- ++($ (-1/8,0) + (#1,0) $) + \tikztiming@oldnodecenter@% + \newdraw [\style] + -- ($ (timing@ref) + (#1,0) $) + \newdraw [\style/base] } \newcounter{tikztimingtrans} @@ -1308,6 +2000,7 @@ \tikztimingchar{T}{++(0,0)}{ -- ++(#1,0) } +\def\tikztiming@nocombine@T{}% \tikztimingdef{HT}{% {[\style] @@ -1338,85 +2031,164 @@ \tikztimingdef{TZ}{% \newdraw [\style] \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}} - -- ++(\slope,\value{tikztimingtrans}*\height/2.) - -- ++($ (#1,0) - (\slope,0) $) -} - -\tikztimingdef{TG}{% - -- +(\gslope,-1*\value{tikztimingtrans}*\height) - -- +(\gslope,0) + -- ++(\zslope,\value{tikztimingtrans}*\height/2.) + -- ++($ (#1,0) - (\zslope,0) $) } \tikztimingdef{ZT}{% - \newdraw - {[\style] + \newdraw {[\style] \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}} - -- ++(\slope,\value{tikztimingtrans}*\height/2.) - -- ++($ (#1,0) - (\slope,0) $) + -- ++(\zslope,\value{tikztimingtrans}*\height/2.) + -- ++($ (#1,0) - (\zslope,0) $) } } \tikztimingdef{TT}{% {[\style] \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}} - -- ++(\slope,\value{tikztimingtrans}*\height) -- ++($ (#1,0) - (\slope,0) $) + -- ++(\slope,\value{tikztimingtrans}*\height) + -- ++($ (#1,0) - (\slope,0) $) } } -\tikztimingdef{TD}{ - \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}} - \code{\setcounter{tikztimingtranspos}{\value{tikztimingtrans}}% - \addtocounter{tikztimingtranspos}{-1}} - -- ++(0.5*\dslope,+0.5*\value{tikztimingtrans} * \height) - \tikztiming@trans@D@fill{#1}{0.5*\dslope}% - -- ++(0.5*\dslope,+0.5*\value{tikztimingtrans} * \height) - -- ++($ (#1,0) - (\dslope,0) $) - ++($ -1*(#1,\value{tikztimingtrans}*\height) $) - ++(\dslope/2.,+1*\value{tikztimingtrans}*\height/2.) - -- ++(\dslope/2.,-1*\value{tikztimingtrans}*\height/2.) - -- ++($ (#1,0) - (\dslope,0) $) - ++(0,\value{tikztimingtranspos}*\height/2.) -} - \tikztimingdef{DT}{ \code{\setcounter{tikztimingtrans}{-1}} - \tikztiminguse{DL}{#1}% -} - -\tikztimingdef{MT}{% - \newdraw - {[\style] - -- ++(\slope,\value{tikztimingtrans}*\height/2.) -- ++($ (#1,0) - (\slope,0) $) + \tikztiming@oldnodecenter@% + \newdraw {[\style] + -- +(\dslope/2.,-\height/2) + -- ($ (timing@ref) + (#1,-\height/2) $) } } \tikztimingdef{TM}{% - \newdraw [\style] + \newdraw [\style/base] \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}} -- ++($ (1/8,0) + (0,\value{tikztimingtrans}*\height/2) $) - \newdraw [\style/decoration,\style] + \newdraw [\style] -- ++($ (-1/8,0) + (#1,0) $) + \newdraw [\style/base] } +\tikztimingecopy{C}{T} +\tikztimingecopy{U}{D} -\let\tikztiming@chars@default\tikztiming@chars +\def\tikztiming@triple@U@edge@{}% +\def\tikztiming@nocombine@U@edge@{}% +\def\tikztiming@alias@U@edge@{D@edge@}% +\tikztimingcpy{UU@}{DD@}% -\tikztimingecopy{C}{T} -\def\tikztiming@nocombine@T{}% -\def\tikztiming@nocombine@C{}% -\def\tikztiming@nocombine@t{}% -\def\tikztiming@nocombine@c{}% -\def\tikztiming@nocombine@M{}% -\def\tikztiming@nocombine@m{}% -\def\tikztiming@nocombine@W{}% -\def\tikztiming@nocombine@w{}% +\tikztimingdef{UDU}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard{#1}% +} +\tikztimingcpy{DUD}{UDU}% -\tikztimingecopy{U}{D} -\tikztimingdef{UD}{\tikztiminguse{D@edge@D}{#1}} -\tikztimingdef{DU}{\tikztiminguse{D@edge@D}{#1}} +\tikztimingdef{UDD}{% + \tikztiming@uchardd{#1}% +} + +\tikztimingcpy{{D@edge@}DD}{UDD} +\tikztimingcpy{{U@edge@}UU}{{D@edge@}DD} + +\tikztimingdef{H{D@edge@}}{ + coordinate [shift={(0,-\height/2)}] (timing@ref) + -- ++(\dslope/2, -\height/2) + \tikztiming@chard{#1}% +} + +\tikztimingdef{L{D@edge@}}{ + coordinate [shift={(0,\height/2)}] (timing@ref) + -- ++(\dslope/2, \height/2) + \tikztiming@chard{#1}% +} + +\tikztimingdef{Z{D@edge@}}{ + coordinate (timing@ref) + \tikztiming@chard{#1}% +} + +\tikztimingdef{T{D@edge@}}{ + \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}} + coordinate [shift={(0,\height/2 * \value{tikztimingtrans})}] (timing@ref) + -- ++(\dslope/2, \height/2 * \value{tikztimingtrans}) + \tikztiming@chard{#1}% +} + +\tikztimingdef{{D@edge@}DU}{ + \tikztiming@oldnodecenter@ + \tikztiming@chard{#1} +} +\tikztimingcpy{{U@edge@}UD}{{D@edge@}DU} + +\tikztimingdef{DDU}{% + \tikztiming@dchardu{#1} +} + +\tikztimingcpy{DUU}{UDD}% +\tikztimingcpy{UUD}{DDU}% + +\tikztimingdef{@UU}{% + \tikztiming@@chard@{#1}% +} + +\tikztimingdef{@UD}{% + \tikztiming@@chard{#1}% +} + +\tikztimingdef{@DU}{% + \tikztiming@@chard{#1}% +} + +\tikztimingdef{UD}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard{#1}% +} + +\tikztimingdef{DU}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard{#1}% +} + +\tikztimingdef{UD@}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard@{#1}% +} + +\tikztimingdef{DU@}{% + \tikztiming@oldnodecenter@% + \tikztiming@chard@{#1}% +} \tikztimingecopy{X}{Z} +\let\tikztiming@chars@default\tikztiming@chars +\newcommand*\usetikztiminglibrary[2][]{% + \edef\tikztiming@library@options{#1}% + \@ifnextchar{[}%] + {\tikztiming@library{#2}}% + {\tikztiming@library{#2}[]}% +} +\def\tikztiming@library#1[#2]{% + \edef\tikztiming@library@date{#2}% + \tikztiming@library@#1,\relax +} +\def\tikztiming@zap@space#1 \@empty{#1} +\def\tikztiming@library@#1,{% + \IfFileExists{tikz-timing-#1.sty}% + { \let\tikztiming@orig@zap@space\zap@space + \let\zap@space\tikztiming@zap@space + \RequirePackage + [\tikztiming@library@options]% + {tikz-timing-#1}% + [\tikztiming@library@date]% + \let\zap@space\tikztiming@orig@zap@space + }% + {\PackageError{tikz-timing}% + {No tikz-timing library `#1' found!}% + {}{}{}{}% + }% + \@ifnextchar\relax{}{\tikztiming@library@}% +} \endinput %% %% End of file `tikz-timing.sty'. |