diff options
author | Karl Berry <karl@freefriends.org> | 2009-08-05 13:31:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-08-05 13:31:52 +0000 |
commit | 036676ef7916ae35aa73e59c91f81ae9272c6ef4 (patch) | |
tree | 08bff4bd499f3da9d5f34fc5563b5be38d3949af /Master/texmf-dist/source/latex/tikz-timing | |
parent | 2ead1b8c1d880bf42cb0886b3a9dc62ff777f57a (diff) |
tikz-timing update (27jul09)
git-svn-id: svn://tug.org/texlive/trunk@14540 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/tikz-timing')
3 files changed, 386 insertions, 25 deletions
diff --git a/Master/texmf-dist/source/latex/tikz-timing/Makefile b/Master/texmf-dist/source/latex/tikz-timing/Makefile index 9da2ee642cf..b9a8a21a1fa 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 1120 2009-05-14 12:15:10Z martin $ +# $Id: Makefile 1156 2009-07-28 01:16:20Z martin $ PACKAGE=tikz-timing PACKAGE_STY = ${PACKAGE}.sty 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 3f2780ec51e..e50557c636a 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 1132 2009-05-15 15:23:50Z martin $ +% $Id: tikz-timing.dtx 1158 2009-07-28 09:14:00Z martin $ % \fi % % \iffalse @@ -31,14 +31,20 @@ %<package>\ProvidesPackageSVN %<examplecode>\ProvidesPackageSVN[tikz-timing-examplecode] %<ydoc>\ProvidesPackageSVN[ydoc] +%<lib-arrows>\ProvidesPackageSVN[tikz-timing-arrows] +%<lib-either>\ProvidesPackageSVN[tikz-timing-either] +%<lib-overlays>\ProvidesPackageSVN[tikz-timing-overlays] %<*driver> \ProvidesFileSVN %</driver> - {$Id: tikz-timing.dtx 1132 2009-05-15 15:23:50Z martin $} - [v0.5 + {$Id: tikz-timing.dtx 1158 2009-07-28 09:14:00Z martin $} + [v0.6a %<package> Digital Timing Diagrams using TikZ] %<examplecode> Macros to produce examples for the tikz-timing package] %<ydoc> Documentation Macros for tikz-timing package] +%<lib-arrows> TikZ-Timing Library for timing arrows] +%<lib-either> TikZ-Timing Library for uncertain transitions] +%<lib-overlays> TikZ-Timing Library for timing overlays] %<*driver> DTX-File of 'tikz-timing' package.] %</driver> @@ -52,6 +58,7 @@ %<*driver> \documentclass{ltxdoc} \usepackage{tikz-timing}[\tikztiming@date] +\usetikztiminglibrary{arrows,either,overlays} \makeatother \usepackage[electronic]{ifsym} \usepackage{calc} @@ -697,17 +704,7 @@ \def\tikztimingfullexampletable{ \begin{tikzpicture}[x=1em,y=1em,font=\sffamily] \tikzset{timing/d/background/.style={fill={gray!25},fill opacity=0.5}}% - \iffalse - \def\chars{\@gobble}% - \def\@tempa{}% - \@for\tchar:=\tikztiming@chars\do{% - \expandafter\lowercase\expandafter{\expandafter\def\expandafter\@tempa - \expandafter{\tchar}}% - \edef\chars{\chars,\tchar,\@tempa}% - } - \else - \let\chars\tikztiming@chars - \fi + \let\chars\tikztiming@chars@default \node (charnode) at (0,0) {% \scalebox{0.4}% {\rotatebox{-45}{$\frac{\mbox{\rotatebox{45}{to}}}% @@ -770,7 +767,7 @@ %</driver> % \fi % -% \CheckSum{1998} +% \CheckSum{2221} % % \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 @@ -810,6 +807,12 @@ % `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}'. Added support for +% lower-case modifiers ``\texttt{b}',`\texttt{f}' and \texttt{n}'. Added new +% optional 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}'.} % % \GetFileInfo{tikz-timing.dtx} % @@ -976,7 +979,10 @@ % 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}\\ +% of the next character. ``\textit{\texttt{B}ackwards}''& H .5B L & +% \texttiming{H.5BL}\\ +% \meta{\small number}F & Adds the given number to the width of the next +% character. ``\textit{\texttt{F}orwards}''& H .5F L & \texttiming{H.5FL}\\ % 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}\\ @@ -1252,14 +1258,14 @@ % \texttiming{ZZ Y Z 3y ZZ}} % \\[\bigskipamount] % |\newcounter{mycount}|\\ -% |\tikztimingmetachar{H}{2D{\stepcounter{mycount}\arabic{mycount}}}|\\ +% |\tikztimingmetachar{Q}{2D{\stepcounter{mycount}\arabic{mycount}}}|\\ % |\tikztimingmetachar{R}{[/utils/exec=\setcounter{mycount}{0}]}|\\ -% |\texttiming{ 5H R 3H R 10H }|\\ +% |\texttiming{ 5Q R 3Q R 10Q }|\\ % gives:\\ % {\newcounter{mycount}% -% \tikztimingmetachar{H}{2D{\stepcounter{mycount}\arabic{mycount}}}% +% \tikztimingmetachar{Q}{2D{\stepcounter{mycount}\arabic{mycount}}}% % \tikztimingmetachar{R}{[/utils/exec=\setcounter{mycount}{0}]}% -% \texttiming{ 5H R 3H R 10H }} +% \texttiming{ 5Q R 3Q R 10Q }} % \\[\bigskipamount] % Redefining the glitch `|G|' character:\\ % |\tikztimingmetachar{G}{.1T.1T .2B} \tikztimingmetachar{g}{.1T.1T}|\\ @@ -1347,6 +1353,111 @@ % ^^A\emph{Note:} As a convention all style names are completely in lowercase. % \end{table}} % +% \section{Libraries for Further Characters} +% All default timing characters described in Table~\ref{tab:chars} are always +% made available by this package. Further, less-common characters are provided +% by libraries which are loaded with the macro +% \cs{usetikztiminglibrary}\marg{library}. This is done to hold the memory +% usage of this package small and reduce the risk of collisions with +% user-defined (meta-)characters. +% The full syntax for the above macro is +% \cs{usetikztiminglibrary}\oarg{options}\marg{library,\dots}\oarg{date}, like +% the one for \cs{usepackage}. However, no library provides any options so far. +% The date is used as a version number like for packages. +% +% \subsection{Arrows} +% The library `|arrows|' enables two characters `|A|' and `|W|' which draw +% vertical up and down \textit{A}rro\!\textit{W}s. Such arrows are used in +% timing diagrams to mark special polarized events, like clock edges of another +% signal. +% +% The width provided with these character is added as whitespace after the +% ``zero-width'' arrow: `|A2AA|' results in `\,\texttiming{A2AA}'. This space +% can be avoided by specifying the width to zero: `|0.A|'. Like the `|C|' and +% `|T|' characters the subsequent arrow characters are not combined into one. +% +% The arrow tips can be changed using the TikZ styles for this characters. See +% \ref{sec:styles} for more information. The `|A|' character should not be used +% together with any other characters except with `|S|' (space). +% +% \begin{table}[H] +% \centering +% \caption{Examples for Arrow Characters.}\label{tab:arrows} +% \begin{tikztimingexampletable} +% AAA \\ +% 3A \\ +% 3{A} \\ +% 3A 3A \\ +% 3a 3a \\ +% AW AW \\ +% 3{AW} \\ +% 3{aw} \\ +% 2S 2A 3W A W \\ +% \end{tikztimingexampletable} +% \end{table} +% +% \subsection{Either High or Low} +% The library `|either|' is enabling the `|E|' character which stands for +% `\textit{either high or low}'. This character is designed to be used with the +% `|H|' and `|L|' characters to display a uncertainty of a transition. +% Sometimes a, e.g.\ low signal can go either to high or stay at low for a +% certain time before it definitely goes to high. In this case both (or more) +% possible transitions can be drawn using this character. +% Like the `|C|' and `|T|' characters subsequent `|E|' characters are not +% combined into one. +% +% \begin{table}[H] +% \centering +% \caption{Examples for the `\texttt{E}' Character.}\label{tab:either} +% \begin{tikztimingexampletable} +% L E H \\ +% L D H \\ +% H E L \\ +% H D L \\ +% L E E H \\ +% L 3{.25E} H \\ +% H E E L \\ +% L EEE HH EEE L \\ +% l e e h \\ +% h e e l \\ +% H 2E L \\ +% H 2{E} L \\ +% H 5{e} L \\ +% H E E H \\ +% L E E L \\ +% \end{tikztimingexampletable} +% \end{table} +% +% \subsection{Overlays} +% The library `|overlays|' is enabling the `|O|' character which allows the +% overlaying of two different groups of timing characters. This character awaits +% two groups enclosed by braces which are drawn in the given order. The position +% before the `|O|' character is saved and restored to draw the second group. +% The characters of the first group connect to the characters before the `|O|' +% modifier but then simply end. +% The characters following after the groups connect to the characters of the +% second group as normal. +% It is the responsibility of the user to make sure that the lines drawn by the +% first group reconnect to the main lines or do something else useful. The +% modifier `|;|' can be used in the first group to restart the drawn line, e.g.\ +% to change to a different color. This is not done automatically to give the +% user the freedom if and where this should happen. It is recommended to start +% and end both groups with the same character to avoid ugly connection points. +% +% \begin{table}[H] +% \centering +% \caption{Examples for the `\texttt{O}' Overlay Character.}\label{tab:overlays} +% \begin{tikztimingexampletable} +% LLL O{HH}{LL} HHH \\ +% LLL O{HHH}{LL} HHH \\ +% LLL O{[gray]HHH}{LLH} HH \\ +% LLL O{;[gray]HH.1H;}{LLH} HH \\ +% LL O{L;[gray]HH.1H;}{LLLH} HH \\ +% HHH O{;[gray]HH.1L;}{LL} LLL \\ +% \end{tikztimingexampletable} +% \end{table} +% +% % \clearpage % \section{Examples} % This section shows some examples by putting either the full source code or @@ -1614,6 +1725,7 @@ % \begin{macrocode} %<*package> \RequirePackage{tikz} + \usetikzlibrary{calc} \usetikzlibrary{backgrounds} \usetikzlibrary{decorations.pathmorphing} @@ -1623,6 +1735,28 @@ {\RequirePackage{amsmath}} \fi +\newcommand*\usetikztiminglibrary[2][]{% + \edef\tikztiming@library@options{#1}% + \@ifnextchar{[}%] + {\tikztiming@library{#2}}% + {\tikztiming@library{#2}[]}% +} +\def\tikztiming@library#1[#2]{% + \edef\tikztiming@library@date{#2}% + \tikztiming@library@#1,\relax +} + +\def\tikztiming@library@#1,{% + \IfFileExists{tikz-timing-#1.sty}% + {\RequirePackage[\tikztiming@library@options]{tikz-timing-#1}% + [\tikztiming@library@date]}% + {\PackageError{tikz-timing}% + {No tikz-timing library `#1' found!}% + {}{}{}{}% + }% + \@ifnextchar\relax{}{\tikztiming@library@}% +} + \def\tikztimingwidth{0.0} \newcount\tikztiming@numint \newcount\tikztiming@numfrac @@ -1657,8 +1791,8 @@ intext/.style={timing,line width=0.15ex}, inline node/.style={shape=coordinate}, table/.style={timing,line width=0.15ex,font=\sffamily}, - coord/.style={inner sep=0pt,outer sep=0pt}, - save/.style={inner sep=0pt,outer sep=0pt,/utils/exec=\tikztiming@savesettings}, + coord/.style={coordinate}, + save/.style={coordinate,/utils/exec=\tikztiming@savesettings}, restore/.style={/utils/exec=\tikztiming@restoresettings}, name/.style={inner sep=0pt,outer sep=0pt}, d/text/.style={timing,scale=0.6,font=\sffamily}, @@ -1666,6 +1800,10 @@ h/.style={}, l/.style={}, d/.style={}, + e/.style={}, + e/background/.style={}, + a/.style={->}, + w/.style={<-}, m/.style={black!40!brown}, m/decoration/.style={decorate,decoration={zigzag,segment length=.25\tikztiming@xunit,amplitude=.225\tikztiming@yunit}}, @@ -1777,6 +1915,7 @@ \let\settings\empty \def\tikztimingwidth{0.0}% \setcounter{tikztimingtrans}{-1}% + \setcounter{tikztimingtranspos}{0}% \def\tikztiming@str{\draw (0,0) coordinate (timing/start base) }% } % \end{macrocode} @@ -2305,6 +2444,16 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\tikztiming@defcode{n}} +% \begin{macrocode} +\tikztiming@defcode{n}{% + \@ifnextchar[%] + {\tikztiming@addnode@getoptions}% + {\tikztiming@addnode@getoptions[]}% +} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\tikztiming@addnode}[1]{Options} % \begin{macrocode} \def\tikztiming@addnode@getoptions[#1]{% @@ -2382,6 +2531,80 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\tikztiming@defcode{b}} +% \begin{macrocode} +\tikztiming@defcode{b}{% + \pgfmathparse{\tikztiming@back+\tikztiming@num/2}% + \let\tikztiming@back\pgfmathresult + \tikztiming@ +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tikztiming@defcode{F}} +% \begin{macrocode} +\tikztiming@defcode{F}{% + \pgfmathparse{\tikztiming@back-\tikztiming@num}% + \let\tikztiming@back\pgfmathresult + \tikztiming@ +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tikztiming@defcode{f}} +% \begin{macrocode} +\tikztiming@defcode{f}{% + \pgfmathparse{\tikztiming@back-\tikztiming@num/2}% + \let\tikztiming@back\pgfmathresult + \tikztiming@ +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</package> +%<*lib-overlays> +% \end{macrocode} +% \begin{macro}{\tikztiming@defcode{O}} +% \begin{macrocode} +\tikztiming@defcode{O}{% + \@ifnextchar\relax + {\tikztiming@\relax}% + {\tikztiming@overlay}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tikztiming@overlays} +% \begin{macrocode} +\def\tikztiming@overlay#1#2{% + \ifx\relax#1\relax + \tikztiming@output@flush + \def\next{\tikztiming@\relax}% + \else + \ifx\relax#2\relax + \def\next{\tikztiming@#1\relax}% + \else + \tikztiming@output@flush + \let\tikztiming@overlay@lastchar\lastchar + \tikztiming@addtostr{ node [timing/save] (timing@overlay@start) {} }% + \tikztiming@#1\relax + \tikztiming@output@flush + \let\lastchar\tikztiming@overlay@lastchar + \tikztiming@addtostr{ (timing@overlay@start) }% + \def\next{\tikztiming@#2}% + \fi + \fi + \next +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</lib-overlays> +%<*package> +% \end{macrocode} +% % \begin{macro}{\tikztiming@handlecode}[1]{Code to add to string} % \begin{macrocode} \def\tikztiming@handlecode#1{% @@ -3515,6 +3738,92 @@ -- ++($ (-1/8,0) + (#1,0) $) } +\let\tikztiming@chars@default\tikztiming@chars + +% \end{macrocode} +% \begin{macrocode} +%</package> +%<*lib-either> +% \end{macrocode} +% \begin{macrocode} + +\tikztimingecopy{E}{D} +\tikztimingchar{E}{ + ++(0,0) + \code{\setcounter{tikztimingtranspos}{0}}% + \code{\setcounter{tikztimingtrans}{1}}% +}{ + \code{\setcounter{tikztimingtranspos}{0}}% + \code{\setcounter{tikztimingtrans}{1}}% + \tikztiminguse{D}{#1}% +} +\tikztimingdef{LE}{% + -- ++(#1,0)% + \code{\setcounter{tikztimingtranspos}{0}}% + \code{\setcounter{tikztimingtrans}{1}}% + ++($ -1*(#1,0) $)% + -- ++(\slope,\height)% + -- ++($ (#1,0) - (\slope,0) $)% + ++(0,-\height)% +}% +\tikztimingdef{HE}{% + -- ++(#1,0)% + \code{\setcounter{tikztimingtranspos}{1}}% + \code{\setcounter{tikztimingtrans}{-1}}% + ++($ -1*(#1,0) $)% + -- ++(\slope,-\height)% + -- ++($ (#1,0) - (\slope,0) $)% +}% +\tikztimingdef{EE}{% + ++(0, \height * \value{tikztimingtranspos})% + ++(#1,0)% + -- ++($ -1*(#1,0) $)% + -- ++(\slope, \height * \value{tikztimingtrans})% + -- ++(-\slope,0)% + -- ++(#1,0)% + ++(0, -\height + \height * \value{tikztimingtranspos})% +}% +\tikztimingdef{EH}{% + ++(0,+\height)% + -- ++(\slope,0)% + ++(-\slope,-\height)% + -- ++(\slope/2.,+\height/2.)% + \newdraw [\style]% + -- ++(\slope/2.,+\height/2.)% + -- ++($ (#1,0) - (\slope,0) $)% +}% +\tikztimingdef{EL}{% + -- ++(\slope,0)% + ++(-\slope,\height)% + -- ++(\slope/2.,-\height/2.)% + \newdraw [\style]% + -- ++(\slope/2.,-\height/2.)% + -- ++($ (#1,0) - (\slope,0) $)% +}% +\tikztimingdef{ZE}{% + \code{\setcounter{tikztimingtranspos}{1}}% + \code{\setcounter{tikztimingtrans}{-1}}% + \tikztiminguse{ZD}{#1}% +} +\tikztimingdef{XE}{% + \code{\setcounter{tikztimingtranspos}{1}}% + \code{\setcounter{tikztimingtrans}{-1}}% + \tikztiminguse{XD}{#1}% +} +\tikztimingdef{ME}{% + \code{\setcounter{tikztimingtranspos}{1}}% + \code{\setcounter{tikztimingtrans}{-1}}% + \tikztiminguse{MD}{#1}% +} +\def\tikztiming@nocombine@E{}%% +\def\tikztiming@nocombine@e{}%% +% \end{macrocode} +% \begin{macrocode} +%</lib-either> +%<*package> +% \end{macrocode} +% \begin{macrocode} + \tikztimingecopy{C}{T} \def\tikztiming@nocombine@T{}% \def\tikztiming@nocombine@C{}% @@ -3522,7 +3831,8 @@ \def\tikztiming@nocombine@c{}% \def\tikztiming@nocombine@M{}% \def\tikztiming@nocombine@m{}% - +\def\tikztiming@nocombine@W{}% +\def\tikztiming@nocombine@w{}% \tikztimingecopy{U}{D} \tikztimingdef{UD}{\tikztiminguse{D@edge@D}{#1}} @@ -3530,6 +3840,54 @@ %\tikztimingecopy{O}{D} \tikztimingecopy{X}{Z} + +% \end{macrocode} +% \begin{macrocode} +%</package> +%<*lib-arrows> +% \end{macrocode} +% \begin{macrocode} +\tikztimingchar{A}{++(0,0)}{% + \newdraw [\style] -- ++(0,\height) + \newdraw ++(#1,-\height) +} +\def\tikztiming@nocombine@A{}% +\def\tikztiming@nocombine@a{}% +\tikztiminglet{AS}{SS} +\tikztiminglet{AH}{H} +\tikztiminglet{AZ}{Z} +\tikztimingdef{ZA}{ + ++(0,-0.5*\height) + \tikztiminguse{A}{#1} +} +\tikztimingdef{HA}{ + ++(0,-\height) + \tikztiminguse{A}{#1} +} +\tikztiminglet{XA}{ZA} +\tikztiminglet{MA}{ZA} +\tikztiminglet{AX}{AZ} +\tikztiminglet{AM}{AZ} +\tikztiminglet{LA}{A} +\tikztiminglet{AL}{LL} +\tikztiminglet{AD}{DD} +\tikztiminglet{AE}{LE} +\tikztiminglet{AU}{UU} +\tikztiminglet{SA}{A} +\tikztiminglet{AG}{G} +\tikztiminglet{AT}{LT} +\tikztiminglet{AC}{LC} +\tikztiminglet{DA}{A} +\tikztiminglet{UA}{A} +\tikztiminglet{TA}{A} +\tikztiminglet{CA}{A} +\tikztiminglet{EA}{A} + +\tikztimingecopy{W}{A} +% \end{macrocode} +% \begin{macrocode} +%</lib-arrows> +%<*package> % \end{macrocode} % % \Finale diff --git a/Master/texmf-dist/source/latex/tikz-timing/tikz-timing.ins b/Master/texmf-dist/source/latex/tikz-timing/tikz-timing.ins index a5b60881337..384455cac41 100644 --- a/Master/texmf-dist/source/latex/tikz-timing/tikz-timing.ins +++ b/Master/texmf-dist/source/latex/tikz-timing/tikz-timing.ins @@ -1,4 +1,4 @@ -% $Id: tikz-timing.ins 1069 2009-05-05 13:52:29Z martin $ +% $Id: tikz-timing.ins 1156 2009-07-28 01:16:20Z martin $ \input docstrip.tex \preamble @@ -26,6 +26,9 @@ and the derived file tikz-timing.sty. \generate{% \file{tikz-timing.sty}{\from{tikz-timing.dtx}{package}}% + \file{tikz-timing-arrows.sty}{\from{tikz-timing.dtx}{lib-arrows}}% + \file{tikz-timing-either.sty}{\from{tikz-timing.dtx}{lib-either}}% + \file{tikz-timing-overlays.sty}{\from{tikz-timing.dtx}{lib-overlays}}% % \file{tikz-timing-examplecode.sty}{\from{tikz-timing.dtx}{examplecode}}% % \file{ydoc.sty}{\from{tikz-timing.dtx}{ydoc}}% } |