A boilerplate to quickly and painlessly generate high-quality letters through LaTeX.
Why settle for MS Word when you can get the job done using your text editor?
- LaTeX with the following extra packages:
fontspec
geometry
ragged2e
enumitem
xunicode
xltxtra
hyperref
polyglossia
- Pandoc
To install LaTeX on Mac OS X, I recommend getting the smaller version BasicTeX from here and installing the additional packages with tlmgr
afterwards. Same goes for Linux: install texlive-base
with your package manager and add the needed additional packages later.
To install pandoc on Mac OS X, run brew install pandoc
. To install it on Linux, refer to the official docs.
-
Run this in your terminal to clone the repo, move into the right directory and delete all the git stuff:
git clone git@github.com:mrzool/letter-boilerplate.git && cd letter-boilerplate && rm -rf .git
-
Edit
details.yml
with your details, your recipient's details, and the desired settings. -
Open
letter.md
and write your letter in markdown. -
Run
make
to compile the PDF.
The template automatically includes signature.pdf
after the letter's body as a final touch. Follow this method to import your own signature.
Note: this template needs to be compiled with XeTeX.
subject
: The letter's subject (optional)mainfont
: Hoefler Text is the default, but every font installed on your system should work out of the box (thanks, XeTeX!)altfont
: Used to render the recipient address so that it stands out from the rest of the letter.fontsize
: Possible values here are 10pt, 11pt and 12pt.lang
: Sets the main language through thepolyglossia
package. This is important for proper hyphenation and date format.geometry
: A string that sets the margins throughgeometry
. Read this to learn how this package works.letterhead
: include custom letterhead in the PDF (see below).
If you have already designed your own letterhead and want to use it with this template, including it should be easy enough. Set the letterhead
option to true
to activate the wallpaper
package in the template. wallpaper
will look for a file named letterhead.pdf
in the project root folder and print it on the PDF before compiling the document. Change the fonts to match the ones in your letterhead, adjust the margins with geometry
and you should be all set.
- The Beauty of LaTeX by Dario Taraborelli
- Letterhead advices from Butterick's Practical Typography
- Why Microsoft Word must Die by Charlie Stross
- Sustainable Authorship in Plain Text using Pandoc and Markdown by Dennis Tenen and Grant Wythoff
- Refer to pandoc's documentation to learn more about how templates work.
- If you're not familiar with the YAML syntax, here's a good overview.
- If you want to edit the template but LaTeX scares you, this docs put together by ShareLaTeX cover most of the basics and are surprisingly kind to the beginner.
- Odds are your question already has an answer on TeX Stack Exchange. Also, pretty friendly crowd in there.
- Need to fax that letter? Check out Phaxio and learn how to send your faxes from the command line with a simple API call.
- invoice-boilerplate — Simple automated LaTeX invoicing system
- cv-boilerplate — Easing the process of building and maintaining a CV using LaTeX