Sunday, 2 June 2013

Letter "p" ruining vertical alignment

Letter "p" ruining vertical alignment

I have a simple diagram I have created.
\begin{figure}[t]
  \begin{center}
    \setlength{\unitlength}{10pt}
    \begin{picture}(24,4)
      \setlength\fboxsep{0pt}
      \put(0,2){$\underbrace{\strut \fcolorbox{black}{teal0}{\framebox(6,2){Preamble}}\fcolorbox{black}{purp0}{\framebox(7,2){Start code}}}_\textrm{Stage 1: estimate M}$}
      \put(13,2){$\underbrace{\strut \fcolorbox{black}{lime0}{\framebox(5,2){Data}}\fcolorbox{black}{orange0}{\framebox(6,2){Stop code}}}_\textrm{Stage 2: sample and decode}$}
    \end{picture}
    \caption{Packet format.}
    \label{fig:packet}
  \end{center}
\end{figure}
and it creates the following:
However, if you look closely you will notice the text in the last box is out of alignment with the text in the other boxes because of the "p". I would like to put it in alignment. Solution should be as close to the original image as possible, and not require additional packages like TikZ.

No comments:

Post a Comment