views:

299

answers:

2

Anyone here a guru in Tikz-timing?

I am/was looking for a way to label a timing diagram with annotations, but the vertical scale is too compressed. I couldn't find a comprehensive list of options for the \timing command (or if I did, it was a meagre list).

My initial guesses at what they might be failed (e.g. height=), but eventually I stumbled onto an example from the document that confirmed that yscale= should work, and so it does.

Here's a code snippet to get you started:

\begin{tikzpicture}
    \timing [yscale=2.0] at (0,0)  {3H N (d7) 3L 3H N (d6) 3L 3H N (d5) 3L 3H N (d4) 3L 3H N (d3)3 L 3H N (d2) 3L 3H N (d1) 3L 3H N (d0) 3L 3H N (ack) 3L};
    \path (d7) node [below left] {D7};
    \path (d6) node [below left] {D6};
    \path (d5) node [below left] {D5};
    \path (d4) node [below left] {D4};
    \path (d3) node [below left]{D3};
    \path (d2) node [below left]{D2};
    \path (d1) node [below left]{D1};
    \path (d0) node [below left]{D0};
    \path (ack) node [below left] {ACK};

\end{tikzpicture}

+1  A: 
Martin Scharrer
Hi.. thanks for getting involved!I'll post a more detailed response below as a separate answer so that I can include some code snippets.
SmileAndNod
A: 

Here's the solution I came up with as a complete newbie:

\begin{tikzpicture}
    \path (0,0) node (sda) {SDA};
    \path (0,-1) node (scl) {SCL};
    \timing [yscale =2.0] at (sda.south east)  {2H 4D{D7} 4D{D6} 4D{D5} 4D{D4} 4D{D3} 4D{D2} 4D{D1} 4D{D0} 3.0D{ACK?} N(stop) 4U };
    \timing [yscale =2.0] at (scl.south east)  {1.5H 2L 2H N (c1) {Where?} 2L 2H N (c2) 2L 2H N (c3) 2L 2H N (c4) 2L 2H N (c5) 2L 2H N (c6)  2L 2H N (c7) 2L 2H N (c8) 2L 2H N (c9) 2L 2H};
    \path (c9) node [below left] {9};
    \path (c8) node [below left] {8};
    \path (c7) node [below left] {7};
    \path (c6) node [below left] {6};
    \path (c5) node [below left] {5}; 
    \path (c4) node [below left] {4};
    \path (c3) node [below left] {3};
    \path (c2) node [below left] {2};
    \path (c1) node [below left] {1};
    \path (stop)+(0,0.25) node[right] {\tiny$STOP? \hdots$};\end{tikzpicture}

When I add the keys timing/inline node/.style={rectangle,below left,font=\sffamily}, the "Where?" next to node c1 appears.. good to see ya!

It looks like section 3 of the manual contains the tikz-timing specific keys; it would be helpful to know what the defaults are if the key is not specified.

Just before I close, my favorite CTAN manual is for the UML-style package. In that manual, as each command is introduced, the options that can be used are listed in the left margin.

SmileAndNod
Since writing this article, I've decided to make use of margin comments in my own documents. I've found the following to be a helpful macro for getting the margin comments to line up with the paragraphs where they are introduced. (it requires the setspace package)\let\oldmarginpar\marginpar\renewcommand\marginpar[1]{\-\oldmarginpar{ \raggedright\begin{spacing}{0.5}\begin{tiny}#1\end{tiny}\end{spacing}}}
SmileAndNod