mathr / blog / #

Writing a CV with LaTeX

I needed to write a CV recently. It took me about two hours to come up with something coherent, in plain text. Then I needed to format it into a PDF document, which took another two hours, with lots of internet searches for specific layout tweaks. Here's what I came up with.

Using the standard LaTeX article class seemed simplest, as my CV isn't a traditional academic or corporate one.

\documentclass{article}

I have a couple of non-ASCII accented characters in the text, so I enabled UTF-8 support.

\usepackage[utf8]{inputenc}

I wanted A4 paper size, with 3cm margins, but also space in the right-hand margin to show the URLs for hyperlinks in the main text (in case someone prints the document and wants to find the referenced content). So the outer margin becomes 8cm, with 5cm for marginal notes, separated from the text by 1cm. See this diagram for more information.

\usepackage[paperwidth=210mm,paperheight=297mm,inner=30mm,outer=80mm,
  marginparwidth=50mm,marginparsep=10mm,top=30mm,bottom=30mm]{geometry}

I wanted links to be coloured matching the brown on my website, instead of the default ugly surrounding boxes that the hyperref package uses by default. I disable internal links to footnotes, because they will be in the margin right next to the relevant text. I also disable showing the bookmarks pane in PDF viewers by default, as the document isn't long enough to merit it.

\usepackage{color}
\definecolor{mathr}{rgb}{0.4,0.2,0.2}
\usepackage[bookmarks=false,colorlinks=true,urlcolor=mathr,
  hyperfootnotes=false]{hyperref}

I wanted the fonts to match my website too, using LM Sans. The default in LaTeX is serif, but it's a one-line addition to use sans-serif.

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\renewcommand{\familydefault}{\sfdefault}

I wanted a wider line spacing, with no paragraph indent - instead adding some vertical space between paragraphs.

\linespread{1.3}
\setlength{\parindent}{0mm}
\setlength{\parskip}{5mm}

As mentioned earlier, I wanted URLs to be visible in the margin, and using footnotes seemed easiest. The footmisc package allows footnotes to be placed in the margin. I ended up with 10 footnotes, but I wanted to start their numbering at 0 instead of 1 - I found the perpage package had an option for initial numbering but there may be a better way.

\usepackage[hang,flushmargin,side]{footmisc}
\usepackage{perpage}
\MakePerPage[0]{footnote}

Now I can define a macro to expand \link{title}{url} into an inline link with a title, coupled with a footnote link with the URL visible:

\newcommand{\link}[2]{\href{http://#2}{#1}\footnote{\href{http://#2}{#2}}}

The document title is my name in bold, with my email address underneath (as a hyperlink too).

\title{\bfseries Claude Heiland-Allen}
\author{\href{mailto:claude@mathr.co.uk}{claude@mathr.co.uk}}
\date{}

Preamble complete, here comes the document. I remove page numbering because there is only one page. Document text omitted for brevity.

\begin{document}
\maketitle
\thispagestyle{empty}

...

\end{document}

Here's the final output PDF.