From 01294f46bb60e2b571fe1cc4b8a4428366240d8b Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 31 Dec 2009 01:26:26 +0000
Subject: tikz-timing update (30dec09)

git-svn-id: svn://tug.org/texlive/trunk@16537 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/latex/tikz-timing/tikz-timing.sty          | 322 ++++++++++++++-------
 1 file changed, 212 insertions(+), 110 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty')

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 d2ff15dc603..3e947a5e3a5 100644
--- a/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty
+++ b/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty
@@ -27,11 +27,10 @@
 %% 
 \RequirePackage{svn-prov}[2009/05/03]
 \ProvidesPackageSVN
-  {$Id: tikz-timing.dtx 1580 2009-12-09 11:14:01Z martin $}
-  [v0.7
+  {$Id: tikz-timing.dtx 1647 2009-12-28 14:18:14Z martin $}
+  [v0.7a
    Digital Timing Diagrams using TikZ]
 \DefineFileInfoSVN[tikztiming]
-
 \RequirePackage{tikz}
 
 \usetikzlibrary{calc}
@@ -54,8 +53,10 @@
 \let\tikztiming@back\empty
 \newlength\tikztiming@xunit
 \newlength\tikztiming@yunit
-\setlength{\tikztiming@xunit}{1.6ex}%
-\setlength{\tikztiming@yunit}{1.6ex}%
+\def\tikztiming@@xunit{1.6ex}%
+\def\tikztiming@@yunit{1.6ex}%
+\setlength{\tikztiming@xunit}{\tikztiming@@xunit}%
+\setlength{\tikztiming@yunit}{\tikztiming@@yunit}%
 
 \def\tikztiming@setnum#1{%
   \pgfmathparse{#1}%
@@ -81,7 +82,7 @@
 \def\timingheight{1}%
 
 \tikzset{%
-  timing/.style={%
+  timing/.style={/tikz,
     line cap=round, line join=round,
     timing/adjust@xy
   },%
@@ -91,10 +92,33 @@
   adjust@xy/.style={%
     /utils/exec={%
       \tikz@textfont
-      \setlength{\tikztiming@xunit}{1.6ex}%
-      \setlength{\tikztiming@yunit}{1.6ex}%
+      \let\@tempa\fsize
+      \let\fsize\@tempdima
+      \fsize=\f@size pt\relax
+      \pgfmathsetlength{\tikztiming@xunit}{\tikztiming@@xunit}%
+      \pgfmathsetlength{\tikztiming@yunit}{\tikztiming@@yunit}%
+      \let\fsize\@tempa
+    },%
+    /tikz/x=\tikztiming@xunit, /tikz/y=\tikztiming@yunit,
+  },
+  unit/.style={%
+    /utils/exec={%
+      \def\tikztiming@@xunit{#1}%
+      \let\tikztiming@@yunit\tikztiming@@xunit
+    },%
+    /tikz/timing/adjust@xy,%
+  },
+  xunit/.style={%
+    /utils/exec={%
+      \def\tikztiming@@xunit{#1}%
+    },%
+    /tikz/timing/adjust@xy,%
+  },
+  yunit/.style={%
+    /utils/exec={%
+      \def\tikztiming@@yunit{#1}%
     },%
-    /tikz/x=1.6ex, /tikz/y=1.6ex,
+    /tikz/timing/adjust@xy,%
   },
   font/.style={%
     /tikz/font={#1},
@@ -127,6 +151,8 @@
   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{}}},
+  popoptions/.style={/utils/exec={\tikztiming@popoptions}},
+  pushoptions/.style={/utils/exec={\tikztiming@pushoptions}},
   name/.style={inner sep=0pt,outer sep=0pt,minimum size=0pt},
   text format/.store in=\tikztiming@textformat,
   @/.style={},
@@ -184,6 +210,8 @@
   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},
+  table/label header/.style={},
+  table/row header/.style={},
   slope/.code={%
     \tikztimingsetslope{#1}%
     \tikztimingsetdslope{2*#1}%
@@ -270,8 +298,8 @@
       \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@ref)  at (0,\timingheight/2)
+        coordinate (timing@refb) at (0,\timingheight)
         coordinate (timing/start)
         coordinate (timing/start base)
     }%
@@ -337,6 +365,13 @@
       \fi
       \tikzset{timing/before}%
       \tikztiming@str;%
+      \path let \p1 = (timing/end top), \p2 = (timing/end base),
+                \p3 = (timing/end), \p4 = (timing/start) in
+          [/utils/exec={%
+            \xdef\tikztiming@northeast{\noexpand\pgfpoint{.5*\pgf@pt@aa*\x1}{.5*\pgf@pt@bb*\y1}}%
+            \xdef\tikztiming@startpoint{\noexpand\pgfpoint{\pgf@pt@aa*(\x4-.5*\x1)}{\pgf@pt@bb*(\y4-.5*\y1)}}%
+            \xdef\tikztiming@endpoint{\noexpand\pgfpoint{\pgf@pt@aa*(\x3-.5*\x1)}{\pgf@pt@bb*(\y3-.5*\y1)}}%
+          }];
       \node [shape=tikztiming@shape,anchor=origin,#1] at (0,0) {};
       \tikzset{timing/after}%
     \end{scope}%
@@ -614,9 +649,9 @@
   \tikztiming@output@flush
   \global\let\tikztimingwidth\tikztimingwidth
   \tikztiming@addtostr{ coordinate (timing/end)
-    let \p1 = (timing/start base), \p2 = (timing/end) in
+    let \p1 = (timing/start base), \p2 = (timing/end), \p3 = (0,1) in
       coordinate (timing/end base) at (\x2,\y1)
-      coordinate (timing/end top)  at (\x2,1+\y1)
+      coordinate (timing/end top)  at (\x2,\y1+\y3)
   }%
   \endgroup
   \tikztiming@endhook%
@@ -641,8 +676,13 @@
     \tikztiming@output{\tikztiming@lastchar}{\tikztiming@currentchar}%
     \global\let\tikztiming@lastchar\tikztiming@currentchar
     \@nameuse{tikztiming@aftercode@\tikztiming@currentchar}%
-    \expandafter
-    \tikztiming@testfortext
+    \expandafter\lowercase\expandafter{%
+      \expandafter\def\expandafter\@tempa
+      \expandafter{\tikztiming@currentchar}%
+    }%
+    \pgfkeysifdefined{/tikz/timing/\@tempa/text/.@cmd}%
+      {\expandafter\expandafter\expandafter\tikztiming@testfortext}%
+      {\expandafter\expandafter\expandafter\tikztiming@parser}%
   \fi
 }
 \def\tikztiming@testfortext{%
@@ -672,32 +712,25 @@
     \expandafter\def\expandafter\@tempa
     \expandafter{\tikztiming@currentchar}%
   }%
-  \pgfkeysifdefined{/tikz/timing/\@tempa/text/.@cmd}%
-  {%
-    \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
+  \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%
-      \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
-    '\tikztiming@currentchar'!}{}{}{}%
-  }%
+  \relax
+  \else
+  \fi
+  \xdef\tikztiming@output@bufcharb{\tikztiming@currentchar @edge@}%
+  \xdef\tikztiming@lastchar{\tikztiming@currentchar @edge@}%
   \tikztiming@parser
 }
 \let\tikztiming@textformat\empty
@@ -790,6 +823,37 @@
   \tikztiming@output@addcode{ [#1] }%
   \tikztiming@parser
 }
+\tikztiming@defcode{\bgroup}{%
+  \tikztiming@output@eaddcode{%
+    [timing/pushoptions]
+    \newdraw
+  }%
+  \tikztiming@parser
+}
+\tikztiming@defcode{\egroup}{%
+  \tikztiming@output@eaddcode{%
+    [timing/popoptions]
+    \newdraw
+  }%
+  \tikztiming@parser
+}
+\def\tikztiming@popoptions{%
+  \expandafter\tikztiming@popoptions@\tikztiming@optionstack\relax
+}
+\def\tikztiming@optionstack{{}}
+\def\tikztiming@popoptions@#1#2\relax{%
+  \gdef\tikztiming@saved@options{#1}%
+  \gdef\tikztiming@optionstack{#2}%
+  \ifx\tikztiming@optionstack\empty
+    \gdef\tikztiming@optionstack{{}}%
+  \fi
+}
+\def\tikztiming@pushoptions{%
+  \expandafter\expandafter\expandafter\gdef
+  \expandafter\expandafter\expandafter\tikztiming@optionstack
+  \expandafter\expandafter\expandafter{%
+  \expandafter\expandafter\expandafter{\expandafter\tikztiming@saved@options\expandafter}\tikztiming@optionstack}%
+}
 \def\tikztiming@addnode@getoptions[#1]{%
   \@ifnextchar(%)
     {\tikztiming@addnode@getname{#1}}%
@@ -975,6 +1039,10 @@
       \endcsname\expandafter[#2]{#3}%
     \fi
   \fi
+  \ifnum\tikztiming@debug=-1
+    \message{^^J Defined meta-char '#1' as:
+      \expandafter\meaning\csname tikztiming@metachar@\meaning#1\endcsname ^^J}%
+  \fi
 }
 \def\if@tikztiming@metachar#1#2{%
   \@ifundefined{tikztiming@metachar@\meaning\@let@token}{#2}{#1}%
@@ -1001,10 +1069,11 @@
   \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 (timing/table/top left) at (0,1);
-    \coordinate (timing/table/bottom right) at (0,0);
+    \coordinate (@last row)  at (0,\rowdist);
+    \coordinate (label@header)   at (-1*{(\tikztiming@coldist)},1.5*{(\tikztiming@rowdist)});
+    \coordinate (diagram@header) at (0,1.5*{(\tikztiming@rowdist)});
+    \coordinate (timing@table@bottom right) at (0,0);
+    \coordinate (timing@table@bottom left)  at (-1*{(\tikztiming@coldist)},0);
     \tikztiming@picinit
     \tikzset{timing/before table}%
     \tikztimingtable@checkrow
@@ -1014,15 +1083,30 @@
   \endgroup
 }
 \def\tikztiming@extracode{%
-  \path let
-     \p1 = (timing/table/top left),
-     \p2 = (timing/table/bottom right)
-   in
-     coordinate (timing/table/bottom left) at (\x1,\y2)
-     coordinate (timing/table/top right) at (\x2,\y1)
-     coordinate (timing/table/size) at (\x2-\x1,\y1-\y2)
-   ;
-   \@ifnextchar[{\tikztiming@oset}{}
+  \path
+    let
+      \p1 = (row1.north west),
+      \p2 = (timing@table@bottom right),
+      \p3 = (\pgf@pt@aa * {(\x2-\x1)},\pgf@pt@bb * {(\y1-\y2)})
+    in
+      node [shape=rectangle,anchor=north west,
+            minimum width=\x3,minimum height=\y3,
+            inner sep=0pt,outer sep=0pt]
+        at (\x1,\y1) (all rows) {}
+    ;
+  \path
+    let
+      \p0 = (-1*{(\tikztiming@coldist)},1),
+      \p1 = (label1.north east),
+      \p2 = (timing@table@bottom left),
+      \p3 = (\pgf@pt@aa * {(\x0-\x2)},\pgf@pt@bb * {(\y1-\y2)})
+    in
+      node [shape=rectangle,anchor=north east,
+            minimum width=\x3,minimum height=\y3,
+            inner sep=0pt,outer sep=0pt]
+        at (\x1,\y1) (all labels) {}
+    ;
+   \@ifnextchar[{\tikztiming@oset}{}%
 }
 \def\tikztiming@endextracode{%
   \@ifnextchar\@checkend
@@ -1089,15 +1173,18 @@
 }%
 \long\def\tikztimingtable@row@@#1#2{%
   \addtocounter{tikztiming@nrows}{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};
+  \coordinate (@last row) at ($ (@last row) - (0,\tikztiming@rowdist) $);
+  \node [anchor=base east,timing/name,alias=last label] (label\the\c@tikztiming@nrows)
+    at ($ (@last row) - (\tikztiming@coldist,0) $) {\ignorespaces #1\unskip\strut};
+  \path let \p1 = (timing@table@bottom left), \p2 = (last label.south west) in
+    coordinate (timing@table@bottom left) at ({min(\x1,\x2)},\y2);
+  %
   \@ifnextchar{[}%
     {\tikztiming@tabletiming}%
     {\tikztiming@tabletiming[]}%
   #2\relax
-  \path let \p1 = (timing/table/bottom right), \p2 = (timing/end base) in
-    coordinate (timing/table/bottom right) at ({max(\x1,\x2)},\y2);
+  \path let \p1 = (timing@table@bottom right), \p2 = (timing/end base) in
+    coordinate (timing@table@bottom right) at ({max(\x1,\x2)},\y2);
   %
   \pgfmathparse{max(\tikztiming@maxwidth,\tikztimingwidth)}%
   \let\tikztiming@maxwidth\pgfmathresult
@@ -1113,24 +1200,24 @@
   \ifx\tikztiming@lastchar\empty
     \def\tikztiming@lastchar{@}%
   \fi
-  \edef\@tempa{\noexpand\timing[name=row\the\c@tikztiming@nrows,\tikztiming@settings]
-    at (last row)}%
+  \edef\@tempa{\noexpand\timing
+    [name=row\the\c@tikztiming@nrows,alias=last row,%
+     \expandafter\unexpanded\expandafter{\tikztiming@settings}] at (@last row)}%
   \expandafter\@tempa\expandafter{\expandafter[\tikztiming@lastchar]#2};
 }
 
 \newcommand*\tikztiming@fulltablegrid[1][]{%
   \begin{pgfonlayer}{background}
     \scope[xstep={\timingwidth/2.},ystep={\timingheight/2.},
-    shift={(timing/table/bottom left)},timing/table/grid,#1]
-      \draw (0,0) grid
-        ($ (timing/table/top right) - (timing/table/bottom left) $);
+      shift={(all rows.south west)},timing/table/grid,#1]
+      \draw (0,0) grid ($ (all rows.north east) - (all rows.south west) $);
    \endscope
   \end{pgfonlayer}
 }
 \def\tikztiming@tablegrid{%
   \@ifnextchar{*}%
     {\tikztiming@tablegrid@{row\row.high end}}%
-    {\tikztiming@tablegrid@{timing/table/top right}}%
+    {\tikztiming@tablegrid@{all rows.north east}}%
 }
 \def\tikztiming@tablegrid@#1{%
   \@ifnextchar{[}%]
@@ -1147,13 +1234,40 @@
     \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}
-  ;
+\def\tikztiming@tableheader{%
+  \@ifnextchar[%]
+    {\tikztiming@tableheader@}%
+    {\tikztiming@tableheader@@{}[]}%
+}
+\def\tikztiming@tableheader@[#1]{%
+  \@ifnextchar[%]
+    {\tikztiming@tableheader@@{#1}}%
+    {\tikztiming@tableheader@@{#1}[]}%
+}
+\def\tikztiming@tableheader@@#1[#2]#3{%
+  \@ifnextchar[%]
+    {\tikztiming@tableheader@@@{#1}{#2}{#3}}%
+    {\tikztiming@tableheader@@@{#1}{#2}{#3}[]}%
+}
+\def\tikztiming@tableheader@@@#1#2#3[#4]#5{%
+  \path
+    let
+        \p1 = (label@header),
+        \p2 = (all labels.east),
+        \p3 = (all labels.west)
+     in
+        (\x2,\y1) -- node [pos=0,anchor=base east,timing/table/header,timing/table/label header,#1,#2]
+          (label header)   {\ignorespaces #3\unskip\strut} (\x3,\y1)
+     ;
+  \path
+    let
+        \p4 = (diagram@header),
+        \p5 = (all rows.west),
+        \p6 = (all rows.east)
+     in
+        (\x5,\y4) -- node [pos=0,anchor=base west,timing/table/header,timing/table/row header,#1,#4]
+          (row header) {\ignorespaces #5\unskip\strut} (\x6,\y4)
+     ;
   \tikztiming@tableheadtrue
 }
 \newif\iftikztiming@tablehead
@@ -1166,7 +1280,7 @@
     let
       \p1 = (NW),
       \p2 = (SE),
-      \p3 = (last row)
+      \p3 = (@last row)
     in
       ($ (\x1-\tabcolsep,\y3) - (0,.5*{(\rowdist)}) $) --
       ($ (\x2+\tabcolsep,\y3) - (0,.5*{(\rowdist)}) $)
@@ -1192,7 +1306,7 @@
     \fi
     \foreach \row in \list {%
       \draw [timing/table/lines,#1] let
-        \p1 = (timing/table/bottom right)
+        \p1 = (all rows.south east)
       in
         ($ (0,\rowdist) -  (0,\row * {(\rowdist)}) $) -- +(\x1,0);
     }%
@@ -1205,7 +1319,7 @@
       \def\list{0,1,...,\twidth}%
     \fi
     \draw [timing/table/lines,#1] let
-        \p1 = ($ (timing/table/bottom right) - (0,2) $)
+        \p1 = ($ (all rows.south east) - (0,2) $)
       in
         \foreach \clk in \list {
           (\clk,+1.5) -- +(0,\y1)
@@ -1214,24 +1328,9 @@
   \endgroup
 }
 \pgfdeclareshape{tikztiming@shape}{%
-  \savedanchor\northeast{\pgfpointxy{.5*\tikztimingwidth}{.5}}%
-  \savedanchor\northeastborder{\pgfpointxy{.5*\tikztimingwidth+0.1}{.6}}%
-  \savedanchor\startpoint{%
-    \pgfpointanchor{timing/start}{center}%
-    \@tempdima=\pgf@x
-    \@tempdimb=\pgf@y
-    \pgfpointxy{-.5*\tikztimingwidth}{-.5}%
-    \advance\pgf@x by \@tempdima
-    \advance\pgf@y by \@tempdimb
-  }%
-  \savedanchor\endpoint{%
-    \pgfpointanchor{timing/end}{center}%
-    \@tempdima=\pgf@x
-    \@tempdimb=\pgf@y
-    \pgfpointxy{-.5*\tikztimingwidth}{-.5}%
-    \advance\pgf@x by \@tempdima
-    \advance\pgf@y by \@tempdimb
-  }%
+  \savedanchor\northeast{\tikztiming@northeast}%
+  \savedanchor\startpoint{\tikztiming@startpoint}%
+  \savedanchor\endpoint{\tikztiming@endpoint}%
   \anchor{center}{\pgfpointorigin}%
   \anchor{start}{\startpoint}%
   \anchor{end}{\endpoint}%
@@ -1262,7 +1361,7 @@
   \anchorborder{%
     \@tempdima=\pgf@x
     \@tempdimb=\pgf@y
-    \pgfpointborderrectangle{\pgfpoint{\@tempdima}{\@tempdimb}}{\northeastborder}%
+    \pgfpointborderrectangle{\pgfpoint{\@tempdima}{\@tempdimb}}{\northeast}%
   }%
 }
 \gdef\tikztiming@oldnodecenter@{}%
@@ -1405,6 +1504,9 @@
   \csname tikztiming@nocombine@#1\expandafter\endcsname
   \csname tikztiming@nocombine@#2\endcsname
 }
+\def\tikztiming@setref#1#2{%
+  coordinate (#1) coordinate (#1) at ([shift={(#2)}]#1)
+}
 \def\tikztiming@newdraw{%
   node [timing/save] (timing@save) {};%
   \draw [timing/restore] (timing@save) ++(0,0)
@@ -1594,7 +1696,7 @@
   --  (timing@save)
       ($ (timing@ref) + (#1,0) $)
      coordinate (timing@ref)
-     coordinate [shift={(\dslope/2,0)}] (timing@dend)
+     \tikztiming@setref{timing@dend}{\dslope/2,0}
   \tikztiming@oldnodecenter{%
     (0,-\height/2)
   }%
@@ -1642,14 +1744,14 @@
      +(0,0)
      coordinate (timing/start)
      coordinate (timing@ref)
-     coordinate [shift={(-\dslope/2,0)}] (timing@dstart)
+     \tikztiming@setref{timing@dstart}{-\dslope/2,0}
      +(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@setref{timing@dend}{\dslope/2,0}
   \tikztiming@oldnodecenter{%
     (0,-\height/2)
   }%
@@ -1728,7 +1830,7 @@
   --  ($ (timing@save) + (0,-\height/2) $)
       ($ (timing@ref) + (#1,0) $)
     coordinate (timing@ref)
-    coordinate [shift={(\dslope/2,0)}] (timing@dend)
+    \tikztiming@setref{timing@dend}{\dslope/2,0}
   \tikztiming@oldnodecenter{%
     (0,-\height/2)
   }%
@@ -1850,34 +1952,34 @@
 }
 
 \tikztimingdef{HD@}{%
-  coordinate [shift={(0,-\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,-\height/2}
   -- ++(\dslope/2, -\height/2)
   \tikztiming@chard@{#1}%
 }
 
 \tikztimingdef{TD@}{%
-  coordinate [shift={(0,-\height/2 * \value{tikztimingtrans})}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,-\height/2 * \value{tikztimingtrans}}
   -- ++(\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)
+  \tikztiming@setref{timing@ref}{0,\height/2 * \value{tikztimingtrans}}
   -- ++(\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)
+  \tikztiming@setref{timing@ref}{0,\height/2 * \value{tikztimingtrans}}
   -- ++(\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)
+  \tikztiming@setref{timing@ref}{0,\height/2 * \value{tikztimingtrans}}
   -- ++(\dslope/2, \height/2 * \value{tikztimingtrans})
   \tikztiming@chard{#1}%
 }
@@ -1886,7 +1988,7 @@
 \tikztimingcpy{TUU}{TDD}
 
 \tikztimingdef{LD@}{%
-  coordinate [shift={(0,\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,\height/2}
   -- ++(\dslope/2, \height/2)
   \tikztiming@chard@{#1}%
 }
@@ -1918,19 +2020,19 @@
 }
 
 \tikztimingdef{LD}{
-  coordinate [shift={(0,\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,\height/2}
   -- ++(\dslope/2, \height/2)
   \tikztiming@chard{#1}%
 }
 
 \tikztimingdef{LDD}{
-  coordinate [shift={(0,\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,\height/2}
   -- ++(\dslope/2, \height/2)
   \tikztiming@chard@{#1}
 }
 
 \tikztimingdef{LDU}{
-  coordinate [shift={(0,\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,\height/2}
   -- ++(\dslope/2, \height/2)
   \tikztiming@chard{#1}
 }
@@ -1939,19 +2041,19 @@
 \tikztimingcpy{LUU}{LDD}
 
 \tikztimingdef{HD}{
-  coordinate [shift={(0,-\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,-\height/2}
   -- ++(\dslope/2, -\height/2)
   \tikztiming@chard{#1}
 }
 
 \tikztimingdef{HDD}{
-  coordinate [shift={(0,-\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,-\height/2}
   -- ++(\dslope/2, -\height/2)
   \tikztiming@chard@{#1}
 }
 
 \tikztimingdef{HDU}{
-  coordinate [shift={(0,-\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,-\height/2}
   -- ++(\dslope/2, -\height/2)
   \tikztiming@chard{#1}
 }
@@ -2091,13 +2193,13 @@
 \tikztimingcpy{{U@edge@}UU}{{D@edge@}DD}
 
 \tikztimingdef{H{D@edge@}}{
-  coordinate [shift={(0,-\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,-\height/2}
   -- ++(\dslope/2, -\height/2)
   \tikztiming@chard{#1}%
 }
 
 \tikztimingdef{L{D@edge@}}{
-  coordinate [shift={(0,\height/2)}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,\height/2}
   -- ++(\dslope/2, \height/2)
   \tikztiming@chard{#1}%
 }
@@ -2109,7 +2211,7 @@
 
 \tikztimingdef{T{D@edge@}}{
   \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}}
-  coordinate [shift={(0,\height/2 * \value{tikztimingtrans})}] (timing@ref)
+  \tikztiming@setref{timing@ref}{0,\height/2 * \value{tikztimingtrans}}
   -- ++(\dslope/2, \height/2 * \value{tikztimingtrans})
   \tikztiming@chard{#1}%
 }
-- 
cgit v1.2.3

