[texhax] How to put space characters at the beginning of a line?

Pierre MacKay pierre.mackay at comcast.net
Tue Apr 27 14:58:50 CEST 2010

On 04/27/2010 05:05 AM, William Adams wrote:
> On Apr 27, 2010, at 7:07 AM, José Romildo Malaquias wrote:
>> Note that, when this document is compiled, the letter 'S' in the last
>> line aligns to the letter 'F' in the previous line. How can I get this
>> 'S' aligned to the 'r' front the previous line?
> Put something before the spaces which won't be discarded such as a strut:
>    \documentclass[a4paper]{article}
>    \begin{document}
>    \ttfamily\frenchspacing\noindent
>    First~line\newline
>    \strut~~Second~line
>    \end{document}
> William
The other possibility is \hphantom{Fi} which will preciselyly line up 
the leading side bearing of the S with the leading side bearing of the r.
I can't remember whether you need a \leavevmode here or not.  It usually 
does no harm.

Pierre MacKay

More information about the texhax mailing list