I have to draw some timing diagrams with annotations. The timing shall be annoated as shown in the example:
\documentclass{report}
%\documentclass{scrreport}
\usepackage{tikz}
\usepackage{tikz-timing}[2014/10/29]
\begin{document}
\begin{tikzpicture}
\timing at(1,3) {3H 20U 4H 13U 6H};
\timing at(1,2.5) {23D{2} 4X 19D{2} };
\draw (1.75,4) -- +(0,-.6);
\draw (6.58,4) -- +(0,-.6);
\draw (7.58,4) -- +(0,-.6);
\draw (10.68,4) -- +(0,-.6);
\draw[<->] (1.75,3.8) -- (6.58,3.8);
\draw[<->] (6.58,3.8) -- (7.58,3.8);
\draw[<->] (7.58,3.8) -- (10.68,3.8);
\node at (4.3,4) {Transmit};
\node at (7.05,4) {Idle};
\node at (9.0,4) {Receive};
\end{tikzpicture}
\end{document}
Edit: The \timing line shows the signal at a wire. The signal level is 'High' at the beginning. There are two burts of high/low level signals containing the information. The actual information is not important. That's why it's shown here as 'X' don't care, but not stable 'High'.
The picture shall describe the phases of these bursts. The details are in the text that comes with the diagram.
This works but is cumbersome and error prone. The X positions (1.75, 6.58, 7.58, 10.68) are only detected visually. And the values must be entered repeated. If you need to change the timing to \timing at(1,3) {3H 10U 4H 13U 6H};
nearly everything has to be changed.
Further the complete construct is affected, if you want to use the TikZ picture with KOMA script. This inhibits to place the tikz-timing code in a reusable TeX include file.
- How can the annotations be drawn more efficiently?
- How can the position of the annotations be calculated from the timing diagram positions?
- How can the TikZ drawing be made robust for use with or without KOMA script?