From c56b93f86ac9c40c9edaceb99404ef79dd4107b7 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Mon, 11 Dec 2017 22:21:38 +0000
Subject: tikz-timing (11dec17)

git-svn-id: svn://tug.org/texlive/trunk@46035 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/latex/tikz-timing/tikz-timing.sty          | 182 +++++++++++++--------
 1 file changed, 110 insertions(+), 72 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 86b08a0a43d..428fd1c9857 100644
--- a/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty
+++ b/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing.sty
@@ -4,33 +4,44 @@
 %%
 %% The original source files were:
 %%
-%% tikz-timing.dtx  (with options: `package')
+%% tikz-timing.dtx  (with options: `tikz-timing.sty')
 %% 
-%% Copyright (C) 2009-2011 by Martin Scharrer <martin@scharrer-online.de>
+%% IMPORTANT NOTICE:
 %% 
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3c
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
+%% For the copyright see the source file.
 %% 
-%%    http://www.latex-project.org/lppl.txt
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from tikz-timing.sty.
 %% 
-%% and version 1.3c or later is part of all distributions of LaTeX
-%% version 2008/05/04 or later.
+%% For distribution of the original source see the terms
+%% for copying and modification in the file tikz-timing.dtx.
 %% 
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+%% Copyright (C) 2009-2012 by Martin Scharrer <martin@scharrer-online.de>
+%% ----------------------------------------------------------------------
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
 %% This work has the LPPL maintenance status `maintained'.
-%% 
+%%
 %% The Current Maintainer of this work is Martin Scharrer.
-%% 
-%% This work consists of the files tikz-timing.dtx, tikz-timing.ins
-%% and the derived file tikz-timing.sty.
-%% 
-\RequirePackage{svn-prov}[2009/05/03]
-\ProvidesPackageSVN
-  {$Id: tikz-timing.dtx 2038 2011-01-09 20:44:26Z martin $}
-  [v0.7d
-   Digital Timing Diagrams using TikZ]
-\DefineFileInfoSVN[tikztiming]
+%%
+%% This work consists of the files tikz-timing.dtx and tikz-timing.ins
+%% and the derived filebase tikz-timing*.sty.
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{tikz-timing}[%
+    2017/12/10
+    v0.7e
+    Digital Timing Diagrams using TikZ]
 \RequirePackage{tikz}
 
 \usetikzlibrary{calc}
@@ -159,6 +170,8 @@
   name/.style={inner sep=0pt,outer sep=0pt,minimum size=0pt},
   text format/.store in=\tikztiming@textformat,
   @/.style={},
+  every char/.style={},
+  every bg/.style={},
   D/.style={timing/d},
   D/text/.style={timing/d/text},
   D/background/.style={timing/d/background},
@@ -297,9 +310,9 @@
     \def\tikztimingwidth{0.0}%
     \setcounter{tikztimingtrans}{-1}%
     \setcounter{tikztimingtranspos}{0}%
-    \def\tikztiming@str{%
+    \tikztiming@initstr{%
       \useasboundingbox (0,0) rectangle (\tikztimingwidth,\timingheight);
-      \draw (0,0)
+      \draw [timing/every char] (0,0)
         coordinate (timing@refa)
         coordinate (timing@ref)  at (0,\timingheight/2)
         coordinate (timing@refb) at (0,\timingheight)
@@ -349,23 +362,6 @@
         {\tikz@timing@@@init}%
         {\tikz@timing@@@init[]}%
       #3\relax
-      \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;%
       \path let \p1 = (timing/end top), \p2 = (timing/end base),
@@ -403,7 +399,9 @@
   \tikztiming@parser
 }
 \def\tikztiming@trans@#1#2#3#4{%
-  \csname\tikztiming@prefix #2#3#4\endcsname{#1}{#2}{#3}{#4}%
+    \unexpanded\expandafter\expandafter\expandafter{%
+        \csname\tikztiming@prefix #2#3#4\endcsname{#1}{#2}{#3}{#4}
+    }%
 }
 \def\tikztiming@beforenextcode@D@edge@{%
   \if D\tikztiming@currentchar\else
@@ -439,12 +437,47 @@
     }%
   \endgroup
 }
+\iftrue
+\long\def\tikztiming@initstr{%
+    \def\tikztiming@str
+}
 \def\tikztiming@eaddtostr{%
   \tikztiming@eaddto\tikztiming@str
 }
 \def\tikztiming@addtostr{%
   \g@addto@macro\tikztiming@str
 }
+\else
+\def\tikztiming@file{\jobname.ttg}
+\newwrite\tikztiming@fh
+\def\tikztiming@str{%
+    \tikztiming@addtostr{;}%
+    \immediate\closeout\tikztiming@fh
+    \begingroup
+    \makeatletter
+    \@@input\tikztiming@file\relax
+    \endgroup
+    \@ifnextchar;{\@gobble}{}%
+}
+\long\def\tikztiming@initstr{%
+    \immediate\openout\tikztiming@fh= \tikztiming@file\relax
+    \tikztiming@addtostr
+}
+\long\def\tikztiming@eaddtostr#1{%
+  \begingroup
+    \tikztiming@internaldefs
+    \let\par\empty
+    \immediate\write\tikztiming@fh{#1}%
+  \endgroup
+}
+\long\def\tikztiming@addtostr#1{%
+  \begingroup
+    \tikztiming@internaldefs
+    \let\par\empty
+    \immediate\write\tikztiming@fh{\unexpanded{#1}}%
+  \endgroup
+}
+\fi
 \def\tikztiming@makeglobal#1{%
   \global\let#1#1\relax\relax
 }
@@ -473,17 +506,17 @@
     % 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}}%
+        {\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}}%
+        {\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,}}%
+           {\edef\charc{{#3},}}%
+           {\edef\charc{{#3},{\csname tikztiming@alias@#3\endcsname},}}%
         }%
       \ifx\charb\empty
         \def\charb{\empty}%
@@ -533,10 +566,13 @@
 \def\tikztiming@nameaddtostr#1#2#3{%
   \tikztiming@iftrans{{#1}{#2}{#3}}%
    {%
+     %\edef\@tempa{\noexpand\tikztiming@trans@{\tikztiming@num}\tikztiming@trans}%
+     %\expandafter\tikztiming@addtostr
+     %\expandafter{\@tempa}%
      \edef\@tempa{\noexpand\tikztiming@trans@{\tikztiming@num}\tikztiming@trans}%
-     \expandafter\g@addto@macro
-     \expandafter\tikztiming@str
-     \expandafter{\@tempa}%
+     %\tikztiming@eaddtostr{\@percentchar\space {#1}{#2}{#3}}%
+     \tikztiming@eaddtostr{\@tempa}%
+     %\tikztiming@eaddtostr{\tikztiming@trans@{\tikztiming@num}\tikztiming@trans}%
    }%
    {\PackageWarning{tikz-timing}{No transitions '#1#2' (or '#1#2#3') defined!}}%
 }
@@ -606,8 +642,10 @@
   \tikztiming@output@codeflush
 }
 \def\tikztiming@output@codeflush{%
-  \tikztiming@eaddtostr{\tikztiming@output@bufcode}%
-  \global\let\tikztiming@output@bufcode\empty%
+  \ifx\tikztiming@output@bufcode\empty\else
+    \tikztiming@eaddtostr{\tikztiming@output@bufcode}%
+    \global\let\tikztiming@output@bufcode\empty%
+  \fi
 }
 \def\tikztiming@output@charflush{%
   \begingroup
@@ -758,14 +796,14 @@
 }
 \tikztiming@defcode{,}{%
   \tikztiming@output@eaddcode{%
-    \newdraw
+    \newdraw [timing/every char]
   }%
   \tikztiming@parser
 }
 \tikztiming@defcode{;}{%
   \endgroup\begingroup
   \tikztiming@output@eaddcode{%
-    \newdrawns
+    \newdrawns [timing/every char]
   }%
   \tikztiming@parser
 }
@@ -829,14 +867,14 @@
 \tikztiming@defcode{\bgroup}{%
   \tikztiming@output@eaddcode{%
     [timing/pushoptions]
-    \newdraw
+    \newdraw [timing/every char]
   }%
   \tikztiming@parser
 }
 \tikztiming@defcode{\egroup}{%
   \tikztiming@output@eaddcode{%
     [timing/popoptions]
-    \newdraw
+    \newdraw [timing/every char]
   }%
   \tikztiming@parser
 }
@@ -1422,9 +1460,9 @@
   \def\zslope{\noexpand\timingzslope}%
   \def\dslope{\noexpand\timingdslope}%
   \def\gslope{0}%
-  \def\style{timing/####3}%
-  \def\bgstyle{draw=none,timing/####3/background}%
-  \def\nstyle{timing/####4}%
+  \def\style{timing/every char,timing/####3}%
+  \def\bgstyle{draw=none,timing/every bg,timing/####3/background}%
+  \def\nstyle{timing/every char,timing/####4}%
   \def\newdraw{\tikztiming@newdraw}%
   \def\newdrawns{\tikztiming@newdraw@nosave}%
   \def\code##1{ [/utils/exec={\unexpanded{##1}}] }%
@@ -1576,11 +1614,11 @@
 }
 
 \def\tikztiming@glitch{%
-  {[timing/g] let \p1 = +(0,0) in (\x1,0) -- (\x1,\timingheight)
+  {[timing/every char,timing/g] let \p1 = +(0,0) in (\x1,0) -- (\x1,\timingheight)
    coordinate (timing@dstart) at (\x1,\timingheight/2) (\x1,\y1)
   }%
 }
-\tikztimingchar{H}{++(0,\height)}{-- ++(#1,0)}
+\tikztimingchar{H}{++(0,\height)}{[\style] -- ++(#1,0)}
 
 \tikztimingdef{HH}{
   -- ++(#1,0)
@@ -1592,7 +1630,7 @@
 }
 
 \tikztimingdef{ZH}{
-    \newdraw
+    \newdraw [\style]
   -- ++(\zslope,+\height/2.)
   -- ++($ (#1,0) - (\zslope,0) $)
 }
@@ -1612,7 +1650,7 @@
 }
 
 
-\tikztimingchar{L}{++(0,0)}{-- ++(#1,0)}
+\tikztimingchar{L}{++(0,0)}{[\style] -- ++(#1,0)}
 
 \tikztimingchar{Z}{++(0,\height/2.)}{%
   \newdraw [\style]
@@ -1667,7 +1705,7 @@
   -- ++($ (#1,0) - (\zslope,0) $)
 }
 \tikztimingdef{ZL}{%
-  \newdraw
+  \newdraw [\style]
   -- ++(\zslope,-\height/2.)
   -- ++($ (#1,0) - (\zslope,0) $)
 }
@@ -1694,7 +1732,7 @@
   \tikztiming@oldnodecenter{%
     (-\dslope/2,-\height/2)
   }%
-  \newdraw
+  \newdraw [timing/every char]
 }
 
 \def\tikztiming@chard@#1{%
@@ -1717,7 +1755,7 @@
   \tikztiming@oldnodecenter{%
     (0,-\height/2)
   }%
-  \newdraw
+  \newdraw [timing/every char]
 }
 
 \def\tikztiming@@chard#1{%
@@ -1746,7 +1784,7 @@
   \tikztiming@oldnodecenter{%
     (-\dslope/2,-\height/2)
   }%
-  \newdraw
+  \newdraw [timing/every char]
 }
 
 \def\tikztiming@@chard@#1{%
@@ -1772,7 +1810,7 @@
   \tikztiming@oldnodecenter{%
     (0,-\height/2)
   }%
-  \newdraw
+  \newdraw [timing/every char]
 }
 
 \def\tikztiming@dchardu#1{%
@@ -1797,7 +1835,7 @@
   \tikztiming@oldnodecenter{%
     (-\dslope/2,-\height/2)
   }%
-  \newdraw
+  \newdraw [timing/every char]
 }
 
 \def\tikztiming@uchardd#1{%
@@ -1821,7 +1859,7 @@
   \tikztiming@oldnodecenter{%
       ($ (0,0) - (0,\height/2) $)
   }%
-  \newdraw
+  \newdraw [timing/every char]
 }
 
 \tikztimingdef{DD}{%
@@ -1851,7 +1889,7 @@
   \tikztiming@oldnodecenter{%
     (0,-\height/2)
   }%
-  \newdraw
+  \newdraw [timing/every char]
 }
 
 \tikztimingdef{DD@}{
@@ -2155,7 +2193,7 @@
 }
 
 \tikztimingdef{ZT}{%
-  \newdraw {[\style]
+  \newdraw [timing/every char] {[\style]
   \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}}
   -- ++(\zslope,\value{tikztimingtrans}*\height/2.)
   -- ++($ (#1,0) - (\zslope,0) $)
@@ -2173,7 +2211,7 @@
 \tikztimingdef{DT}{
   \code{\setcounter{tikztimingtrans}{-1}}
   \tikztiming@oldnodecenter@%
-  \newdraw {[\style]
+  \newdraw [timing/every char] {[\style]
   --  +(\dslope/2.,-\height/2)
   --   ($ (timing@ref) + (#1,-\height/2) $)
   }
-- 
cgit v1.2.3

