Writing Simple. Beautiful Letters with LaTeX

Copyright: The Guardian

LaTeX users understand that beautiful words require beautiful code. There are also a myriad of good templates available to write articles, publications, books, and your CV with. It is however not very clear how to make a good standard letter with LaTeX. On one side there’s the letter document class that is too minimalistic to be usable, and on the other there’s the scrlttr2 KOMAscript class, which has so many variables that it requires careful study of the KOMAscript manual. Letters are often written as a quick response to a job vacancy, a call for proposals, or any other kind of invitation. They therefore require full attendance to its contents.

I have pieced together my own template as an answer to this problem. It adds the following features to the letter document class:

  • a subject line
  • modifiable line spacing
  • the option to add a bibliography
  • the standard serif font has been replaced with the Palatino font


These additions should serve the basic needs for writing (academic) letters. You can copy the code block below to an empty tex document. It should easily compile into a DVI or PDF document with a fresh full TeXLive install. The paragraph below the code block explains how to change the settings.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
\documentclass[12pt]{letter}
 
\usepackage[a4paper]{geometry}
\usepackage{hyperref}
 
% Subject function
\usepackage{etoolbox}
\makeatletter
\newcommand{\subject}[1]{\def\@subject{#1}}
\patchcmd{\opening}{#1\par\nobreak}{\ifundef{\@subject}{}{\@subject\par\vspace{2\parskip}}#1\par\nobreak}{}{}
\makeatother
% End of Subject Function
 
% Bibliography function
\makeatletter
\newenvironment{thebibliography}[1]
     {\list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\makeatother
\usepackage[round]{natbib}
\let\bibsection\relax
% End of Bibliography function
 
% Line Spacing package
\usepackage{setspace}
% \onehalfspacing % set whole document to 1.5 space
 
% Set Palatino font
\usepackage[sc]{mathpazo} % Palatino font
\usepackage[T1]{fontenc}
\usepackage{microtype}
 
% Document Settings
\signature{Your Name}
\address{Your Name\\ Your Street \\ City \\ Country}
\date{}
\subject{Your Subject}
 
% Begin of Document Body
\begin{document}
\begin{letter}{The Quick Brown Fox, Inc. \\ Lazy Dog Street \\ Jumpville, USA}
 
\opening{Dear Sir or Madam,}
- Add your text here -
 
Thank you for your time and consideration.
 
I look forward to your reply.
 
\closing{Yours Faithfully,}
 
%\vspace{30 mm}
%\textit{REFERENCES}
%\bibliographystyle{apalike}
%\bibliography{} % Place the name of your BibTeX file in the brackets 
 
\end{letter}
\end{document}

Font Size – You can change the font size by changing the first argument, [12pt], of the \documentclass command in line 1 to any font size between 10 and 12 pt.

Line Spacing – The line spacing of the whole document can be set to 1.5 by removing the % sign in front the \onehalfspacing command at line 40. Alternatively, you can set the whole document to double spacing by replacing the command with \doublespacing. You can also choose to change the line spacing for individual paragraphs by writing your text in the document body (from line 58 on) between \begin{onehalfspace} and \end{onehalfspace} commands:

\begin{onehalfspace}
- Your Text Here -
\end{onehalfspace}

Sender and Recipient address, Subject and Signature, Date – Except for the recipient address, these settings can be changed by editing the text within the curly brackets of the commands that can be found from line 47 on. The recipient address can be changed by editing the text at line 55.

Bibliography – You can add a bibliography by removing the % sign in front the commands at line 66 to 69, and place the filename of your BibTeX file within the curly brackets of the \bibliography command. I added some vertical spacing to separate the bibliography from the body text using the \vspace command at line 66. You can choose to increase or decrease the vertical spacing, or remove the command altogether. You can also choose to edit or remove the “References” title at line 67.

April 17, 2014

One response to Writing Simple. Beautiful Letters with LaTeX

  1. Kizzy Brackeen said:

    Hi, i must tell you that it’s hard to find your posts in google, i found this one on 22 spot, you should build some quality backlinks to increase your website ranking in google and drive a lot more visitors to your posts, it means more audience and more sales for you. For more details search in google for – Raitt SEO advices