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.

In this letter from Wikibooks,

\documentclass{letter}
\usepackage{hyperref}
\signature{Joe Bloggs}
\address{21 Bridge Street \\ Smallville \\ Dunwich DU3 4WE}
\begin{document}

\begin{letter}{Director \\ Doe \& Co \\ 35 Anthony Road
\\ Newport \\ Ipswich IP3 5RT}
\opening{Dear Sir or Madam:}

I am writing to you on behalf of the Wikipedia project (http://www.wikipedia.org/),
an endeavour to build a fully-fledged multilingual encyclopaedia in an entirely
open manner, to ask for permission to use your copyrighted material.

% The \ldots command produces dots in a way that will not upset
% the typesetting of the document.
\ldots 

That said, allow me to reiterate that your material will be used to the noble end of
providing a free collection of knowledge for everyone; naturally enough, only if you
agree. If that is the case, could you kindly fill in the attached form and post it
back to me? We shall greatly appreciate it.

Thank you for your time and consideration.

I look forward to your reply.

\closing{Yours Faithfully,}

\ps{P.S. You can find the full text of GFDL license at
\url{http://www.gnu.org/copyleft/fdl.html}.}
\encl{Copyright permission form}

\end{letter}

\end{document}`

I would like to make the following changes but I don't know how,

  1. The address and date I would like to be right-aligned , I tried \begin{flushright} \end{flushright} but it didn't work. Similarly for left-aligned for the signature and the \closing{Yours Faithfully,}.

  2. Change the margin distances.

  3. Add "University of Smallville" at the top centre (at the beginning) of the document.

Thanks

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

One possibility, using the geometry package to change the page layout (the margins in this case), and the xpatch package to patch the \opening command; setting \longindentation to 0pt you can get the closing part to be left aligned:

\documentclass{letter}
\usepackage{xpatch}
\usepackage[lmargin=3cm,rmargin=3.5cm,tmargin=4.5cm,bmargin=4cm]{geometry}
\usepackage{hyperref}

\newcommand\Heading{University of Smallville}

\setlength\longindentation{0pt}

\xpatchcmd{\opening}{l@}{r@}{}{}
\xpatchcmd{\opening}{\thispagestyle{empty}}{\thispagestyle{empty}{\centering\Heading\par\bigskip}}{}{}

\signature{Joe Bloggs}
\address{21 Bridge Street \\ Smallville \\ Dunwich DU3 4WE}

\begin{document}

\begin{letter}{Director \\ Doe \& Co \\ 35 Anthony Road
\\ Newport \\ Ipswich IP3 5RT}
\opening{Dear Sir or Madam:}

I am writing to you on behalf of the Wikipedia project (http://www.wikipedia.org/),
an endeavour to build a fully-fledged multilingual encyclopaedia in an entirely
open manner, to ask for permission to use your copyrighted material.

% The \ldots command produces dots in a way that will not upset
% the typesetting of the document.
\ldots 

That said, allow me to reiterate that your material will be used to the noble end of
providing a free collection of knowledge for everyone; naturally enough, only if you
agree. If that is the case, could you kindly fill in the attached form and post it
back to me? We shall greatly appreciate it.

Thank you for your time and consideration.

I look forward to your reply.

\closing{Yours Faithfully,}

\ps{P.S. You can find the full text of GFDL license at
\url{http://www.gnu.org/copyleft/fdl.html}.}
\encl{Copyright permission form}

\end{letter}

\end{document}

A fragment of the resulting opening part:

enter image description here

And a fragment of the closing part:

enter image description here

share|improve this answer
    
How can I enlarge the size of the heading "University of Smallville" thanks –  inquisitor Oct 30 '12 at 9:45
1  
@inquisitor change \newcommand\Heading{University of Smallville} to \newcommand\Heading{{\LARGE University of Smallville}} or any other font modification (the extra pair of braces is important here). –  Gonzalo Medina Oct 30 '12 at 12:48
add comment

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.