summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/tikz-timing
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-16 18:55:35 +0000
committerKarl Berry <karl@freefriends.org>2009-05-16 18:55:35 +0000
commit093e62dd5e34a8c932b37eeec419a37cae5560f0 (patch)
tree06c4115b4cda29e6742023fe731d10759af337f4 /Master/texmf-dist/source/latex/tikz-timing
parente84980c166909c05441e356c43cca766b4053e29 (diff)
tikiz-timing 0.5 (15may09)
git-svn-id: svn://tug.org/texlive/trunk@13124 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/tikz-timing')
-rw-r--r--Master/texmf-dist/source/latex/tikz-timing/Makefile4
-rw-r--r--Master/texmf-dist/source/latex/tikz-timing/tikz-timing.dtx765
2 files changed, 496 insertions, 273 deletions
diff --git a/Master/texmf-dist/source/latex/tikz-timing/Makefile b/Master/texmf-dist/source/latex/tikz-timing/Makefile
index fa941f7c31b..9da2ee642cf 100644
--- a/Master/texmf-dist/source/latex/tikz-timing/Makefile
+++ b/Master/texmf-dist/source/latex/tikz-timing/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile 1069 2009-05-05 13:52:29Z martin $
+# $Id: Makefile 1120 2009-05-14 12:15:10Z martin $
PACKAGE=tikz-timing
PACKAGE_STY = ${PACKAGE}.sty
@@ -51,7 +51,7 @@ clean:
fullclean:
rm -f ${TEXAUX} $(addprefix ${TESTDIR}/, ${TEXAUX}) ${GENERATED} *~ *.backup
rm -f ${PACKAGE}*.zip
- rm -rf tds/
+ rm -rf tds/ .tds
${PACKAGE}.zip: zip
diff --git a/Master/texmf-dist/source/latex/tikz-timing/tikz-timing.dtx b/Master/texmf-dist/source/latex/tikz-timing/tikz-timing.dtx
index dcaad6e7099..3f2780ec51e 100644
--- a/Master/texmf-dist/source/latex/tikz-timing/tikz-timing.dtx
+++ b/Master/texmf-dist/source/latex/tikz-timing/tikz-timing.dtx
@@ -20,7 +20,7 @@
% This work consists of the files tikz-timing.dtx, tikz-timing.ins
% and the derived file tikz-timing.sty.
%
-% $Id: tikz-timing.dtx 1069 2009-05-05 13:52:29Z martin $
+% $Id: tikz-timing.dtx 1132 2009-05-15 15:23:50Z martin $
% \fi
%
% \iffalse
@@ -34,8 +34,8 @@
%<*driver>
\ProvidesFileSVN
%</driver>
- {$Id: tikz-timing.dtx 1069 2009-05-05 13:52:29Z martin $}
- [v0.4a
+ {$Id: tikz-timing.dtx 1132 2009-05-15 15:23:50Z martin $}
+ [v0.5
%<package> Digital Timing Diagrams using TikZ]
%<examplecode> Macros to produce examples for the tikz-timing package]
%<ydoc> Documentation Macros for tikz-timing package]
@@ -330,7 +330,6 @@
{\\*[\smallskipamount]\ignorespaces}%
}
\newcommand*{\imacroargX}[1]{%
- \hspace*{-1em}\texttt{\#\thenmacroarg:} #1\relax
\ifnum\c@macroargs>1
\newline
\fi
@@ -633,16 +632,28 @@
% \begin{macrocode}
%</driver>
%<*examplecode>
-\RequirePackage{environ}
+\ifx\collect@body\@undefined
+ \IfFileExists{environ.sty}
+ {\RequirePackage{environ}}
+ {\RequirePackage{amsmath}}
+\fi
% \end{macrocode}
% \begin{environment}{tikztimingexampletable}
% \begin{macrocode}
-\NewEnviron{tikztimingexampletable}{%
- \begin{tikzpicture}[timing/table]%
+\newenvironment{tikztimingexampletable}[1][]{%
+ \tikzpicture[timing/table,#1]%
\coordinate (last row) at (0,-1);
\coordinate (label pos) at (-1,0);
- \expandafter\tikztimingexampletable@\BODY\endtikztimingtable@
+ \collect@body\tikztimingexampletable@
+}{}%
+% \end{macrocode}
+% \end{environment}
+
+% \begin{macro}{\tikztimingexampletable@}
+% \begin{macrocode}
+\def\tikztimingexampletable@#1{%
+ \tikztimingexampletable@row#1\endtikztimingtable@
\path (0,-1) +(-\tikztiming@coldist,0.5*\tikztiming@rowdist) node
[anchor=base east,timing/name] {Characters};
\path (0,-1) +(0,0.5*\tikztiming@rowdist) node
@@ -656,28 +667,26 @@
\draw [line width=\heavyrulewidth]
(current bounding box.south west) +(0,-1) --
($ (current bounding box.south east) +(0,0) $);
- \end{tikzpicture}
+ \endtikzpicture
}
-
-\def\endtikztimingtable@{\@gobble{ENDTIKSTIMING}}
% \end{macrocode}
-% \end{environment}
-%
-% \begin{macro}{\tikztimingexampletable@}
+% \end{macro}
+
+% \begin{macro}{\tikztimingexampletable@row}
% \begin{macrocode}
-\def\tikztimingexampletable@#1\\{%
+\def\tikztimingexampletable@row#1\\{%
\def\tikztiming@text{#1}%
\@onelevel@sanitize\tikztiming@text
\path (last row) +(0,-1*\tikztiming@rowdist) coordinate (last row);
\path (last row) +(-1*\tikztiming@coldist,0) node
[anchor=base east,timing/name]
{\ttfamily\tikztiming@text};
- \timing (last row) {#1};
+ \timing at (last row) {#1};
\@ifnextchar\extracode
{\tikztimingextracode}%
{%
\@ifnextchar\endtikztimingtable@
- {\@gobble}{\tikztimingexampletable@}%
+ {\@gobble}{\tikztimingexampletable@row}%
}%
}
% \end{macrocode}
@@ -722,7 +731,7 @@
\path (1.5,-2) node (charnodex) {\strut};
\coordinate (charnodex) at (charnodex.base);
\coordinate (charnodey) at (charnodex.base);
- \def\@tempa{\timing (charnodey)}
+ \def\@tempa{\timing at (charnodey)}
\expandafter\foreach
\expandafter\xchar
\expandafter i\expandafter n\expandafter{\chars} {
@@ -761,7 +770,7 @@
%</driver>
% \fi
%
-% \CheckSum{1757}
+% \CheckSum{1998}
%
% \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
@@ -796,6 +805,11 @@
% \changes{v0.4}{2009/05/03}{Released as v0.4}
% \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.}
%
% \GetFileInfo{tikz-timing.dtx}
%
@@ -831,15 +845,15 @@
% {\texttiming[z]{3d{\strut tikz}z5d{\strut timing}0.2z}}} package}\\[3ex]
% {\large Martin Scharrer \\\normalsize
% \url{martin@scharrer-online.de}\\[.8ex]
-% \url{http://www.ctan.org/indexes/graphics/pgf/contrib/tikz-timing/}\\[1.2ex]}
+% \url{http://www.ctan.org/pkg/tikz-timing}\\[1.2ex]}
% {\large Version \fileversion\ -- \filedate}\\
% \end{center}
% \vspace{1.2em}%
%
% ^^A\vfill
% \noindent
-% \textbf{Note to Advanced Users:} This is a new package which internal macros
-% might still change. Please only rely on the user macros for now.
+% ^^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.
%
% \section{Introduction}
% This package uses the \pkg[pgf]{tikz} package to produce timing diagrams
@@ -855,7 +869,8 @@
% width}' in this document and which is by default identical to there height,
% called `\textsf{signal height}', which defaults to 1.6ex (about the height of
% the uppercase `X' of the current font).
-% Table~\ref{tab:chars} shows all by default defined logic characters.
+% Table~\ref{tab:chars} shows all by default defined logic characters and
+% Table~\ref{tab:full} all possible transitions.
% Additional functionality is provided by the ``modifiers'' shown in
% Table~\ref{tab:modifiers}.
%
@@ -931,6 +946,13 @@
%
% \begin{table}
% \let\texttimingbefore\texttiminggrid
+% \sffamily
+% \caption{Overview over all transitions.}\label{tab:full}
+% \makebox[\textwidth][c]{\tikztimingfullexampletable}
+% \end{table}
+%
+% \begin{table}
+% \let\texttimingbefore\texttiminggrid
% \let\normalfont\sffamily
% \sffamily\centering
% \caption{Modifiers for Timing Characters}\label{tab:modifiers}
@@ -949,10 +971,12 @@
% material into a data signal using the given settings. & D\{[blue]A\} &
% \texttiming{D{[blue]A}} \\
% \meta{\small integer}\{\meta{\small characters}\} & Repeats the given
-% characters by the given number. & 5\{hl\} & \texttiming{5{hl}}\\
+% characters \texttt{\meta{int}} times. & 5\{hl\} & \texttiming{5{hl}}\\
% \meta{\small number}\meta{\small character} & Sets width of next signal to
% given number. Half of it if character is in lower case. & 2.6H5.2l &
% \texttiming{2.6H5.2l}\\
+% \meta{\small number}B & Su\underline{b}tracts the given number from the width
+% of the next character. & H .5B L & \texttiming{H.5BL}\\
% N\oarg{\tiny Settings}\parg{\tiny Name}\marg{\tiny Content} & Adds node at
% current position. All three arguments are optional. & H N(a1) L &
% \texttiming{H N(a1) L}\\
@@ -971,38 +995,40 @@
% \end{tabularx}}
% \end{table}
%
-%
-%
-% \begin{table}
-% \let\texttimingbefore\texttiminggrid
-% \sffamily
-% \caption{Overview over all transitions.}\label{tab:full}
-% \makebox[\textwidth][c]{\tikztimingfullexampletable}
-% \end{table}
-%
% \subsection{Macro for use in Text Mode}
-%
-% \DescribeMacro{texttiming}{\oarg{initial character}\marg{characters}}
+% \vspace{-\bigskipamount}%
+% \DescribeMacro{texttiming}{\oarg{initial~character/TikZ
+% Settings}\marg{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 which define the
-% logical levels of the diagram line.
+% 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.
-%
-% \par\bigskip\noindent
-% \textit{Examples:}\\
-% |\texttiming{HLZDZLH}|^^A
+% 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}}'.
+% `{\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{15.5em}(\emph{defaults to}:
% \meta{empty})}
@@ -1027,40 +1053,88 @@
% \subsection{Macro for use inside TikZ-Pictures}
%
% \DescribeMacro{timing}{\oarg{TikZ Settings}\ ^^A
-% \parg{TikZ Coordinate}\ \{\oarg{initial character}\meta{characters}\};}
+% at \parg{TikZ Coordinate}\ \{\oarg{initial character}\meta{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 (which may start with |+| or |++|).
-% 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 might not be reversed. This small limitation might be overcome
-% in future versions of this package.
+% 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 might 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] (1,2) {HLZDZLH};|\phantom{\texttt{[L]}} gives
-% `\tikz \timing [green] (1,2) {HLZDZLH};'.
+% Example: |\tikz \timing [green] at (1,2) {HLZDZLH};|\phantom{\texttt{[L]}}
+% gives `\tikz \timing [green] at (1,2) {HLZDZLH};'.
%
-% Example: |\tikz \timing [green] (1,2) {[L]HLZDZLH};| gives `\tikz \timing
-% [green] (1,2) {[L]HLZDZLH};'.
+% Example: |\tikz \timing [green] at (1,2) {[L]HLZDZLH};| gives `\tikz \timing
+% [green] at (1,2) {[L]HLZDZLH};'.
+%
+% \subsubsection*{Timing Shape Anchors}
+% 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
+% \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}
+% \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}
%
% ^^A\newpage
% \subsection{Table for Timing Diagrams}
-% \DescribeEnv{tikztimingtable}{\oarg{TikZ settings}\\\meta{Signal Name}\ \ \&\
-% \ \meta{Characters} \textbackslash\textbackslash\\\dots\\
+% \DescribeEnv{tikztimingtable}{\oarg{TikZ settings for whole
+% table}\\\meta{Signal Name}\ \ \&\ \ \oarg{\small Init.~Char./TikZ Settings for
+% Row}\ \meta{Characters} \textbackslash\textbackslash\\\dots\\
% \hspace*{-1em}\cs{extracode}\ \% Optional\\\meta{additional code}}
% 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 ar the logic characters
-% which would be placed inside the argument of a \cs{texttiming} or \cs{timing}
-% macro. 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}.
+% 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}{}
% This macro is only defined inside a \env{tikztimingtable} environment and can
@@ -1142,27 +1216,85 @@
% The label column starts at $x=-$|\coldist| and the text is right align with
% the right border at this position.
%
+% \subsection{Meta-Characters}
+% It is possible to define recurring groups of characters and modifiers as so
+% called meta-characters. These characters are than expanded to the group
+% whenever they appear inside the character list. Please note that like for
+% groups a numeric factor before such a meta-character is taken as a repetition
+% factor not as a width. The meta-character is case sensitive and the other case
+% is not affected by the definition, \ie the lower- and uppercase versions of
+% one character can have complete different meanings. It is possible to redefine
+% normal characters (only one or both cases) as meta-characters, which
+% suppresses its normal meaning. Using the meta-character in its own definition
+% group causes a infinite loop which will lead to an \TeX\ error.
+%
+% \DescribeMacro{tikztimingmetachar}{\marg{Meta-Character}\marg{Character
+% Group}}
+% This macro defines the given \meta{meta-character} to be identical to the
+% given \meta{character group}. Alternatively this can also be done using the
+% TikZ style `|timing/metachar=|\marg{Meta-Character}\marg{Character~Group}'.
%
-% \newpage
+% An empty group deletes the meta-character, which might be necessary in cases
+% when normal characters are temporary redefined as meta-characters. However, if
+% the group only contains spaces the meta-character is practically ignored.
+%
+% \bigskip
+% \noindent
+% \textit{Examples:}\\[\medskipamount]
+% |\tikztimingmetachar{Y}{2D 0.5U 2D{}} \texttiming{ZZ Y Z 3Y ZZ}|\\
+% gives:\\
+% {\tikztimingmetachar{Y}{2D 0.5U 2D{}} \texttiming{ZZ Y Z 3Y ZZ}}
+% \\[\bigskipamount]
+% |\tikztimingmetachar{Y}{2D{Text}} \tikztimingmetachar{y}{1D{\tiny Text}}|
+% |\texttiming{ZZ Y Z 3y ZZ}|\\
+% gives:\\
+% {\tikztimingmetachar{Y}{2D{Text}} \tikztimingmetachar{y}{1D{\tiny Text}}
+% \texttiming{ZZ Y Z 3y ZZ}}
+% \\[\bigskipamount]
+% |\newcounter{mycount}|\\
+% |\tikztimingmetachar{H}{2D{\stepcounter{mycount}\arabic{mycount}}}|\\
+% |\tikztimingmetachar{R}{[/utils/exec=\setcounter{mycount}{0}]}|\\
+% |\texttiming{ 5H R 3H R 10H }|\\
+% gives:\\
+% {\newcounter{mycount}%
+% \tikztimingmetachar{H}{2D{\stepcounter{mycount}\arabic{mycount}}}%
+% \tikztimingmetachar{R}{[/utils/exec=\setcounter{mycount}{0}]}%
+% \texttiming{ 5H R 3H R 10H }}
+% \\[\bigskipamount]
+% Redefining the glitch `|G|' character:\\
+% |\tikztimingmetachar{G}{.1T.1T .2B} \tikztimingmetachar{g}{.1T.1T}|\\
+% |\texttiming{ 10{H G L G} H } % With correction of width `.2B'|\\
+% |\texttiming{ 10{H g L g} H } % Without correction|\\
+% |\texttiming{ 10{H L } H } % For comparison|\\
+% gives:\\
+% {\let\texttimingbefore\texttiminggrid
+% \tikztimingmetachar{G}{.1T.1T .2B} \tikztimingmetachar{g}{.1T.1T}%
+% \texttiming{ 10{H G L G} H }\\
+% \texttiming{ 10{H g L g} H }\\
+% \texttiming{ 10{H L } H }}
+%
+% \clearpage
% \section{Styles}\label{sec:styles}
% The generated logic signals are drawn using the style mechanism provided by
-% \pkg{tikz} (which is based on \pkg[pgf]{pgfkeys}). This styles are defined and
-% can be redefined using \css{tikzset}|{|\meta{style
-% name}|/.style=|\meta{value}|,}|. They can also be used in all places where
-% \meta{TikZ Settings} is mentioned. Please note that path/draw specific
-% settings might not survive the transition to characters which have there own
-% color, because these start a new drawing path. For a more detailed
-% explanation why this is necessary see the \pkg{tikz} manual. However, timing
-% specific settings are saved and restored between internal paths.
+% \pkg{tikz}. This styles are defined and can be redefined using
+% \css{tikzset}|{|\meta{style name}|/.style=|\meta{value}|,}|. They can also be
+% used in all places where \meta{TikZ Settings} is mentioned. Please note that
+% path/draw specific settings might not survive the transition to characters
+% which have there own color, because these start a new drawing path. For a
+% more detailed explanation why this is necessary see the \pkg{tikz} manual.
+% However, timing specific settings are saved and restored between internal
+% paths.
%
% The package follows the directory structures approach used by TikZ/PGF and
% places all styles and other settings under the ``subdirectory'' `|timing|' in
% the main ``directory'' `tikz', which is the default when \css{tikzset} is
-% used.\\Example: The slope of the transitions can be changed using the key
-% `|timing/slope|', which can also written in the absolute form
-% `|/tikz/timing/slope|'.
+% used.\\
+% ^^AExample: The slope of the transitions can be changed using the key
+% ^^A`|timing/slope|', which can also written in the absolute form
+% ^^A`|/tikz/timing/slope|'.
%
-% The Table~\ref{tab:styles} lists all styles defined by this package.
+% ^^AThe Table~\ref{tab:styles} lists all styles defined by this package.
+% {%
% \begin{table}[b]
% \centering
% \caption{TikZ Styles and Settings provided and used by this Package.}
@@ -1175,13 +1307,15 @@
% \midrule
% timing & Base settings like signal height \& period width.\\
% timing/intext & Used for \cs{texttiming}. Depends on |timing|.\\
+% timing/picture & Usable for own \texttt{tikzpictures} to set timing
+% settings.\\
% timing/grid & Used for grids. Depends on |help lines| and |timing|. \\
% timing/table & Used for \env{tikztimingtable}. Depends on |timing|.\\
% timing/table/grid & Used for table grid. Depends on |timing/grid|.\\
% timing/table/lines & Used for \cs{horlines} and \cs{vertlines}. \\
% timing/table/rules & Used for \cs{tablerules}. \\
-% timing/inline node & Used for nodes created by the |N| character. Default
-% to \texttt{coordinate}. \\
+% timing/inline node & Used for nodes created by the |N| character.
+% Defaults to \texttt{coordinate}.\\
% \midrule
% timing/\meta{lowercase char} & Style for character \meta{char}. Not used
% for `|H|' and `|L|'. \\
@@ -1190,6 +1324,10 @@
% timing/\meta{lc char}/text & Text style for character \meta{char}. Only
% defined for `|D|'. \\
% \midrule
+% timing/initchar=\meta{char} & Sets initial character. Only valid as first
+% optional argument in table rows or \cs{texttiming}.\\
+% timing/metachar=\meta{C}\meta{G} & Sets meta-character \meta{C} to
+% character group \meta{G}.\\
% timing/slope=\meta{0.0\en1.0} & Sets slope for logic transitions.
% \newline This also sets |dslope=2*slope|, |zslope=slope/2|.\\
% timing/lslope=\meta{0.0\en1.0} & Sets slope for logic transitions only.
@@ -1207,7 +1345,7 @@
% }
% ^^A\\[\smallskipamount]
% ^^A\emph{Note:} As a convention all style names are completely in lowercase.
-% \end{table}
+% \end{table}}
%
% \clearpage
% \section{Examples}
@@ -1312,10 +1450,10 @@
% \draw (0.2,0.7) circle (10pt);
% \begin{scope}[green]
% \draw (0.1,0.1) -- +(0.8,0.2);
-% \timing (0.3,0.4) {hlzhhlhhl};
+% \timing at (0.3,0.4) {hlzhhlhhl};
% \end{scope}
% \timing [rotate=-30]
-% (0.4,0.7) {HLZHHLHHL};
+% at (0.4,0.7) {HLZHHLHHL};
% \end{tikzpicture}
% \end{examplecode}
% \caption{\cs{timing} inside general \envv{tikzpicture}.}
@@ -1328,8 +1466,8 @@
% \begin{tikzpicture}[timing,thick,
% timing/inline node/.style={coordinate,
% shift={(0.05,-.5)}}]
-% \timing (0,2) {hH N(A) LHLHL};
-% \timing (0,0) {HLH N(B) LHLl};
+% \timing at (0,2) {hH N(A) LHLHL};
+% \timing at (0,0) {HLH N(B) LHLl};
% \draw [orange,semithick]
% (A) ellipse (.2 and .6) +(0,-0.6) coordinate (Ax)
% (B) ellipse (.2 and .6) +(0,+0.6) coordinate (Bx);
@@ -1356,7 +1494,7 @@
% Coarse Pulse - Delayed 3 & 6L 16H 3L \\
% \\
% Final Pulse Set & 3L 16H N(B5) 6L \\
-% Final Pulse $\overline{\text{Reset}}$ & 6L N(B4) 16H 3L \\
+% Final Pulse $\overline{\mbox{Reset}}$ & 6L N(B4) 16H 3L \\
% Final Pulse & 3L N(B1) 19H N(B8) 3L \\
% \extracode
% \tablerules
@@ -1478,13 +1616,20 @@
\RequirePackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{backgrounds}
-\RequirePackage{environ}
+\usetikzlibrary{decorations.pathmorphing}
+\ifx\collect@body\@undefined
+ \IfFileExists{environ.sty}
+ {\RequirePackage{environ}}
+ {\RequirePackage{amsmath}}
+\fi
\def\tikztimingwidth{0.0}
\newcount\tikztiming@numint
\newcount\tikztiming@numfrac
\def\tikztiming@num{1.0}%
-%%\def\tikztiming@num{\the\tikztiming@numint.\the\tikztiming@numfrac}
+\let\tikztiming@back\empty
+\newlength\tikztiming@xunit
+\newlength\tikztiming@yunit
\newcounter{tikztiming@nrows}%
\def\tikztiming@rowdist{2}%
@@ -1499,11 +1644,16 @@
\tikzset{timing/.style={%
x=1.6ex, y=1.6ex,
line cap=round, line join=round,
+ /utils/exec={\setlength{\tikztiming@xunit}{1.6ex}\setlength{\tikztiming@yunit}{1.6ex}},
}%
}
\tikzset{%
timing/.cd,
+ initchar/.value required,
+ initchar/.code={\ifx\lastchar\empty\uppercase{\def\lastchar{#1}}\fi},
+ metachar/.code 2 args={\tikztimingmetachar{#1}{#2}},
grid/.style={timing,help lines},
+ 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},
@@ -1517,10 +1667,14 @@
l/.style={},
d/.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={},
z/.style={blue},
t/.style={},
c/.style={timing/slope=0.0},
@@ -1574,23 +1728,28 @@
\DeclareRobustCommand*\texttiming[2][]{%
\begingroup
\tikztiming@init
- \uppercase{\def\lastchar{#1}}%
- \@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}{}}%
+ \ifx\relax#1\relax\else
+ \tikztiming@testoptarg#1\relax\relax%
\fi
- \tikztiming@#2\relax
- %\message{^^J\meaning\tikztiming@str^^J}%
- \begin{tikzpicture}[timing/intext]%
+ \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
\end{tikzpicture}%
\endgroup
@@ -1598,11 +1757,24 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\tikztiming@testoptarg}
+% \begin{macrocode}
+\def\tikztiming@testoptarg#1#2\relax{%
+ \ifx\relax#2\relax
+ \uppercase{\def\lastchar{#1}}%
+ \else
+ \def\settings{#1#2}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\tikztiming@init}
% \begin{macrocode}
\def\tikztiming@init{%
- \def\lastchar{}%
+ \let\lastchar\empty%
\let\currentchar\empty
+ \let\settings\empty
\def\tikztimingwidth{0.0}%
\setcounter{tikztimingtrans}{-1}%
\def\tikztiming@str{\draw (0,0) coordinate (timing/start base) }%
@@ -1623,16 +1795,31 @@
% \begin{macro}{\timing@}[1]{Optional TikZ Settings}
% \begin{macrocode}
\def\timing@[#1]{%
- \@ifnextchar{+}%
- {\timing@@{#1}}%
- {\@ifnextchar(%)
+ \@ifnextchar{a}%
+ {\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}}%
- {\timing@@{#1}+(0,0)}%
+ {\@ifnextchar(%)
+ {\timing@@{#1}}%
+ {\timing@@{#1}++(0,0)}%
+ }%
}%
}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\timing@at}[1]{Optional TikZ Settings}
+% \begin{macrocode}
+\def\timing@at#1at#2(#3){%
+ \timing@@@{#1}{#2(#3)}%
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\timing@@}[3]{Optional TikZ Settings}{Potential `+' or
% empty}{Coordinate}
% \begin{macrocode}
@@ -1648,13 +1835,15 @@
\def\timing@@@#1#2#3{%
\begingroup
\tikztiming@init
- \@ifnextchar{[}%
- {\timing@@@init}%
- {\timing@@@init[]}%
- #3\relax
- %\message{^^J\meaning\tikztiming@str^^J}%
+ \let\tikz@alias=\pgfutil@empty%
\begin{scope}[shift={#2},timing,#1]%
+ \@ifnextchar{[}%
+ {\timing@@@init}%
+ {\timing@@@init[]}%
+ #3\relax
+ %\message{^^J\meaning\tikztiming@str^^J}%
\tikztiming@str;%
+ \node [shape=tikztiming@shape,anchor=origin,#1] at (0,0) {};
\end{scope}%
\endgroup
\timing@@@end
@@ -1669,14 +1858,15 @@
\PackageError{tikz-package}{Can not parse timing path}{}{}{}%
\fi
}
-%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\timing@@@init}[1]{Initial character.}
% \begin{macrocode}
\def\timing@@@init[#1]{%
- \uppercase{\def\lastchar{#1}}%
+ \ifx\relax#1\relax\else
+ \uppercase{\def\lastchar{#1}}%
+ \fi
\@ifundefined{tikztiming@initcode@\lastchar}%
{}%
{\@nameuse{tikztiming@initcode@\lastchar}}%
@@ -1985,6 +2175,11 @@
\tikztiming@iflower{#1}%
{\pgfmathparse{\tikztiming@num/2.0}\let\tikztiming@num\pgfmathresult}%
{}%
+ \ifx\tikztiming@back\empty\else
+ \pgfmathparse{\tikztiming@num-\tikztiming@back}%
+ \let\tikztiming@num\pgfmathresult
+ \let\tikztiming@back\empty
+ \fi
\pgfmathparse{\tikztimingwidth + \tikztiming@num}%
\let\tikztimingwidth\pgfmathresult
\def\currentchar{#1}%
@@ -2068,9 +2263,17 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\tikztiming@stoppath}[1]{Character to gobble}
+% \begin{macro}{\tikztiming@defcode}[1]{Code Character}
+% \begin{macrocode}
+\def\tikztiming@defcode#1{%
+ \@namedef{tikztiming@code@\meaning#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tikztiming@defcode{,}}
% \begin{macrocode}
-\def\tikztiming@stoppath#1{%
+\tikztiming@defcode{,}{%
\tikztiming@output@flush
\tikztiming@eaddtostr{%
\newdraw
@@ -2080,9 +2283,9 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\tikztiming@stoppath@nosave}[1]{Character to gobble}
+% \begin{macro}{\tikztiming@defcode{;}}
% \begin{macrocode}
-\def\tikztiming@stoppath@nosave#1{%
+\tikztiming@defcode{;}{%
\tikztiming@output@flush
\tikztiming@eaddtostr{%
\newdrawns
@@ -2092,10 +2295,10 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\tikztiming@addnode}[1]{Character to gobble}
+% \begin{macro}{\tikztiming@defcode{N}}
% \begin{macrocode}
-\def\tikztiming@addnode#1{%
- \@ifnextchar{[}%]
+\tikztiming@defcode{N}{%
+ \@ifnextchar[%]
{\tikztiming@addnode@getoptions}%
{\tikztiming@addnode@getoptions[]}%
}
@@ -2105,7 +2308,7 @@
% \begin{macro}{\tikztiming@addnode}[1]{Options}
% \begin{macrocode}
\def\tikztiming@addnode@getoptions[#1]{%
- \@ifnextchar{(}%)}
+ \@ifnextchar(%)
{\tikztiming@addnode@getname{#1}}%
{\tikztiming@addnode@getname{#1}()}%
}
@@ -2146,18 +2349,10 @@
\def\tikztiming@testforcode{%
\@ifnextchar{!}%
{\tikztiming@testforcode@}%
- {\@ifnextchar{[}%
- {\tikztiming@handleoption}%
- {\@ifnextchar{;}%
- {\tikztiming@stoppath@nosave}%
- {\@ifnextchar{,}%
- {\tikztiming@stoppath}%
- {\@ifnextchar{N}%
- {\tikztiming@addnode}%
- {\tikztiming@@}%
- }%
- }%
- }%
+ {\@ifundefined{tikztiming@code@\meaning\@let@token}%
+ {\tikztiming@@}%
+ {\csname tikztiming@code@\meaning\@let@token\expandafter
+ \endcsname\@gobble}%
}%
}
% \end{macrocode}
@@ -2177,6 +2372,16 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\tikztiming@defcode{B}}
+% \begin{macrocode}
+\tikztiming@defcode{B}{%
+ \pgfmathparse{\tikztiming@back+\tikztiming@num}%
+ \let\tikztiming@back\pgfmathresult
+ \tikztiming@
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\tikztiming@handlecode}[1]{Code to add to string}
% \begin{macrocode}
\def\tikztiming@handlecode#1{%
@@ -2187,9 +2392,9 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\tikztiming@handleoption}[1]{Options to add to string}
+% \begin{macro}{\tikztiming@defcode []}[1]{Options to add to string}
% \begin{macrocode}
-\def\tikztiming@handleoption[#1]{%
+\tikztiming@defcode[#1]{%
\tikztiming@addtostr{ [#1] }%
\tikztiming@
}
@@ -2248,7 +2453,14 @@
\tikztiming@numint1\relax
\tikztiming@numfrac0\relax
\def\tikztiming@num{1.0}%
- \expandafter\tikztiming@testforcode
+ \if@tikztiming@metachar
+ {\def\@tempa{\expandafter\expandafter\expandafter
+ \tikztiming@testfornum@@@@
+ \expandafter\expandafter\expandafter{%
+ \csname tikztiming@metachar@\meaning\@let@token\endcsname}}%
+ \expandafter\@tempa\@gobble
+ }%
+ {\tikztiming@testforcode}%
}%
}%
\fi
@@ -2285,12 +2497,40 @@
\tikztiming@testfornum@@@@
}%
{%
- \tikztiming@testforcode
+ \if@tikztiming@metachar
+ {\def\@tempa{\expandafter\expandafter\expandafter
+ \tikztiming@testfornum@@@@
+ \expandafter\expandafter\expandafter{%
+ \csname tikztiming@metachar@\meaning\@let@token\endcsname}}%
+ \expandafter\@tempa\@gobble
+ }%
+ {\tikztiming@testforcode}%
}%
}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\tikztimig@metachar}[2]{Macro character}{Substituted
+% Characters}
+% \begin{macrocode}
+\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
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@tikztimig@metachar}[2]{True clause}{False clause}
+% \begin{macrocode}
+\def\if@tikztiming@metachar#1#2{%
+ \@ifundefined{tikztiming@metachar@\meaning\@let@token}{#2}{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\tikztiming@testfornum@@@@}[1]{Characters and other tokens to
% repeat}
% \begin{macrocode}
@@ -2320,7 +2560,7 @@
% \begin{environment}{tikztimingtable}[1]{Optional settings}
% \begin{macrocode}
-\NewEnviron{tikztimingtable}[1][]{%
+\newenvironment{tikztimingtable}[1][]{%
\begingroup
\setcounter{tikztiming@nrows}{0}%
\def\tikztiming@maxwidth{0.0}%
@@ -2334,19 +2574,32 @@
\def\coldist{\tikztiming@coldist}%
\def\nrows{\the\c@tikztiming@nrows}%
\def\twidth{\tikztiming@maxwidth}%
- \begin{tikzpicture}[timing/table,#1]%
+ \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);
- \expandafter\tikztimingtable@row\BODY\endtikztimingtable@
- \end{tikzpicture}
+ \collect@body\tikztiming@table
+}{%
+}
+% \end{macrocode}
+% \end{environment}
+
+% \begin{macro}{\tikztiming@table}[1]{Table content}
+% \begin{macrocode}
+\def\tikztiming@table#1{%
+ \tikztimingtable@row#1\endtikztimingtable@
+ \endtikzpicture
\endgroup
}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\endtikztimingtable@}
+% \begin{macrocode}
\def\endtikztimingtable@{\@gobble{ENDTIKSTIMING}}
% \end{macrocode}
-% \end{environment}
+% \end{macro}
% \begin{macro}{\tikztimingextracode}[2]{Token to gobble}{Extra drawing code}
% \begin{macrocode}
@@ -2413,7 +2666,10 @@
\path ($ (last row) + (0,-1*\rowdist) $) coordinate (last row);
\path ($ (last row) + (-1*\coldist,0) $) node [anchor=base east,timing/name]
{\tikztiminglabel{#1}};
- \timing (last row) {#2};
+ \@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);
%
@@ -2432,6 +2688,21 @@
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\tikztiming@tabletiming}
+% \begin{macrocode}
+\def\tikztiming@tabletiming[#1]#2\relax{%
+ \let\lastchar\empty
+ \let\settings\empty
+ \ifx\relax#1\relax\else
+ \tikztiming@testoptarg#1\relax\relax
+ \fi
+ \edef\@tempa{\noexpand\timing[name=row\the\c@tikztiming@nrows,\settings]
+ at (last row)}%
+ \expandafter\@tempa\expandafter{\expandafter[\lastchar]#2};
+}
+% \end{macrocode}
+% \end{macro}
+
% \begin{macro}{\tikztiming@fulltablegrid}[1]{Optional settings}
% \begin{macrocode}
\newcommand*\tikztiming@fulltablegrid[1][]{%
@@ -2516,6 +2787,62 @@
% \end{macrocode}
% \end{macro}
%
+% \subsection{Shape}
+% \begin{macrocode}
+\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
+ }%
+ \anchor{center}{\pgfpointorigin}%
+ \anchor{start}{\startpoint}%
+ \anchor{end}{\endpoint}%
+ %
+ \anchor{origin}{\northeast \pgf@x=-\pgf@x \pgf@y=-\pgf@y }%
+ \anchor{east}{\northeast \pgf@y=0pt }%
+ \anchor{west}{\northeast \pgf@y=0pt \pgf@x=-\pgf@x }%
+ \anchor{north}{\northeast \pgf@x=0pt }%
+ \anchor{north west}{\northeast \pgf@x=-\pgf@x }%
+ \anchor{north east}{\northeast}
+ \anchor{high mid}{\northeast \pgf@x=0pt }%
+ \anchor{high start}{\northeast \pgf@x=-\pgf@x }%
+ \anchor{high end}{\northeast}
+ \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-\pgf@y }%
+ \anchor{south west}{\northeast \pgf@x=-\pgf@x \pgf@y=-\pgf@y }%
+ \anchor{south east}{\northeast \pgf@y=-\pgf@y }%
+ \anchor{low mid}{\northeast \pgf@x=0pt \pgf@y=-\pgf@y }%
+ \anchor{low start}{\northeast \pgf@x=-\pgf@x \pgf@y=-\pgf@y }%
+ \anchor{low end}{\northeast \pgf@y=-\pgf@y }%
+ \anchor{mid}{\pgfpointorigin}%
+ \anchor{mid east}{\northeast \pgf@y=0pt }%
+ \anchor{mid west}{\northeast \pgf@y=0pt \pgf@x=-\pgf@x }%
+ \anchor{mid end}{\northeast \pgf@y=0pt }%
+ \anchor{mid start}{\northeast \pgf@y=0pt \pgf@x=-\pgf@x }%
+ \anchor{base}{\northeast \pgf@x=0pt \pgf@y=-\pgf@y }%
+ \anchor{base west}{\northeast \pgf@x=-\pgf@x \pgf@y=-\pgf@y }%
+ \anchor{base east}{\northeast \pgf@y=-\pgf@y }%
+ \anchorborder{%
+ \@tempdima=\pgf@x
+ \@tempdimb=\pgf@y
+ \pgfpointborderrectangle{\pgfpoint{\@tempdima}{\@tempdimb}}{\northeastborder}%
+ }%
+}
+% \end{macrocode}
+%
% \subsection{Other Macros}
%
% \begin{macro}{\tikztiming@iflower}[1]{Character}
@@ -2970,7 +3297,6 @@
-- ++(\gslope,-\height/2.0)
}
\tikztiminglet{DG}{LG}
-\tikztiminglet{MG}{ZG}
\tikztiminglet{HS}{S}
\tikztiminglet{LS}{S}
@@ -2986,7 +3312,7 @@
\newdraw [\style]
-- ++(\zslope,-\height/2.) -- ++($ (#1,0) - (\zslope,0) $)
}
- \tikztimingdef{ZH}{
+\tikztimingdef{ZH}{
\newdraw
-- ++(\zslope,+\height/2.) -- ++($ (#1,0) - (\zslope,0) $)
}
@@ -3051,133 +3377,46 @@
\tikztimingalias{M}{Z}
\tikztimingchar{M}{++(0,\height/2.)}{
- [\style]
- -- ++($ 1/16.*(#1,0) + (0,+\height*.225) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/16.*(#1,0) + (0,+\height*.225) $)
+ \newdraw [\style/decoration,\style]
+ -- ++(#1,0)
+}
+\tikztimingdef{MG}{
+ \newdraw [timing/m]
+ -- ++(\gslope,-\height/2.0)
+ -- ++(\gslope,+\height)
+ -- ++(\gslope,-\height/2.0)
}
\tikztimingdef{MZ}{
\newdraw [\style]
- -- ++(#1,0)
-}
-
-\tikztimingdef{m}{
- [\style]
- ++(0,+\height/2.)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.225) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/4.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.225) $)
+ \tikztiminguse{ZZ}{#1}
}
\tikztimingdef{ZM}{
\newdraw [\style]
- -- ++($ 1/16.*(#1,0) + (0,+\height*.075) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.20) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.35) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.40) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/16.*(#1,0) + (0,+\height*.225) $)
-}
-
-\tikztimingdef{Zm}{
- \newdraw [\style]
- -- ++($ 1/8.*(#1,0) + (0,+\height*.075) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.20) $)
- -- ++($ 1/4.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.175) $)
-}
-
-\tikztimingdef{Mm}{
- -- ++($ 1/8.*(#1,0) + (0,+\height*.225) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/4.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.225) $)
+ \tikztiminguse{MM}{#1}
}
\tikztimingdef{LM}{
\newdraw [\style]
- -- ++($ 1/16.*(#1,0) + (0,+\height*.60) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.20) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.35) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.40) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/16.*(#1,0) + (0,+\height*.20) $)
+ -- ++($ (1/8,0) + (0,\height/2) $)
+ \newdraw [\style/decoration,\style]
+ -- ++($ (-1/8,0) + (#1,0) $)
}
+
\tikztimingdef{HM}{
\newdraw [\style]
- -- ++($ 1/16.*(#1,0) + (0,-\height*.40) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.20) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.35) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.40) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/16.*(#1,0) + (0,+\height*.20) $)
-}
-\tikztimingdef{DM}{
- ++($ -1/16.*(#1,0) + (0,0) $)
- -- ++($ 1/16.*(#1,0) + (0,0) $)
- -- ++($ 1/16.*(#1,0) + (0,+\height*.50) $)
- ++($ -1/8.*(#1,0) + (0,+\height*.50) $)
- -- ++($ 1/16.*(#1,0) + (0,0) $)
- -- ++($ 1/16.*(#1,0) + (0,-\height*.50) $)
- \newdraw [\style]
- -- ++($ 1/8.*(#1,0) + (0,-\height*.10) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.35) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.40) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/16.*(#1,0) + (0,+\height*.20) $)
+ -- ++($ (1/8,0) + (0,-1*\height/2) $)
+ \newdraw [\style/decoration,\style]
+ -- ++($ (-1/8,0) + (#1,0) $)
}
-\tikztimingdef{Lm}{
- \newdraw [\style]
- -- ++($ 1/8.*(#1,0) + (0,+\height*.575) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.20) $)
- -- ++($ 1/4.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.175) $)
-}
-\tikztimingdef{Hm}{
- \newdraw [\style]
- -- ++($ 1/8.*(#1,0) + (0,-\height*.425) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.20) $)
- -- ++($ 1/4.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.175) $)
-}
-\tikztimingdef{Dm}{
- ++($ -1/8.*(#1,0) + (0,0) $)
- -- ++($ 1/8.*(#1,0) + (0,0) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.50) $)
- ++($ -1/4.*(#1,0) + (0,+\height*.50) $)
- -- ++($ 1/8.*(#1,0) + (0,0) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.50) $)
- \newdraw [\style]
- -- ++($ 1/4.*(#1,0) + (0,-\height*.10) $)
- -- ++($ 1/4.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.15) $)
+\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) $)
}
\newcounter{tikztimingtrans}
@@ -3228,7 +3467,7 @@
\tikztimingdef{ZT}{%
\newdraw
{[\style]
- node [timing/save] {\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}}
+ \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}}
-- ++(\slope,\value{tikztimingtrans}*\height/2.)
-- ++($ (#1,0) - (\slope,0) $)
}
@@ -3271,25 +3510,9 @@
\tikztimingdef{TM}{%
\newdraw [\style]
\code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}}
- -- ++($ 1/16.*(#1,0) + (0,\value{tikztimingtrans}*\height*.50+\height*.10) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.20) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.35) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.40) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.45) $)
- -- ++($ 1/8.*(#1,0) + (0,-\height*.45) $)
- -- ++($ 1/16.*(#1,0) + (0,+\height*.20) $)
-}
-
-\tikztimingdef{Tm}{%
- \newdraw [\style]
- \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}}
- -- ++($ 1/8.*(#1,0) + (0,\value{tikztimingtrans}*\height*.50+\height*.075) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.20) $)
- -- ++($ 1/4.*(#1,0) + (0,+\height*.25) $)
- -- ++($ 1/4.*(#1,0) + (0,-\height*.30) $)
- -- ++($ 1/8.*(#1,0) + (0,+\height*.175) $)
+ -- ++($ (1/8,0) + (0,\value{tikztimingtrans}*\height/2) $)
+ \newdraw [\style/decoration,\style]
+ -- ++($ (-1/8,0) + (#1,0) $)
}
\tikztimingecopy{C}{T}