-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtikz-timing.dtx
2846 lines (2828 loc) · 124 KB
/
tikz-timing.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
%<=*COPYRIGHT>
%% Copyright (c) 2009-2022 by Martin Scharrer <[email protected]>
%% ----------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008/05/04 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Martin Scharrer.
%%
%% This work consists of the files tikz-timing.dtx and tikz-timing.ins
%% and the derived filebase tikz-timing*.sty.
%%
%<=/COPYRIGHT>
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{tikz-timing.dtx}[%
%<=*DATE>
2017/12/20
%<=/DATE>
%<=*VERSION>
v0.7f
%<=/VERSION>
DTX-File of 'tikz-timing' package.]
\newif\ifprintversion % \fi
\ifdefined\printversion
\printversiontrue
\fi
\RequirePackage{filecontents}
\begin{filecontents}{ydoc.cfg}
% Intensionally empty
\end{filecontents}
\ifprintversion
\documentclass{ltxdoc}
\let\chapter\section
\let\section\subsection
\let\subsection\subsubsection
\else
\documentclass[landscape,12pt]{scrreprt}
\usepackage{ydoc}
\fi
\GetFileInfo{tikz-timing.dtx}
\usepackage{tikz-timing}[\filedate]
\usepackage{hyperref}
\usepackage{atbegshi}
\usetikztiminglibrary{arrows,either,overlays,clockarrows,columntype}
\usetikztiminglibrary{nicetabs,counters,advnodes,interval,ifsym}
\tikzset{timing/no nice tabs}
\tikzset{timing/interval/normal}
\tikzset{timing/nodes/old center}
\usetikzlibrary{plotmarks}
\makeatother
%%%^^A\usepackage[electronic]{ifsym}
\usepackage{calc}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{array}
\usepackage{flafter,fnpos}
\usepackage{booktabs}
\usepackage{supertabular}
%\usepackage{xtab}
\usepackage{amsmath}
\usepackage{flafter}
\usepackage{placeins}
\makeFNbottom
\makeFNbelow
\usepackage{microtype}[2005/10/28]
\DisableLigatures{encoding = T1, family = tt* }%
\newsavebox{\mysb}
\newsavebox{\sba}
\newsavebox{\sbb}
\def\topfraction{0.91}
\def\bottomfraction{0.95}
\def\floatpagefraction{0.98}
\def\textfraction{0.05}
\setcounter{bottomnumber}{2}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
\usepackage{shortvrb}
\usepackage{newverbs}
\MakeSpecialShortVerb{\qverb}{\"}
\def\NewIn#1{
\marginpar{\strut\raggedleft\raisebox{.125ex}{\textcolor{black}{\emph{New in #1}}}}%
}
\def\ExtIn#1{
\marginpar{\strut\raggedleft\textcolor{black}{\emph{Extended in #1}}}%
}
\iffalse
\def\thesection{\texorpdfstring{\LARGE\texttiming[X]{D{\arabic{section}}.1X[black]}}{\arabic{section}}}
\def\thesubsection{\texorpdfstring{\Large\texttiming[X]{D{\arabic{section}}D{\arabic{subsection}}.1X[black]}}{\arabic{section}.\arabic{subsection}}}
\def\thesubsubsection{\texorpdfstring{\large\texttiming[X]{D{\arabic{section}}D{\arabic{subsection}}D{\arabic{subsubsection}}.1X[black]}}
{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}}
%\def\timingsectionformat#1{%
% \sbox{\mysb}{\tikz \draw node [timing/d/text] {#1};}%
% \texttiming{ $ \wd\mysb / \tikztiming@xunit $ DD{#1} }%
%}
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries\sffamily}}
%[#1]{\texorpdfstring{\larger\timingsectionformat{#2}}{#2}}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries\sffamily}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries\sffamily}}
\fi
\let\envv\env
\let\css\cs
\def\lib{\texttt}
\def\library#1#2{\section{#2}\label{lib:#1}}
\usepackage{xspace}
\def\ie{i.e.\xspace}
\def\eg{e.g.\xspace}
\makeatletter
% The following code is only needed to produce package examples and therefor not
% included in the style file but might be written to an additional file.
% \iffalse
%</driver>
%<*examplecode>
% \fi
%
% \begin{environment}{tikztimingexampletable}
% \begin{macrocode}
\newenvironment{tikztimingexampletable}{%
\begingroup
\let\tikztimingtable@row\tikztimingexampletable@row
\tikzset{timing/nice tabs}
\tikztimingtable
}{%
\extracode
\tableheader{Characters}{Resulting Diagram}%
\tablerules
\endtikztimingtable
\endgroup
}%
% \end{macrocode}
% \end{environment}
%
% \begin{macro}{\tikztimingexampletable@row}[1]{Row content}
% \begin{macrocode}
\long\def\tikztimingexampletable@row#1\\{%
\def\tikztiming@text{#1}%
\@onelevel@sanitize\tikztiming@text
\tikztimingtable@row@@{\ttfamily\tikztiming@text}{#1}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tikztimingfullexampletable}
% \begin{macrocode}
\def\tikztimingfullexampletable{%^^A
\begin{tikzpicture}[timing/picture,x=1em,y=1em,font=\sffamily]
\tikzset{timing/d/background/.style={fill={gray!25},fill opacity=0.5}}%
\let\chars\tikztiming@chars@default
\node (charnode) at (0,0) {%
\scalebox{0.4}%
{\rotatebox{-45}{$\frac{\mbox{\rotatebox{45}{to}}}%
{\mbox{\rotatebox{45}{from}}}$}}%
};
\coordinate (charnodex) at (0.25,0);%
\coordinate (charnodey) at (0,0);%
\expandafter\foreach
\expandafter\tchar
\expandafter i\expandafter n\expandafter{\chars} {%
\path (charnodex) ++(+2,0) node (charnodex) {\strut\tchar};
\path (charnodey) ++(0,-2) node (charnodey) {\strut\tchar};
}%
\draw [line width=\heavyrulewidth] (charnodex) +(+1,+1) -- (-1,+1);
\draw [line width=\lightrulewidth] (charnodex) +(+1,-1) -- (-1,-1);
\draw [line width=\lightrulewidth] (charnodey) +(+1,-0.6) -- (+1,-1.4)
(+1,-0.6) -- (+1,+0.6);
\draw [line width=\heavyrulewidth] (charnodey) ++(-1,-1) -- +($ (2,0) +
(charnodex) $);
%
\path (1.5,-2) node (charnodex) {\strut};
\coordinate (charnodex) at (charnodex.base);
\coordinate (charnodey) at ($ (charnodex.base) + (0,2) $);
\def\@tempa{\timing at (charnodey)}
\foreach\xchar in \chars {
\foreach\ychar in \chars {
\path (charnodey) +(0,-2) node (charnodey) {};
\draw [xstep={\timingwidth/2.},ystep={\timingheight/2.},timing/grid,
shift={(charnodey)}]
(0,0) grid +(2,1);
\expandafter\@tempa\expandafter{\ychar\xchar};
}
\path (charnodex) ++(+2,0) node (charnodex) {};
\path (charnodex) ++(0,2) node (charnodey) {};
}
\end{tikzpicture}%^^A
}
% \end{macrocode}
% \end{macro}
%
% \iffalse
%</examplecode>
%<*driver>
% \fi
\makeatother
\EnableCrossrefs
%\CodelineIndex
\RecordChanges
\OnlyDescription
\listfiles
\DeleteShortVerb{\|}
\def\pipe{|}
\def\Pipe{{\normalfont\normalcolor\pipe}}
\MakeShortVerb{\|}
\begin{document}
\DocInput{tikz-timing.dtx}
\PrintChanges
%\newpage\PrintIndex
\end{document}
%</driver>
%<*doc>
% \fi
%
% \CheckSum{5720}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
%
%
% \GetFileInfo{tikz-timing.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\xdef,\DeclareRobustCommand}
% \DoNotIndex{\expandafter,\if,\else,\fi,\ifnum,\ifx,\let,\global,\long}
% \DoNotIndex{\newcounter,\newcount,\message,\meaning,\noexpand,\relax,\value}
% \DoNotIndex{\setcounter,\addtocounter,\advance,\afterassignment,\AtEndOfPackage}
% \DoNotIndex{\ProvidesPackage,\providecommand,\RequirePackage,\empty,\begin,\end}
% \DoNotIndex{\begingroup,\bgroup,\egroup,\endgroup,\csname,\endcsname,\@tempa}
% \DoNotIndex{\ignorespaces,\lccode,\sffamily,\@gobble,\@ifundefined,\@for,\or}
% \DoNotIndex{\@firstoftwo,\@ifnextchar,\@namedef,\@nameuse,\@secondoftwo}
% \DoNotIndex{\@temptokena,\toks@,\BODY,\do,\g@addto@macro,\lowercase,\uppercase,\the}
% \DoNotIndex{\height,\width,\slope,\style,\draw,\path,\newdraw,\newdrawns}
% \DoNotIndex{\dslope,\zslope}
%
% \ifpdf
% \hypersetup{%
% pdfauthor = {Martin Scharrer <[email protected]>},
% pdftitle = {The tikz-timing package, \fileversion\ from \filedate},
% pdfsubject = {Documentation of LaTeX package tikz-timing which allows the
% easy creation of timing diagrams inside tikz pictures or text.},
% pdfkeywords = {tikz-timing, timing diagram, LaTeX}
% }%
% \fi
%
% \unless\ifprintversion
% \begingroup
% \makeatletter
% \title{{\tikz[baseline=(N.base),timing/picture,timing/z/.style={},%
% timing/unit=1.44*\f@size pt,timing/d/text/.style={},timing/d/background/.style={fill=black!10},timing/inline node/.append style={rectangle,inner sep=0pt,outer sep=0pt}]
% \timing at (0,0) {1L N[shift={(0,0.5)}]{\strut The} .9L 3d{[alias=N]\strut tikz} $.5em/\xunit$Z 5d{\strut timing} 1.75H N[shift={(0,-0.5)}]{Package} 1.75H } ;}}
% \author{Martin Scharrer}
% \date{Version \fileversion\ -- \filedate}
% \thispagestyle{empty}
% \begin{titlepage}
% \sffamily\bfseries
% \parindent=0pt
% \centering
% \vspace*{2cm}
% \resizebox{.75\textwidth}{!}{\Huge\@title}
% \par\vspace*{.75cm}
% \Large A \LaTeX\ Package for Timing Diagrams
% \par\vspace*{1.5cm}
% {\LARGE\@date}
% \par\vspace*{2cm}
% {\LARGE\@author
% \par\smallskip}
% {\Large\href{mailto:[email protected]}{[email protected]}
% \par\vspace*{1.25cm}}
% {\Large
% WWW: \url{http://latex.scharrer-online.de/tikz-timing}\\[.5ex]
% CTAN: \url{http://www.ctan.org/pkg/tikz-timing}\\[1.2ex]
% \par\smallskip}
% \end{titlepage}
% \clearpage
% \endgroup
%
% \else
%
% \null
% \vspace*{-2em}
% \begin{center}
% \sffamily
% \tikzset{timing/z/.style={black},
% timing/intext/.style={timing,line width=0.1ex}}
% {\LARGE\sffamily The \raisebox{-0.66ex}{\Huge\textsf
% {\texttiming[z]{3d{\strut tikz}z5d{\strut timing}0.2z}}} package}\\[3ex]
% {\large Version \fileversion\ -- \filedate}\\[2ex]
% {\large Martin Scharrer \\\normalsize
% \url{[email protected]}\\[.8ex]
% WWW: \url{http://latex.scharrer-online.de/tikz-timing}\\[.5ex]
% CTAN: \url{http://www.ctan.org/pkg/tikz-timing}\\[1.2ex]}
% \end{center}
% \vspace{1.2em}%
% \fi
%
% ^^A\vfill \noindent
% ^^A\textbf{Note to Advanced Users:} This is a new package which internal
% ^^Amacros might still change. Please only rely on the user macros for now.
%
% \clearpage
% \enlargethispage{\baselineskip}
% {\let\csd
% \texttt\tableofcontents
% \listof{example}{List of Examples}
% }
% \addtocontents{toc}{\vspace*{-1.5em}}
%
% \chapter{Introduction}
% This package uses the \pkg[pgf]{tikz} package to produce timing diagrams
% inside text or \envv{tikzpicture} environments. Also a tabular-like
% environment is provided to produce a larger timing diagram with multiple
% labeled signals and the possibility to add own drawing material.
% Additional optional functionality is provided by libraries.
%
% The signal levels of the timing diagram can be given by corresponding
% characters/letters like "H" for \emph{Logical High} or "L" for
% \emph{Logical Low}. So e.g.\ "{HLZXD}" gives `\texttiming{HLZXD}'.
% In order to fit (in)to normal text the diagram size (\ie its height, width and line width)
% is defined relatively to the currently active font size. The diagram height is about the height of an
% uppercase "X" (+$2\times\frac12$ line width). This way the diagrams
% can also be scaled using font size commands like \cs{small}.
% (Example: {\sffamily
% \large X\texttiming{LH}X
% \normalsize X\texttiming{LH}X
% \small X\texttiming{LH}X
% \footnotesize X\texttiming{LH}X
% \scriptsize X\texttiming{LH}X
% \tiny X\texttiming{LH}X
% })
% \makeatletter
% \def\iex#1{^^A
% \def\@tempa{#1}\@onelevel@sanitize\@tempa
% `\texttt{\@tempa}'~$\rightarrow$~`\texttiming{#1}'}
% \makeatother
% A single timing character produces a diagram with a width identical to its height
% (\iex{H}). Longer diagrams can be produces by either
% using the same character multiple times (\iex{HHH})
% or writing the width as number in front of the character (\iex{3.2H}).
% For (partial) compatibility with similar packages lowercase characters only produce
% a signal with half the width (\iex{h}, \iex{3.2h}).
%
% Recurring character combinations can be repeated using character groups
% (\iex{3{hlz}}) or be defined as so called \emph{meta-characters}
% ({\tikztimingmetachar{Y}{hlz} "Y"="hlz", \iex{3Y}}),
% which are similar to a \TeX~macro.
% Since v0.7 meta-characters can also include macro arguments.
%
% Additional features are the inclusion of in-line TikZ styles (\iex{H ;[orange] L}),
% in-line nodes (\iex{2H N[rectangle](Name){Text} 2L}), automatic width calculations
% ("H $ 1+\mymacro-\slope $ L "~$\rightarrow$~`\texttiming{H2.5L}')
% and much more.
%
% \iffalse
% \medskip
% \DeleteShortVerb{\|}
% \centerline{\texttiming[D]{
% 2{12{[yscale=.9,shift={(0,.05)}]D{}}
% 13{[yscale=1.1,shift={(0,-.05)}]D{}};}
% $\dslope$ D{}
% }}
% \MakeShortVerb{\|}
% \medskip
% \fi
%
% \iffalse
% The package is build to make it possible to define new characters from scratch
% or as modified copy of other characters. However, no user macros nor
% documentation for this are provided at the moment. Interested \LaTeX\ users
% should look at the default definitions at the end of the source code.
% \fi
%
% \iffalse
% \section{Similar Packages}
% There a some packages which target the same application like the package
% presented by this document.
%
% \begin{description}
% \itempkg{ifsym} This package (using the |electronic| option) provides a
% special font which contains graphical representation of the logical levels
% high and low at the corresponding letter "H" and "L". The lower case
% versions have only half the width of the uppercase ones. Also a transition
% can be added using the "|" character which will (sometimes) be added
% automatically between |HL| and |LH|.
% The diagrams are created using the command |\textifsym|\marg{characters},
% e.g.\ \verb+\textifsym{H|L|h|l|H|L}+ results in
% \DeleteShortVerb{\|} `\textifsym{H|L|h|l|H|L}'.
% \MakeShortVerb{\|}
%
% There is no support for transition slopes and no support for new
% user-defined logical levels.
%
% \itempkg[(CTAN)]{timing} This package also provides a font for the logical
% levels but supports transition slopes and larger timing diagrams. This
% package seems not been updated for a while.
%
% \itempkgnoctan[(TikZ Example Page)]{timing}%
% {http://www.texample.net/tikz/examples/timing-diagram/} This package is
% accidentally also called "timing.sty" and is not published on CTAN but on
% the TikZ example website. It is a small package which is meant as an
% example for the graphics package \texttt{tikz} which is used to draw the
% diagram. The logical levels must be provided using macros like
% `|\bit|\marg{0 or 1}\marg{length}'.
% \end{description}
% \fi
%
% \clearpage
% \section{Changelog}
% \begingroup
% \renewcommand{\changes}[3]{\paragraph{#1 from #2}\begin{itemize}\item #3\end{itemize}}
% \newenvironment{Changes}[2]{\paragraph{#1 from #2}\begin{itemize}\let\change\item}{\end{itemize}}
%
% \changes{v0.3}{2009/04/24}{First released version}
% \changes{v0.4}{2009/05/03}{Added output routine which combines successive
% occurrences of the same character. This improves screen display quality and
% reduces rendering time and file size.
% \item Removed own macros for lowercase characters. They
% are now handled by the uppercase macros which receive half of the width.
% Exceptions are possible like for the `m' character.
% \item Added parser for rows in \env{tikztimingtable}.
% This makes the syntax much more stable. Also replaced row counter with TikZ
% coordinates which is more user-friendly.
% \item User macros to draw grids and lines inside table.
% \item In-line Nodes, \eg to mark positions inside the diagram.}
% \changes{v0.4a}{2009/05/05}{Added \cs{tablerules} macro. Changed default style
% of inline nodes to \texttt{coordinate}.}
% \changes{v0.5}{2009/05/15}{Added PGF shape for timing diagrams. Added
% meta-characters. Changed `M' character to use PGF decorations. Added special
% `B' character to reduce width of next character. Changed \cs{timing} syntax to
% include an `at' before the coordinate. Bug fix for use with the `calc'
% package.}
% \changes{v0.6}{2009/07/27}{Added ``forward'' modifier `\texttt{F}' as reverse
% version of the ``backward'' modifier `\texttt{B}'.
% \item Added support for
% lower-case modifiers ``\texttt{b}', `\texttt{f}' and \texttt{n}'.
% \item Added libaries for characters `\texttt{A}'/`\texttt{W}' for arrows and
% '\texttt{E}' for uncertain low-to-high and high-to-low transitions.}
% \changes{v0.6a}{2009/07/28}{Added library for overlay modifier `\texttt{O}'.}
%
% \begin{Changes}{v0.7}{2009/12/05}
% \change New libraries:
% \begin{description}
% \item[\lib{clockarrows}] Library for clock arrows.
% \item[\lib{columntype}] Library providing a timing column type for |tabular|.
% \item[\lib{nicetabs}] Library to format \cs{tikztimingtable} like a |booktab| |tabular|.
% \item[\lib{counters}] Library to defined counter characters which display an incrementing
% counter value every time there are used.
% \item[\lib{advnodes}] Library for advanced nodes with multiple anchor points.
% \item[\lib{ifsym}] Library providing the same timing symbols and characters as the |ifsym| package
% when loaded with the |electronic| option.
% \end{description}
% \change Additional experimental libraries:
% \begin{description}
% \item[\lib{interval}] Library to change color of "ZL", "ZH" etc. transitions to
% indicate borders of an interval.
% \item[\lib{beamer}] Library providing some marginal beamer overlay support.
% \end{description}
% \change \lib{overlays} library:
% \begin{itemize}
% \item Overlays can now be cascaded, \ie an overlay can be inside another one.
% \item The second braces around the second part are now optional.
% \item Fixed issues with "T" and "C" characters inside overlays.
% \end{itemize}
% \change Meta-characters can now have arguments.
% \change Added more variety for in-line options: "[[ ]]", "[+ +]" and "[| |]".
% \change Handling of in-line options and nodes got modified. Options are now placed directly
% where placed and are valid until the next ";". Please note that |[/utils/exec={..}]| now
% needs to be written as \verb+[|/utils/exec={..}|]+. Otherwise it is re-executed every time
% the drawing path is renewed.
% \change Added star version of \cs{tablegrid}.
% \change Added background to "E" character (\lib{either} library).
% \change Some fixes for placing of "D{}" texts.
% \change Fixed wrong slopes (\eg |lslope| instead of |zslope|) for some transitions.
% \change Major changes on internal character definition macros, parser and output routine.
% \change Fixed problems with expanding code content in user input.
% \change The \cs{texttiming} macro now uses a \cs{timing} macro internally.
% \change The \cs{timing} macro is now only defined inside |tikzpictures|.
% This includes |tikztimingtable|.
% \change Added TikZ style |timing/draw grid| for grids behind \cs{timing} macros.
% \change Replaced macros \cs{texttimingbefore}, \cs{texttimingafter} and \cs{texttiminggrid} with
% TikZ settings "timing/before text", "timing/after text" and "timing/draw grid".
% \change Added separators "timing/outer sep" around \cs{texttiming}.
% \change Graphical improvements for `double line' characters like "D", "U" and "E".
% The whole character including both edges is drawn in a single process.
% \change Character width can now be scaled using |wscale|.
% \change Character width can now be calculated by placing code inside "$ $".
% \change Fixed issue with \cs{horlines} macro.
% \change The \env{tikztimingtable} environment and associated macros got enhanced:
% \begin{itemize}
% \item The content is no longer read as macro argument and can now include paragraphs.
% \item Multiple |extracode| sections can be now included between rows, not only a single
% section at the very end.
% \item A \env{extracode} environment has been added. Both macro and environment have now
% an optional argument for TikZ settings.
% \item Added \cs{tableheader} macro to label both columns. The \cs{tablerules} macro got
% adjusted to detect the header line and draw also a middle line.
% \item Added \env{background} environment to draw things in the background.
% \item Fixed broken optional argument of \cs{tablegrid}.
% \item Added macro \cs{marknodes} and associated |debug/nodes| style to mark in-line nodes
% for debug purposes/orientation during the diagram creation.
% \end{itemize}
% \end{Changes}
% \changes{v0.7d}{2011/01/09}{Fix for end macro of extracode environment to support etoolbox's environment hooks.}
% \changes{v0.7e}{2017/12/10}{Fixed advnodes library to support current PGF version.}
% \changes{v0.7e}{2017/12/10}{Documentation update: added usage as float with caption due to user request.}
% \changes{v0.7f}{2017/12/20}{Documentation update: added description of several existing styles.}
%
%
% \endgroup
%
% \section{Dependencies}
% \dots
%
% \clearpage
% \chapter{Usage}
%
% \section{Timing Characters}
% The logic levels are described by so called \emph{timing characters}. Actually
% all of them are letters, but the general term \emph{character} is used here.
% Table~\ref{tab:chars} shows all by default defined logic characters and
% Table~\ref{tab:full} all possible two-character transitions. Additional
% functionality is provided by the \emph{modifiers} shown in
% Table~\ref{tab:modifiers}.
%
% \sbox{\sba}{%^^A
% \sffamily
% \tikzset{timing/draw grid}
% \begin{tabular}{clccc}
% \toprule
% Character & Description & Diagram & Transition \\
% & & & Example \\
% \midrule
% \texttt{H} & High & \texttiming{H} & \texttiming[L]{H} \\
% \texttt{L} & Low & \texttiming{L} & \texttiming[H]{L} \\
% \texttt{Z} & High Impedance & \texttiming{Z} & \texttiming[L]{Z} \\
% \texttt{X} & Undefined / Don't Care & \texttiming{X} & \texttiming[L]{X} \\
% \texttt{D} & Data / Double & \texttiming{D} & \texttiming[L]{D{A}D} \\
% \texttt{U} & Unknown Data & \texttiming{U} & \texttiming[D]{U} \\
% \texttt{T} & Toggle & \texttiming{L} or \texttiming{H} & \texttiming{TTTT} \\
% \texttt{C} & Clock (no slope) & \texttiming{L} or \texttiming{H} & \texttiming{CCCC} \\
% \texttt{M} & Metastable Condition & \texttiming{M} & \texttiming[H]{Ml} \\
% \midrule
% \texttt{G} & Glitch (zero width) & \texttiming{G} & \texttiming{HGH} \\
% \texttt{S} & Space (nothing) & \texttiming{S} & \texttiming{HSL} \\
% \bottomrule
% \end{tabular}
% }%^^A
%
% \sbox{\sbb}{%^^A
% \tikzset{timing/draw grid}
% \sffamily\small
% \tikztimingfullexampletable
% }%^^A
%
% \ifprintversion
%
% \begin{table}
% \centering
% \caption{Timing Characters}\label{tab:chars}
% \usebox{\sba}
% \end{table}
%
% \begin{table}
% \caption{Overview over all transitions.}
% \label{tab:full}
% \usebox{\sbb}
% \end{table}
%
% \else
%
% \begin{table}
% \sffamily
% \centering
% \pgfmathparse{max(\wd\sba+\wd\sbb+1em,\textwidth)}%^^A
% \makebox[\textwidth][c]{%^^A
% \begin{minipage}{\wd\sba}
% \caption{Timing Characters}
% \label{tab:chars}
% \usebox{\sba}
% \end{minipage}%^^A
% \hspace{1em}\hfill
% \begin{minipage}{\wd\sbb}
% \caption{Overview over all transitions.}
% \label{tab:full}
% \usebox{\sbb}
% \end{minipage}%^^A
% }%^^A
% \end{table}
%
% \fi
%
% \clearpage
% \DeleteShortVerb{\|}
% \begingroup^^A{table}[b]
% \tikzset{timing/draw grid}
% \let\normalfont\sffamily
% \sffamily\centering
% \makeatletter
%
% \tablecaption{Modifiers for Timing Characters.}
% \label{tab:modifiers}
% \def\en{\,\textsf{--}\,}
% \let\origtabular\tabular
% \let\endorigtabular\endtabular
% \def\tabular{\begingroup
% \setbox\mysb\hbox\bgroup
% \origtabular}%
% \def\endtabular{\endorigtabular\egroup\makebox[\textwidth][c]{\usebox\mysb}
% \endgroup}%
% \tablefirsthead{%
% \toprule
% \normalfont
% Modifier Syntax & Description \\
% \midrule
% }%
% \tablehead{%
% \multicolumn{2}{c}%
% {\raisebox{\belowcaptionskip}{\tablename\ \thetable{} --
% continued from previous page}} \\
% \toprule
% \normalfont
% Modifier Syntax & Description \\
% \midrule
% }%
% \tabletail{%
% \bottomrule
% ^^A\multicolumn{2}{r}{Continued on next page}\\
% }
% \tablelasttail{%
% \bottomrule
% }
% \def\Example#1{\def\@tempa{#1}\@onelevel@sanitize\@tempa
% \hbox{\emph{E.g.:} `\hbox{\texttt{\@tempa}}' $\to$ \texttiming{#1}}}
% \begin{supertabular}{>{\ttfamily}l>{\raggedright\arraybackslash}p{.85\textwidth}}
% D\{\}D & Produces transition between two data values. \Example{D{}D} \\
% D\{\meta{Text}\} & Adds \meta{text} into a data signal using a node.
% \Example{D{A}D{B}} \\
% D\{[\meta{\scriptsize
% \raisebox{-1ex}{\shortstack{TikZ\\Settings}}}]\meta{Text}\} & Adds \meta{text}
% using the given node \meta{settings}. \Example{D{[blue]A}} \\
% \meta{\small number}\meta{\small character} & Sets width of next signal to
% given number. Half of it if character is in lower case.
% \Example{2.6H5.2l}\\
% \meta{\small integer}\{\meta{\small characters}\} & Repeats the given
% characters \texttt{\meta{int}} times. \Example{5{hl}}\\
% \{ \meta{\small characters} \} & Encloses characters in a local scope. Options inside are only
% local to the scope. This also applies to the effect of `\texttt{;}' and similar modifiers.
% \Example{H {[blue] LH} L}\\
% \midrule
% \meta{\small number}B & Su\underline{b}tracts the given number from the width
% of the next character. ``\textit{\texttt{B}ackwards}''
% \Example{H.5BL}\\
% \meta{\small number}F & Adds the given number to the width of the next
% character. ``\textit{\texttt{F}orwards}'' \Example{H.5FL}\\
% N\oarg{\tiny Settings}\parg{\tiny Name}\marg{\tiny Content} & Adds node at
% current position. All three arguments are optional. \Example{H N(a1) L}\\
% \midrule
% {}[\meta{TikZ Keys}] & Executes given TikZ settings during the drawing
% process. This settings will be re-executed when the internal drawing path is renewed which
% can cause side-effects. \Example{H[blue]LH} \\
% {}[|\meta{TikZ Keys}|] & Executes given TikZ settings during the drawing
% process like \texttt{[ ]} but does not re-executes them.
% {\Example{D{.} [|/utils/exec={\def\m{...}}|] D{.} D{.}}} \\
% {}[!\meta{TikZ Keys}!] & Executes given TikZ settings during the
% \emph{parsing} process. Because this makes only sense for internal settings
% the default path is `\texttt{/tikz/timing}', not `\texttt{/tikz}' like in all
% other settings macros. \Example{H[!wscale=2.5!]LH} \\
% {}[[\meta{TikZ Keys}]] & Executes given TikZ settings first during the
% parsing process and again during the drawing process. This is for settings
% which are needed for width calculations and again for the drawing code, \eg
% the slope values. \Example{H[[timing/slope=.5]]L $\slope$H} \\
% \midrule
% !\{\meta{code}\} & Places given code into the internal \envv{tikzpicture}.
% See Example~\ref{exa:adv}. \\
% @\{\meta{code}\} & Executes the given code immediately during the parsing
% process. This can be used to change parsing parameters. To execute code during
% the drawing process use \verb+[|/utils/exec=+\meta{code}\verb+|]+ instead.
% \Example{L @{\setwscale{2}} H} \\
% \texttt{\$}\meta{math expression}\texttt{\$} & Takes a valid \texttt{pgfmath}
% expression (See \pkg{pgf} manual), evaluates it and places the result back in
% the input string so it can be used as width for the next character. The macros
% \cs{slope}=\cs{lslope}, \cs{dslope}, \cs{zslope} and \cs{wscale} can be used
% to access the corresponding values. \Example{D{} $ \dslope $ D{} D} \\
% \midrule
% ; & Renews the internal drawing path which ends the scope of all options
% given by \texttt{[\,]}. \Example{H;[blue]L;H} \\
% , & Same as `\texttt{;}', but timing specific options (atm.: slopes and line
% width) are restored for the new path. \Example{[line width=1pt]L,H;L} \\
% \end{supertabular}
% \endgroup
% \MakeShortVerb{\|}
%
% \clearpage
% \section{Macro for use in Text Mode}
% \vspace{-\bigskipamount}%
% \DescribeMacro\texttiming[<initial~character/TikZ Settings>]{<characters>}
% This macro places a single timing diagram line into the current text. The
% signals have the same height as a uppercase letter (like `X') of the current
% font, \ie they scale with the font size.
% The macro argument must contain only valid logic characters and modifiers
% which define the logical levels of the diagram line.
%
% An initial character can be given as an optional argument. No logic level will
% be drawn for this character. Instead it will be used to define the initial
% position of the signal so that the diagram line will start with a transition
% from the initial to the first character. However, if the optional argument
% holds more than a single character it is taken as TikZ settings for the
% diagram. The initial character can then be given using the key
% `|timing/initchar=|\meta{char}'.
%
% \par\medskip\noindent
% \begin{minipage}{\textwidth}\noindent
% \textit{Examples:}\\*[\smallskipamount]\hspace*{\parindent}%
% \begin{minipage}{\textwidth-4\parindent}
% \small |\texttiming{HLZDZLH}|^^A
% \phantom{\texttt{[L]}} gives `\texttiming{HLZDZLH}', with grid:
% `{\let\texttimingbefore\texttiminggrid\texttiming{HLZDZLH}}'.\\
% |\texttiming[L]{HLZDZLH}| ^^A
% gives `\texttiming[L]{HLZDZLH}', with grid:
% `{\let\texttimingbefore\texttiminggrid\texttiming[L]{HLZDZLH}}'.\\
% |\texttiming[green]{HLZDZLH}| ^^A
% gives `\texttiming[green]{HLZDZLH}'\\
% |\texttiming[green,timing/initchar=L]{HLZDZLH}| ^^A
% gives `\texttiming[green,timing/initchar=L]{HLZDZLH}'
% \end{minipage}
% \end{minipage}
%
% \DescribeMacro\texttimingbefore!{\hspace{2em}\textbf{Deprecated!}\hspace{8em}(\emph{defaults to}: \meta{empty})}!
% \DescribeMacro\texttimingafter!{\hspace{2.5em}\textbf{Deprecated!}\hspace{8em}(\emph{defaults to}: \meta{empty})}!
% This two macros are executed before and after every timing diagram line
% created by \cs{texttiming} macro inside the same \envv{tikzpicture}
% environment and can be used to add drawing macros. The argument of the
% \cs{texttiming} macro is already processed before any of these macros are
% expanded, therefore this macros can access the width of the diagram.
%
% These macros should not be used directly in newer code but instead the new
% TikZ styles "timing/before text" and "timing/after text". For backward
% compatibility these styles default to the two macros.
%
% {\small
% (Deprecated) Example: |\let\texttimingbefore\texttiminggrid| adds a grid into the
% background of the \cs{texttiming} diagram.}
%
% \DescribeMacro\texttiminggrid!\hspace{2.5em}\textbf{Deprecated!}!
% This macro should only be used inside \cs{texttimingbefore} or
% \cs{texttimingafter} and draws a grid of the full size of the
% \cs{texttiming} diagram.
% For newer code the TikZ styles "timing/draw grid" and "timing/no grid"
% should be used instead, \eg
% |\tikzset{timing/intext/.append style={timing/draw grid}}| or simply enable the grid globally
% for all in-text and other timing diagrams with |\tikzset{timing/draw grid}|.
%
%
% \newpage
% \section{Macro for use inside TikZ-Pictures}
%
% \DescribeMacro\timing[<TikZ Keys>]~'at'~(<TikZ Coordinate>)~{[<initial character>]<characters>}';'
% This macro does the same as \cs{texttiming} but is designed to be used inside
% a \envv{tikzpicture} environment and only there. Like normal TikZ macros
% (\css{path}, \css{drawn}, \css{node}) it allows an optional argument with TikZ
% settings and an optional TikZ-coordinate. However, a own argument parser, not
% the one used by TikZ, is used to detect and read these optional arguments.
% Therefore the order of the arguments is mandatory and must not be reversed.
% This small limitation might be overcome in future versions of this package.
%
% Please note that the optional initial character may be given \emph{inside} and
% at the very start of the mandatory argument, not before it. This is necessary
% because of several technical reasons.
%
% Example: |\tikz \timing [green] at (1,2) {HLZDZLH};|\phantom{\texttt{[L]}}
% gives `\tikz \timing [green] at (1,2) {HLZDZLH};'.
%
% Example: |\tikz \timing [green] at (1,2) {[L]HLZDZLH};| gives `\tikz \timing
% [green] at (1,2) {[L]HLZDZLH};'.
%
% \ifprintversion\else
% \clearpage
% \fi
% \subsection*{Timing Shape Anchors}\label{sec:timingshape}
% Every timing diagram line produced by \cs{timing}, which includes the rows in
% \env{tikztimingtable}, is also a PGF shape (node) with several anchors. These
% are shown in Figure~\ref{fig:shape}.
% The shape is very similar to the standard |rectangle| shape but does not
% provide a |text| anchor. In addition to the standard points of the compass
% anchors of TikZ the three logic levels |low|, |mid| and |high| can be used in
% combination with |start|, |mid| and |end|. An extra |origin| anchor is
% located at the lower left, also called |south west| corner where the diagram
% originates. The two anchors called |start| and |end| are provided to mark the
% start and end of the timing signal. There are either located at the low,
% middle or high logic level dependent on the used first (or initial) and last
% timing character.
%
% In order to use the timing node it has to be named which can be done using the
% `\texttt{name=\meta{name}}' option inside the optional argument. The rows of a
% \env{tikztimingtable} are automatically named as `|row|\meta{row number}'
% where the first row has the number 1.
%
% ^^AFurther details how to use a shape inside a TikZ or PGF picture can be
% ^^Afound in the PGF manual Section~15 and~59, respectively.
%
% \begin{figure}
% \centering
% \resizebox{\textwidth}{!}{%^^A
% \begin{tikzpicture}[timing,y=1.5cm,x=1.5cm,timing/slope=0]
% \timing [y=1.5cm,x=1.5cm,gray,thick] at (0,0) {HLHLHL};
% \node[name=s,shape=tikztiming@shape,anchor=origin] at (0,0) {};
% \foreach \anchor/\placement in
% {north west/above left, north/above, north east/above right,
% west/left, center/right, east/right,
% mid west/right, mid/left, mid east/left,
% base west/left, base/left, base east/above right,
% south west/below left, south/below, south east/below right,
% low start/below right, mid start/below right, high start/above right,
% low mid/above right, high mid/right,
% low end/below left, mid end/below left, high end/above left,
% start/left, end/right, origin/right}
% \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
% node[\placement] {\tiny\texttt{(s.\anchor)}};
% \end{tikzpicture}%^^A
% }
% \caption[Timing Shape Anchors]{Timing Shape Anchors. The \texttt{start} and
% \texttt{end} anchors mark the start and end of the timing
% signal.}\label{fig:shape}
% \end{figure}
%
%
% \clearpage
% \section{Table for Timing Diagrams}
% \begin{DescribeEnv}{tikztimingtable}[<TikZ settings for whole table>]\relax
% \MacroArgs {<Signal Name>}~~'&'~~[<{\small Init.~Char./TikZ Keys for Row}>] <Characters> ~~'\\' \\
% \dots\\
% \hspace*{-1em}\Macro\extracode~~'% Optional' \\
% <additional code>
% \end{DescribeEnv}
% This environment can be used to typeset multi-line timing diagrams. The
% syntax is like the one for a \envv{tabular} environment with two columns. The
% first column is for the signal name and the second one are the logic
% characters which would be placed inside the argument of a \cs{texttiming} or
% \cs{timing} macro.
% If the second column starts with an optional argument it is either taken as
% initial character if it holds only a single character or as row wide settings
% otherwise.
% The whole table will be drawn inside a \envv{tikzpicture} environment using
% multiple \cs{timing} and \cs{node} macros for the timing signals and their
% names, respectively. Additional \pkg{tikz} drawing code can be insert at the
% end of the table using \cs{extracode}.
%
% \DescribeMacro\extracode[TikZ Keys]
% This macro is only defined inside a \env{tikztimingtable} environment. In earlier
% versions of this package it could only be used after the last table line (\ie after a |\\|).
% If used there all code between it and the |\end{tikztimingtable}| will be placed inside the same
% \envv{tikzpicture}. This allows to add some drawing lines or a grid to the
% picture. The macro does \emph{not} start a TikZ |scope| or a \TeX\ group by itself.
% The optional \meta{settings} therefore affect all following code until the end of the picture.
%
% It is also possible to draw something behind the timing diagram by
% using using the \env{background} environment or the PGF background layer:\\[\smallskipamount]
% |\begin{pgfonlayer}{background}|\ldots|\end{pgfonlayer}|
%
% \DescribeMacro\endextracode
% From\NewIn{v0.7} version 0.7 on it is possible to add further timing rows after an |extracode| section by using
% \cs{endextracode}. Everything after this macro is taken as part of a new row. It is allowed to use
% this macro direct before \cs{end}\env{tikztimingtable}. This makes it possible to use \cs{extracode}
% anywhere inside the table, including at the very start before any rows are processed. Early
% insertion of extra code is necessary for \eg limiting the bounding box or setting up a clipping path.
%
% \DescribeEnv[<extra drawing code>]{extracode}[<TikZ settings>]
% Instead\NewIn{v0.7} of using \cs{extracode} \dots \cs{endextracode}, which is actual plain\TeX\ syntax, this
% \LaTeX\ style environment can be used. Like any environment it creates a \TeX\ group around its
% content, but no TikZ |scope| is created to allow drawing code (\eg clipping paths) to affect the
% rest of the table. The optional \meta{settings}, however, only affect the environment content.
%
% Please note that while \Macro\endextracode is optional if \Macro\extracode is used at the end of the table,
% a \Macro\begin{extracode} must always be closed by \Macro\end{extracode}.
%
% \subsection*{Macros for \cs{extracode} Section}
% The following macros are only defined inside a \env{tikztimingtable} after the
% macro \cs{extracode}. They are useful for drawing additional material.
%
% \DescribeMacro\tablegrid*[<TikZ Keys>]
% After \css{extracode} this macro draws a grid in the background of the table.
% A separate grid is drawn for each row. The normal version draws all grids with
% the width of the widest row while the star version draws them with the width
% of the corresponding row. Because this macro draws material into the |background|
% layer it must not be placed inside a |pgfonlayer| environment itself.
%
% \DescribeMacro\fulltablegrid[<TikZ Keys>]
% After \css{extracode} this macro draws a big grid over all rows in the
% background of the table.
%
% \DescribeMacro\nrows
% Returns the number of rows in the current table. Useful for use in
% \cs{horlines}.
%
% \DescribeMacro\rowdist
% \DescribeMacro\coldist
% This macros return the row and column distance. There are useful for drawing
% additional material relative to the rows and columns. This values can be set
% (\eg in the optional argument of the table) using the \texttt{timing/rowdist}
% and \texttt{timing/coldist} settings which are explained in
% Section~\ref{sec:styles}.
%
% \DescribeMacro\twidth
% Returns the width (as multiple of the `period width') of the longest timing
% diagram line in the table. Example: If the longest line would be
% "H 2.3L z" than \cs{twidth} would be $1+2.3+0.5=3.8$.
%
% \DescribeMacro\horlines[<TikZ Keys>]{<list>}
% Draws horizontal lines, optionally with the given \meta{Settings}, at the base
% line of the rows given by \meta{list}. The PGF macro
% \css{foreach}\footnote{See the \texttt{pgf} manual for more details.} is
% internally used so the list can include not only row numbers as integer but
% also fractional numbers and the "..." operator to auto-increment the
% numbers. Please note that all numbers in the list are multiplied by
% \cs{rowdist}.
% If the list is empty the default "1,2,...,\nrows" is used which draws lines
% for all rows.
%
% \DescribeMacro\vertlines[<TikZ Keys>]{<list>}
% Like \cs{horlines} but draws vertical lines and the listed numbers a relative
% to the basic width.
% If the list is empty the default "0,1,...,\twidth" is used which draws lines
% after every period width.
%
% \DescribeMacro\tableheader[<TikZ Keys>]{<Description Title>}{<Signal Title>}
% This macro adds a table head row on top of the table. The two mandatory
% arguments provide the header text for the description and signal columns.
%
% \DescribeMacro\tablerules[<TikZ Keys>]
% This macro adds top and bottom rules to the table in the same (or at least
% very similar) way as the \texttt{booktabs} package is doing it for normal
% \texttt{tabular}s. The current bounding box is used to calculate the needed
% rule length, which makes this macro position dependent if further code
% changes the bounding box. If the \cs{tableheader} macro was used beforehand it
% also draws a thinner horizontal line (like \texttt{booktabs} \cs{midrule})
% between the table head and body.
%
% \DescribeEnv[<drawing commands>]{background}[<TikZ Keys>]
% This environment can be used to draw material on the |background| layer and is
% an abbreviation for:\\[\medskipamount]
% | \begin{pgfonlayer}{background}|\\
% | \begin{scope}|\oarg{TikZ Keys}\\
% | |\meta{drawing commands}\\
% | \end{scope}|\\
% | \end{pgfonlayer}|
%
% \subsection*{Scaling the Table}
% The standard "scale" setting of TikZ will not scale all parts of the table correctly,
% \eg the line width and nodes will keep their original size. However there are scaled
% relative to the font size (which needs to be set using \texttt{timing/font}).
% If the timing diagrams should be scaled the keys \texttt{timing/unit}, \texttt{timing/xunit} and/or
% \texttt{timing/yunit} can be used.
%
% Alternatively the table can be scaled using the