2

How can I arrange the text lines in the \hfill ? Is using a tabular environment the only way around this ?

\documentclass{letter} % Uses 10pt
\usepackage{marvosym} % add the symbols for email and phone contact data
\begin{document}

\begin{flushleft}
{\large\bf First Last}
\end{flushleft}
\medskip\hrule height 1pt
%%%%%%%%%%% how can I left align the different lines in this flushright ? %%%%%%%%%%%

\begin{flushright}
\hfill Address, Apt XXX\\
\hfill City, ST ZIP-XXXX\\
\hfill {\Large\Telefon} (XXX)-XXX-XXXX
\end{flushright} 

%%%%%%%%%%% how can I left align the different lines in this flushright ? %%%%%%%%%%%

\vfill % forces letterhead to top of page
\end{document}
  • What's wrong with using a tabular environment? – Werner Jan 17 '14 at 18:54
  • don't use {} in {\large\bf First Last} the flushleft already scopes the size change, and the {} just makes the text use the wrong baseline if it wraps to a new line, and \bfseries is preferable to \bf which is just for compatibility with LaTeX 2.09. The hfill in the flushright aren ot doing anything as the text is already flush right? – David Carlisle Jan 18 '14 at 13:53
3

Use a tabular with l@{} (fully left) alignment, for example.

\documentclass{letter} % Uses 10pt
\usepackage{marvosym} % add the symbols for email and phone contact data
\begin{document}

\begin{flushleft}
{\large\bf First Last}
\end{flushleft}
\medskip\hrule height 1pt
%%%%%%%%%%% how can I left align the different lines in this flushright ? %%%%%%%%%%%

\begin{flushright}
\begin{tabular}{l@{}}  %% as observed by Werner, use l@{} instead of l
 Address, Apt XXX\\
 City, ST ZIP-XXXX\\
 {\Large\Telefon} (XXX)-XXX-XXXX
\end{tabular}\end{flushright} 

%%%%%%%%%%% how can I left align the different lines in this flushright ? %%%%%%%%%%%

\vfill % forces letterhead to top of page
\end{document}

enter image description here

But if you want to push them to the right just use flushright

\begin{flushright}
 Address, Apt XXX\\
 City, ST ZIP-XXXX\\
 {\Large\Telefon} (XXX)-XXX-XXXX
\end{flushright} 

enter image description here

0

You can just put the contents in a left-aligned \Longstack.

\documentclass{letter} % Uses 10pt
\usepackage{marvosym} % add the symbols for email and phone contact data
\usepackage[usestackEOL]{stackengine}
\begin{document}

\begin{flushleft}
{\large\bf First Last}
\end{flushleft}
\medskip\hrule height 1pt
%%%%%%%%%%% how can I left align the different lines in this flushright ? %%%%%%%%%%%

\begin{flushright}
\hfill 
\Longstack[l]{Address, Apt XXX\\
City, ST ZIP-XXXX\\
{\Large\Telefon} (XXX)-XXX-XXXX}
\end{flushright} 

%%%%%%%%%%% how can I left align the different lines in this flushright ? %%%%%%%%%%%

\vfill % forces letterhead to top of page
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.