How to move text labels vertically in tikztiming
Here, I place the text in equal sized \makebox
es. The \small
can be inside or outside of the \makebox
, though a slightly different gap will result after the text, depending...
Why the original version of the OP behaves thus, it might be a case of right-aligned labels.
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-timing}
\begin{document}
\begin{tikztimingtable}[%
timing/dslope=0.1,
timing/.style={x=5ex,y=2.2ex},
x=1ex,
timing/rowdist=3ex,
timing/name/.style={font=\rmfamily}]
\makebox[5ex]{\small Data} & {[semitransparent]3u} 2D{0} 2D{1} 2D{1} 2D{0} {[semitransparent]2u}\\
\makebox[5ex]{\small Clock} & {[semitransparent]3u} LHLHLHLH {[semitransparent]2u}\\ \\
\end{tikztimingtable}
\end{document}
The above MWE fixes the horizontal centering of the two words. To also fix the vertical alignment, per follow-up comments, one can combine this result with a \raisebox
:
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-timing}
\begin{document}
\begin{tikztimingtable}[%
timing/dslope=0.1,
timing/.style={x=5ex,y=2.2ex},
x=1ex,
timing/rowdist=3ex,
timing/name/.style={font=\rmfamily}]
\raisebox{1.5pt}{\makebox[5ex]{\small Data}} & {[semitransparent]3u} 2D{0} 2D{1} 2D{1} 2D{0} {[semitransparent]2u}\\
\raisebox{1.5pt}{\makebox[5ex]{\small Clock}} & {[semitransparent]3u} LHLHLHLH {[semitransparent]2u}\\ \\
\end{tikztimingtable}
\end{document}
A little yshift
added to the timing/name
style. Also, I'd move the \small
there as well.
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-timing}
\begin{document}
\begin{tikztimingtable}[%
timing/dslope=0.1,
timing/.style={x=5ex,y=2.2ex},
x=1ex,
timing/rowdist=3ex,
timing/name/.style={font=\rmfamily\small,yshift=2pt}]
Data & {[semitransparent]3u} 2D{0} 2D{1} 2D{1} 2D{0} {[semitransparent]2u}\\
Clock & {[semitransparent]3u} LHLHLHLH {[semitransparent]2u}\\ \\
\end{tikztimingtable}
\end{document}