I have a chunk of code in an alltt environment and I want to highlight elements that are auto-generated (two colours for different methods):
\newcommand{\gen}[1]{\colorbox{DGray}{#1}}
\newcommand{\tpl}[1]{\colorbox{Gray}{#1}}
\begin{alltt}
\gen{class }\tpl{Something}...
\end{alltt}
My problem is that the frame around 'Something' is taller than the one around 'class ' and reaches lower due to the letter 'g', so the two frames aren't aligned. Is there a way to make a shading frame with a fixed height and position? Basically, I want shading the OpenOffice/MS Office way.