Resumed

Quarto resume with a custom LaTeX template

latex
typography
Author

baptiste

Published

October 30, 2022

I’ve recently taken the opportunity to refresh my resume (or résumé, but I’m already french enough) and academic curriculum vitæ, and as usual this has involved as much work on the workflow as on the content itself.

Since every CV should be tailored to the opportunity, my goal is to have a plain-text source from which to copy-and-paste (or comment / uncomment) specific bits of information as needed.

My goal is to have a plain text input file with as little markup as possible, that I can reuse in a variety of circumstances (for example: a HTML version online). The process is similar, and simpler, than in the previous post for posters: a Quarto input file (left), is automatically rendered into the pdf output (right), with the command quarto render:

flowchart LR
  E[yaml] --> |quarto| I(pandoc AST)
  F[markdown] --> |quarto| I(pandoc AST)
  I --> |lua filters| J(pandoc AST)
  J --> |pandoc| K[tex file]
  M(_template.tex) --> |pandoc| I
  K  --> |xelatex| L(.pdf output)

Preview

The full end-result for Gandalf might look like this:

(If you’re wondering why Gandalf – for one thing it’s more entertaining than presenting my own data, but, also, I find that one catches interesting corner cases by trying the template on different cases)

the Quarto file

The fixed-structured information such as the contact details, is contained in YAML meta-data. The free sections, however, are formatted in markdown and will be injected in the document’s body. Here’s an excerpt of the input qmd document:

---
title: Wizard • pointy-hatted • pipe smoker
author: Gandalf the Grey
nationality: Maia, bearer of Narya
age: Born before Arda was created
address: Valinor, Arda
mobile: flying moths
email: mithrandir@istari.me
skype: gandalf
website: "[lotr.wikia.com/wiki/gandalf](lotr.wikia.com/wiki/gandalf)"
numpages: 2
colour: 606060
highlight: 8a1313
separator: staff.png
titlefont: Hobbiton Brushhand
mainfont: Minion 3
format: 
  pdf:
    template: _template_cv.tex
filters:
   - latex-environment
commands: [smallimg, highlight, institution, decoration]
environments: statement
---

::: statement
*Sent by the Valar to combat the threat of Sauron upon Middle-Earth. Out of activity since the Third Age. A true wizard when it comes to fireworks, dragons and Balrogs, I also enjoy a good smoke. When things get too hot even for me, I know to delegate.*
:::

## Work experience

