You can use stacked material inside D
by simply using \shortstack{$\mathbf0$\\a1}
. There is no need to use TeX lower-level primitives for that.
Also the node character N
also takes a content if used with { }
and also options using [ ]
, i.e. N[<options>]{<content>}
, so you can place text into the timing diagram directly, without extracode
. By default nodes are set using the coordinate
shape, you need to use the rectangle
option to allow for a visible content.
I personally use dotted or dashed lines (something like ;[dashed] <chars>;
) to draw discontinuities.
BTW, allowing text content for other characters as well is on my long-term TODO list.
Here a way you can implement such a diagram using dotted lines and direct node content. I'm moving the node position manually to get the correct vertical position.
\documentclass[convert=png]{standalone}
\usepackage{tikz-timing}
\usetikztiminglibrary{nicetabs} % a bit strange with \Huge; use belowrulesep to adjust
\usepackage{amsmath}
\usepackage{type1cm} % to avoid "LaTeX Font Warning: Font shape `OML/cmm/m/it' in size <2> not available"; tlmgr install type1cm
\usepackage{helvet}
\begin{document}
\begin{tikztimingtable}[%
timing/dslope=0.1,
timing/name/.style={font=\sffamily\scriptsize},
timing/d/text/.style={font=\sffamily\tiny},
grayz/.style={timing/z/.append style={gray}},
timing/n/.style={rectangle},
timing/metachar={{K}[2]{#1l !{++(0,+.5\yunit)} N[rectangle,scale=.3]{\shortstack{$\mathbf 0$\\(#2)}} !{++(0,-.5\yunit)} #1l}},
timing/metachar={{J}[2]{#1h !{++(0,-.5\yunit)} N[rectangle,scale=.3]{\shortstack{$\mathbf 1$\\(#2)}} !{++(0,+.5\yunit)} #1h}},
]
Sig1 & Z H K{a1} K{2} J{3} ;[gray] D;[dotted,gray] D;[gray] D; J{$N_a$} Z \\
Sig2 & Z H J{1} J{1} K{3} ;[grayz] Z;[dotted,grayz] Z;[grayz] Z; K{$N_b$} Z \\
\extracode
% foreground:
\tablerules
\tablegrid[black!25]
\end{tikztimingtable}
\end{document}
Best Answer
There is no dedicated macro provided by
tikz-timing
, but it is possible to draw such a labeled axis using the size macros and nodes provided.The number of rows is given by
\nrows
and the widest row by\twidth
. The rows are also provided as nodes calledrow<number>
and the last row node is also namedlast row
. To draw extra material place the drawing code in anextracode
environment after the last row as shown in the example below. Please see the manual oftikz-timing
for more details.If you need this more often you could define an own macro: