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

Lars Madsen daleif at imf.au.dk
Wed Feb 26 15:33:00 CET 2014


presumably because it is still in vmode at the start of the par box. Try adding \leavevmode to the start of \dollar

/Lars Madsen
Institut for Matematik / Department of Mathematics
Aarhus Universitet / Aarhus University
Mere info: http://au.dk/daleif@imf / More information: http://au.dk/en/daleif@imf


________________________________________
From: texhax [texhax-bounces at tug.org] on behalf of Michael Rutter [mjr19 at cam.ac.uk]
Sent: 26 February 2014 11:59
To: texhax at tug.org
Subject: [texhax] \rlap at the beginning of a \parbox

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

_______________________________________________
TeX FAQ: http://www.tex.ac.uk/faq
Mailing list archives: http://tug.org/pipermail/texhax/
More links: http://tug.org/begin.html

Automated subscription management: http://tug.org/mailman/listinfo/texhax
Human mailing list managers: postmaster at tug.org




More information about the texhax mailing list