Fourth Age 
  ~ [Retired wizard]{.highlight} [Manwë's team, Valinor]{.institution}
  ~ Smoking and reminiscing about the great battles of the past
  ~ Hanging out with Bilbo and Frodo, Lady Galadriel, Elrond, and many elves

Third Age 
  ~ [grey, then white wizard]{.highlight} [policy adviser & guide, middle earth]{.institution}
  ~ Sent by the Valar to help Men and Elves in the fight against Sauron
  ~ Advised the rulers of Middle-Earth, often against their bad judgment
[...]
---
title: Wizard • pointy-hatted • pipe smoker
author: Gandalf the Grey
alsoknown: Olórin, Gandalf
nationality: Maia, bearer of Narya
age: Born before Arda was created
currentdate: fourth age
address: Valinor, Arda
mobile: flying moths
email: mithrandir@istari.me
skype: gandalf
website: "[lotr.wikia.com/wiki/gandalf](lotr.wikia.com/wiki/gandalf)"
resume: "[lotr.wikia.com/wiki/gandalf](lotr.wikia.com/wiki/gandalf)"
numpages: 2
colour: 606060
highlight: 8a1313
separator: staff.png
titlefont: Hobbiton Brushhand
mainfont: Minion 3
sansfont: Gill Sans Nova
monofont: Iosevka SS09 Light
itemsep: 12pt
format: 
  pdf:
    keep-tex: true
    template: _template_cv.tex
    shift-heading-level-by: -1
editor: source
filters:
   - latex-environment
commands: [smallimg, highlight, institution, decoration]
environments: statement
---

::: statement
*Sent by the Valar to combat the threat of Sauron upon Middle-Earth. Out of activity since the Third Age. A true wizard when it comes to fireworks, dragons and Balrogs, I also enjoy a good smoke. When things get too hot even for me, I know to delegate.*
:::

## Work experience

Fourth Age 
  ~ [Retired wizard]{.highlight} [Manwë's team, Valinor]{.institution}
  ~ Smoking and reminiscing about the great battles of the past
  ~ Hanging out with Bilbo and Frodo, Lady Galadriel, Elrond, and many elves

Third Age 
  ~ [grey, then white wizard]{.highlight} [policy adviser & guide, middle earth]{.institution}
  ~ Sent by the Valar to help Men and Elves in the fight against Sauron
  ~ Advised the rulers of Middle-Earth, often against their bad judgment
  ~ Collaborated with Elrond, Lady Galadriel, and Aragorn
  ~ Argued with a Balrog that they *shall not pass*
  ~ Sent back with a white cape to finish the job
  ~ Sent a Hobbit to steal a stone from a dragon and stir up 5 armies
  ~ Sent a Hobbit to melt a ring in a volcano
  ~ Awarded the title of Fellows of the Ring to 9 elves, hobbits, men and dwarves
  ~ Flew at the back of eagles

1st & 2nd Age 
  ~ [maia, istari]{.highlight} [manwë's assistant, valinor]{.institution}
  ~ Participated in the shaping of Middle-Earth
  ~ Helped building lamps, growing trees, teaching elves
  ~ Fighter against Morgoth and a giant spider

Before Ëa 
  ~ [spiritual, music enthusiast]{.highlight} [ilúvatar & co., out of this world]{.institution}
  ~ Participated in the music that shaped the universe (Ainur orchestra • duration: aeons)
  ~ Co-created all the riches in the world
  ~ Countered dissonant views with more harmonious music
  ~ Admired what might come to be

## Core competencies

Magic 
  ~ [expert in spells, fire and staff handling]{.highlight}
  ~ Organised fireworks for Bilbo's anniversary in the Shire
  ~ Fought a Balrog in the Moria
  ~ Broke Saruman's staff from a distance
  ~ Saved the day riding a white horse downhill

Comm' 
  ~ [broad experience with all languages of middle-earth]{.highlight}
  ~ Wise advice to all rulers --- men and women, dwarves, elves, hobbits, bear
  ~ Liaised with the ents to defeat Saruman's evil plans
  ~ Deciphered a pass phrase to enter Moria (with help from Frodo)
  ~ Interpreted invisible writings on a ring
  
## Acquired skills

Fighting 
  ~ [champion of good vs evil]{.highlight}
  ~ Sword-fighting with Glamdring
  ~ Staff-wielding --- breaking stone bridges before my feet, deterring a rogue wizard, bringing light to dark places
  ~ Occasional stabbing of orcs and goblins, burning of werewolves

Rhetoric 
  ~ [powerful orator]{.highlight}
  ~ Grew taller, darker, scarier when talking down a Hobbit inside his hole
  ~ Sneaked a weapon in Théoden's reception room pass the guards
  ~ Convinced Théoden to wake up from his torpor
  ~ Shut up a magical ball of fire / giant burning eye talking to people from a distance inside a dark ball
  ~ Snapped boss from ivory tower
  ~ Conversed with moths to call for eagles
  ~ Convinced Beorn to bear the company of dwarves for one night

Leadership 
  ~ [trusted and wise team builder]{.highlight}
  ~ Talked everyone, including hobbits, into highly-dangerous adventures
  ~ Summoned dwarves, men, hobbits and elves to meetings
  ~ Led teams through forests, grasslands, avalanche-ridden mountain tops
  ~ Organised the replacement of a bitter steward by the rightful king
  ~ Sent a hobbit up a tower to lit a long-distance call for help
  ~ Had a "nose" to choose the right path through the tunnels of Moria
  ~ Advised Frodo not to judge Smeagol hastily, indirectly saving the world later on

## Conferences

3021 
  ~ With Elrond, Galadriel, Frodo and Bilbo • *Grey Havens* [parting thoughts ]{.institution}

3019 
  ~ With Aragorn & armies • *Black Gate* [teethy negotiation]{.institution}
  ~ Encounter with a balrog • *Moria* [deep argument]{.institution}
  ~ Assembly of a Fellowship (dwarves, elves, humans) • *Rivendell* [convenor]{.institution}
  ~ Venom-and-stick moves • *Rohan* [persuader]{.institution}

3017 
  ~ Counsel-seeking from Saruman • *Orthanc tower* [wizardry]{.institution}

2949 
  ~ Visit of Bilbo with Balin • *Shire* [talk & smoke]{.institution}

## Hobbies

[map]{.smallimg} 
  ~ I am passionately curious about the Middle-Earth cultures and life-forms, and keen to connect with all. I enjoy travelling, conversing in foreign languages, catching up with old friends unannounced, plotting surprise parties and adventures.

[smoking]{.smallimg} 
  ~ I am an avid pipe smoker, a hobby I took up years ago with my hobbit friends in the Shire. Thanks to my wizardry, I am able to shape the smoke into any form conceivable, sailing boats for example. My favourite leaf is the Southern Star, grown around Bree.

[]{.decoration}

LaTeX formatting

Dealing with the fixed structure information is relatively easy; I simply hard-code the metadata codes into the templates’s layout

\begin{tabular}{r !{\textcolor{bgcol}\vrule} l}
\sclgreen{location}& \texttt{$address$}   \\[4pt]
\sclgreen{mobile}  & \texttt{$mobile$ }   \\[4pt]
\sclgreen{email}   & \texttt{$email$  }   \\[4pt]
\sclgreen{skype}   & \texttt{$skype$  }   \\[4pt]
\sclgreen{website} & \texttt{$website$}
\end{tabular}

and Quarto + pandoc will pull the corresponding variables from the YAML header.

Similarly, the colour is defined in the metadata and passed to the template through Quarto and pandoc. For simplicity and clarity only two colours are specified (the highlight of Gandalf’s name and the dark grey of section titles); a lighter shade is automatically created by LaTeX,

\definecolor{fgcol}{HTML}{$colour$}
\definecolor{hicol}{HTML}{$highlight$}
\colorlet{bgcol}{fgcol!50}
\colorlet{shadowcol}{hicol!50}

Lua filter

I used the same Lua filter as for a previous project to automatically style the bullets • (with fgcolor).

function replace (elem)
   if elem.text == "•" then
     return pandoc.RawInline("latex","\\sep")
   else
     return elem
   end
end

return {{Str = replace}}

Sections and entries

The main body is trickier to style, as I want to keep the markup as light and inobtrusive as possible. Playing with a few different ideas, I’ve found that the pandoc syntax for definition lists matches pretty well what I need to specify for individual entries:

  • a title, which might be a date, or a skill, etc.; this should be in its own left column
  • on the same line, but at a fixed offset, a title or summary of the position
  • optional additional lines, which may need to be properly line-wrapped
  • entries should be separated by a small vertical gap, for clarity
  • the list might need to cross over to a different page

I previously hacked subsections for this purpose, or played with various tabular packages in LaTeX, but this is by far simpler and more robust.

Getting the correct alignment and line-wrap behaviour is a matter of finding the right options for the definition list

\usepackage{enumitem}
\setlist[description]{font=\small\color{hicol}, leftmargin=2cm, style=multiline,itemsep=12pt,parsep=2pt}

The section titles also required a little trickery: I wanted to include an image (Gandalf’s staff here), or by default a horizontal pattern drawn by tikz,


\usepackage{tikz}
\usetikzlibrary{patterns}
\newcommand*{\myseparator}{\raisebox{0.25ex}{\tikz \fill [pattern=north east lines, pattern color=hicol] (0,0) rectangle (2cm,1.5mm);}}

% overwrite if image given
$if(separator)$
\renewcommand*{\myseparator}{\includegraphics[width=2cm]{$separator$}}
$endif$
  
\usepackage{titlesec}
\titleformat{\section}
{\fontsize{12}{14}\scshape\bfseries\rmfamily\addfontfeature{Color=hicol}\selectfont}{\myseparator}{0.5em}{}

Custom environments

In a couple of places I needed to explicitly annotate the content to tell LaTeX to treat it in a special way. This takes the form of spans and divs in Quarto/pandoc syntax, and are resolved with the latex-environment filter.

[]{.decoration}

gets converted into

\decoration{△}

The corresponding macro needs to be defined in the LaTeX template,

\newcommand{\decoration}[1]{\vfil
\begin{center}%
\Huge\addfontfeature{Color=shadowcol} \selectfont #1
\end{center}%
}

End-result

Gandalf’s fictional resume, rendered automatically from a plain text file.

and mine, to show some variations in settings.

Let me know if you have a great job in mind! :)

Thanks

  • pandoc
  • lua
  • xelatex
  • quarto, Rmd, knitr
  • R and packages

Disclaimer

I spent a bit too much time on google to refresh my memory of Gandalf’s bio, but I’m sure it’s still full of blatant inaccuracies and omissions; my apologies to J.R.R. Tolkien.

Courtesy

I would really appreciate if no-one copied the design too closely, so that it stays a bit original.

Last Updated: 06 January 2023

Reuse