3

When using tikz-timing, the symbol D draws the data signal. I have two questions:

First, I would like to draw something like:

___  _____________ _ _ _ _ _________  ____
   \/ some text left aligned        \/
___/\_____________ _ _ _ _ _________/\____

However, after using D{some text} I cannot avoid the transition before [dotted] D;

Second, how to draw something like below, where // indicate that the signal is continued:

___  _____________//_________  ____
   \/   some text centered   \/
___/\_____________//_________/\____

An example code for the first question is as follows:

% ----------------------------------------------------------------
% Article Class (This is a LaTeX2e document)  ********************
% ----------------------------------------------------------------
\documentclass[journal]{IEEEtran}

\usepackage{tikz}
\usepackage{tikz-timing}

% ----------------------------------------------------------------
\begin{document}
\def\htc{16}
\def\htcM{4}
\def\htcMI{1}
\def\tc{32}
\def\tcM{8}
\def\tcMT{16}
\def\tcMI{2}
\def\CNT{1.2}


\begin{figure}

\begin{tikztimingtable}[%
    timing/dslope=0.3,
    %timing/name/.style={text width=-2in},
     xscale=1.1,yscale=1.1,
     timing/rowdist=1.3,
     timing/coldist=0,
     line width=.5,
    ]
      & 0.5D{} \tcMT D{$x_j(n)$}  [dotted] \CNT D; \tcM D{}  0.7D{} \\ 
\end{tikztimingtable}

\end{figure}

\end{document}
ted
  • 3,377
M.Reza
  • 3,237

1 Answers1

1

I ran into the first issue, here is my partial solution:

Dont draw anything into the wave directly, rather place a custom node with the text, this avoids the spurious signal transition. For placing the node setting the shape to rectangle is key as otherwise it wont be visible. The node is placed as is described here. For the alignment you can play with the amount of signal bits D placed before and after the node. You could also use a different anchor positions, see the last example.

For the text formatting I use timing/D/text the letter in the middle has to be adjusted to the current symbol being used. My latex understianding is limited, but from glimpsing the package code, there might be cases where \tikztiming@textformat{<your text>} might have to be used, which would require wrapping your code in \makeatletter ... \makeatother. This would be necessary to use the text format key in the package.

Note: the code below can be simplified, simply loading \usepackage{tikz-timing-advnodes}, allows to eliminate the !{++(0,+/-.5\yunit)} shifts below.

\documentclass[journal]{IEEEtran}

\usepackage{tikz}
\usepackage{tikz-timing}

\begin{document}
\def\htc{16}
\def\htcM{4}
\def\htcMI{1}
\def\tc{32}
\def\tcM{8}
\def\tcMT{16}
\def\tcMI{2}
\def\CNT{1.2}


\begin{figure}

\begin{tikztimingtable}[%
    timing/dslope=0.3,
    %timing/name/.style={text width=-2in},
     xscale=1.1,yscale=1.1,
     timing/rowdist=1.3,
     timing/coldist=0,
     line width=.5
    ]
      & 0.5D{} \tcMT D!{++(0,+.5\yunit)}N[rectangle,timing/D/text]{$x_j(n)$}!{++(0,-.5\yunit)}  [dotted] \CNT D; \tcM D{}  0.7D{} \\
      & 0.5D{} $.5*\tcMT$ D!{++(0,+.5\yunit)}N[rectangle,timing/D/text]{$x_j(n)$}!{++(0,-.5\yunit)} $.5*\tcMT$ D [dotted] \CNT D; \tcM D{}  0.7D{} \\
      & 0.5D{} !{++(0,+.5\yunit)}N[rectangle,timing/D/text,anchor=west]{$x_j(n)$}!{++(0,-.5\yunit)} \tcMT D [dotted] \CNT D; \tcM D{}  0.7D{} \\
\end{tikztimingtable}

\end{figure}

\end{document}

(note the so api kept rejecting uploads so this is indirect)

ted
  • 3,377