Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am writing a letter with the wikibooks template. The letter is going to be printed on a official paper which contains the address already. So I thought I can omit the \address command. For some strange reason the signature will not indent as shown on the webpage. I tried the \longindentation=20pt command, no matter what numbers I change, the closing and the signature are all aligned to the left margin of the body and will not indent. I was able to get it work by the command \address{\phantom{a}}, but that should not be how it is supposed to work (yes, I did try \address{}, but that doesn't work). Any better solutions?

What is wrong with omitting the \address command anyway?

Edit: Here is the what I am doing.

----------------------------------------------------------------------------------
\documentclass[11pt]{letter}

\signature{James Bond}
%\address{\phantom{i}}
%\longindentation=0pt
\begin{document}
\begin{letter}{}

\opening{To whom it may concern:}

The body of the letter goes on here. 

\closing{Yours sincerely,}

\end{letter}

\end{document}
------------------------------------------------------------------------------

As it stands now, without the address command, the closing and signature will not indent. However, if we uncomment the \address command, then they indents as shown in the Wikibook LaTeX example.

share|improve this question
    
Teh UK TUG FAQ correctly states that the letter class is widely disliked. It suggests akletter, brief, dinbrief, newlfm, and scrlttr2 as alternatives. –  Marc van Dongen Mar 2 '12 at 6:19

2 Answers 2

up vote 4 down vote accepted

The reason for the apparent "conditional indentation" stems from the source code for \closing:

\newcommand{\closing}[1]{\par\nobreak\vspace{\parskip}%
  \stopbreaks
  \noindent
  \ifx\@empty\fromaddress\else
  \hspace*{\longindentation}\fi
  \parbox{\indentedwidth}{\raggedright
       \ignorespaces #1\\[6\medskipamount]%
       \ifx\@empty\fromsig
           \fromname
       \else \fromsig \fi\strut}%
   \par}

The indent of \longindentation is only executed if \fromaddress is non-empty. And, \fromaddress is defined when using \address:

\newcommand*{\address}[1]{\def\fromaddress{#1}}

So, in order for the indentation to work properly (for whatever reason), you need something in \fromaddress. Using \def\fromaddress{\null} works just as well.

share|improve this answer

You can patch it as follows:

\documentclass[11pt]{letter}
%\address{\phantom{i}}
\signature{James Bond}
\makeatletter
\renewcommand{\closing}[1]{\par\nobreak\vspace{\parskip}%
 \stopbreaks
 \noindent
% \ifx\@empty\fromaddress\else
 \hspace*{\longindentation}
 \parbox{\indentedwidth}{\raggedright
 \ignorespaces #1\\[6\medskipamount]%
 \ifx\@empty\fromsig
 \fromname
 \else \fromsig \fi\strut}%
\par}

\begin{document}
\begin{letter}{}

\opening{To whom it may concern:}

The body of the letter goes on here. 

\closing{Yours sincerely,}

\end{letter}

\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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