February 20, 2016

Creating a resume using Pandoc

Tags: linux, software

One of the tasks that Pandoc can take over from word processors is the creation of printable resumes in PDF format. Because Pandoc uses LaTex to create PDFs, the markup in the source document can contain LaTex commands to tweak the appearance.

In the sample below, most of the content appears in description lists: items that consist of a label, followed by an indented description that can contain multiple paragraphs or other lists. In LaTex, the appearance of description lists can look pretty bad when compared with similar lists generated by the old Borland Sprint formatter. In particular, long labels can push the item content to the right so that it no longer aligns with the text for that item that may appear on subsequent lines.

To fix this problem, insert a preamble in the source Markdown document that looks like this:

geometry: margin=.75in
    - \usepackage{enumitem}
    - \setlist[description]{leftmargin=!,labelwidth=1.5in}

The geometry line reduces the margins so that more content can appear on the output pages. The setlist line fixes the alignment problem in description lists: it sets the width of a description item’s label to a fixed 1.5 inches, and forces all content in the item’s text to be aligned vertically. This improves the output appearance greatly.

The subsequent lines in the sample resume look like this:



:   123 Main Street, Podunk, ND 34567.  800-555-1212. ``


:   Thirty years experience playing video games in my mom's basement\:

    * Stood in line for four hours to buy the first Nintendo 64.

    * Still have a working Atari Pong console.

    * Exercise my wrists on a daily basis using a WII.

    * Played Adventure nearly every day in 1979 on an ASR-33 teletype.


The full source document can be found here, and the generated PDF can be found here.

Here we can see two description list items: one for CONTACT and one for SUMMARY. The labels for each item are bold-faced by surrounding them with two asterisks. The item description for CONTACT is a single line, but the description for SUMMARY is a bulleted lists. The indendation is very important here; it tells Pandoc how to nest these lists.