Handling fonts in a LaTeX document like what ends up being the pdf version of
your CV can be complicated. Hopefully, you will just set the name of your font
in the right place in metadata/pdf-options.yml, and everything will work
correctly. However, it may be the case that XeLaTeX (what’s actually making
the pdf) cannot find your font. In that case, you have a few options:
- In your shell, use the command
fc-list : familyto get a list of fonts that LaTeX seems to know about. This list is not authoritative, but it’s a good start. For example, if you don’t know what your specific version of Garamond is called, you can runfc-list : family | grep -i "Garamond", which will print every font that matches “Garamond.” Note that if a font is listed twice on the same line, separated by a comma, the part before the comma is what you want. - Download or copy the font you want to use into this repository. For
example:
- Go to dafont and download the font Lemon Tuesday, which is 100% free.
- Unzip the downloaded file and move the file
Lemon Tuesday.otfinto the same directory as this file. - Edit line 10 of
metadata/pdf-options.ymlto read:regular-font: Lemon Tuesday.otf. - Execute the shell script with
sh process.sh - The new pdf of the CV should be nearly unreadable, but it proves that changing the font worked.
For the purposes of a CV, I recommend using Georg Duffner’s free EB
Garamond. If you
download and install EB Garamond, you can set line 10 of
metadata/pdf-options.yml to read: regular-font: EB Garamond.
If you need help installing fonts, Fontspring has a tutorial for installing fonts on Windows or Mac.
Once EB Garamond is installed, you can make use its advanced OpenType
features like
swash features for italic
shapes or various ligature settings, like “historic” and “rare.” To learn more
about these various features and how to enable them in templates/tex.tex,
please see section IV of the Fontspec
documentation.
Here, for example, is the appropriate section of my own
cv’s template:
\setmainfont{$regular-font$}[%
$if(pdf-bold-as-smallcaps)$
BoldFont = $regular-font$ ,
BoldFeatures = {Letters=SmallCaps} ,
$endif$
Ligatures=Historic ,
Ligatures=Rare ,
ItalicFeatures={Style=Swash} ,
Mapping=tex-text
]Finally, the fonts may not work entirely as advertised in terms of producing smallcaps or replacing bold with smallcaps. Again, adjusting the options sent to Fontspec should help get precisely the look you want.