[texhax] \rlap at the beginning of a \parbox

Michael Rutter mjr19 at cam.ac.uk
Wed Feb 26 11:59:17 CET 2014


I am confused as to the behaviour of \rlap (or a \makebox of zero width} 
at the beginning of a parbox. It seems to force a new line, whereas it 
behaves differently if preceded by an \hspace*{0pt}. Could someone explain 
to me the output of the following LaTeX which illustrates this issue? (It 
was an attempt to produce a dollar sign with the same width as a pounds 
sign, for neater tables of mixed currencies.)

\documentclass{article}

\newcommand{\dollars}{\rlap{\$}\hphantom{\pounds}}
\parindent 0pt
\begin{document}

\parbox{3in}{\pounds{}6}

\parbox{3in}{\hspace*{0pt}\dollars{}6}

\parbox{3in}{\dollars{}6}

\end{document}

Regards,

Michael Rutter



More information about the texhax mailing list