Latex Letter: From Left Address Aligned

This is my first time using latex to write a letter. I use a class of letters. When i use:

\address{100 From Address \\ City, State \\ Pin} 

From the address is aligned to the right. Is there any way to do this to the left. The format of the letter I'm looking for is: from an address aligned left, followed by date aligned, followed by left justification, then opening and body, and finally left justifying.

I managed to get the signature aligned on the left using: \longindentation=0pt , the rest of the elements are correctly aligned - this is only from the address that is right justified.

+4
source share
3 answers
 \makeatletter \def\opening#1{\ifx\@empty\fromaddress \thispagestyle{firstpage}% {\raggedleft\@date\par}% \else % home address \thispagestyle{empty}% {\noindent\let\\\cr\halign{##\hfil\cr\ignorespaces \fromaddress \cr\noalign{\kern 2\parskip}% \@date\cr}\par}% \fi \vspace{2\parskip}% {\raggedright \toname \\ \toaddress \par}% \vspace{2\parskip}% #1\par\nobreak} \makeatother 
+5
source

The answer is to use the style of full block writing - all aligned to the left. On LaTeX, this is block.sty, which you may have to install. You can find it here http://www.ctan.org/tex-archive/macros/latex/contrib/block . Usage is quite simple:

\ usepackage {block}

+7
source

I assume that "left alignment" means that you want the address block to be on the left margin of the page, because the individual lines of the block are left aligned, but the block is on the right edge.

The best way to find the LaTeX style is to find the source style in the LaTeX source, copy it to the style file and violin. In this case, the source source is the letter.cls file, and I tracked the address formatting, looking for the \ address macro, which led to the \ fromaddress macro, and then to the macro \ opening. In the original, this is:

 \newcommand*{\opening}[1]{\ifx\@empty\fromaddress \thispagestyle{firstpage}% {\raggedleft\@date\par}% \else % home address \thispagestyle{empty}% {\raggedleft\begin{tabular}{ l@ {}}\ignorespaces \fromaddress \\*[2\parskip]% \@date \end{tabular}\par}% \fi \vspace{2\parskip}% {\raggedright \toname \\ \toaddress \par}% \vspace{2\parskip}% #1\par\nobreak} 

Removing the macro \ raggedleft moves the address block to the right, but leaves extra space, so I also deleted the table environment.

 \renewcommand*{\opening}[1]{\ifx\@empty\fromaddress \thispagestyle{firstpage}% {\@date\par}% \else % home address \thispagestyle{empty}% \ignorespaces% \fromaddress \\*[2\parskip]% \@date \par% \fi \vspace{2\parskip}% {\raggedright \toname \\ \toaddress \par}% \vspace{2\parskip}% #1\par\nobreak} 

This call \ renewcommand must be placed in the .sty style file, since it uses macros containing the @ character. (I just saw Alexey Malistov, another alternative is the \ makeatletter and \ makeatother macros.) Use

 \usepackage{myletter} 

to introduce a new style.

+3
source

All Articles