Skip to content

kristoferfannar/cv

Repository files navigation

CV

Welcome to my CV repo!

My current CV can be found on kristoferfannar.github.io/cv

In attempt to move away from overleaf, I've decided to move my cv to my file system, while version controlling it on GitHub. This allows for keeping track of incremental changes, autocompiling it and having a workflow continuously deploy it on GitHub Pages.

Setup

There are quite a few steps needed to fully migrate from overleaf to local compilation.

To begin with, you'll need a TeX compiler. I'm using MacTeX, specifically BasicTeX, as its 90MB bundle is quite a lot more appealing than the 5.7GB real thing.

Really, you only need this for the latexmk compiler. I didn't bother to find another way to install it, so just go with BasicTeX.

Note that latexmk didn't work for me at first, so I had to update it with tlmgr (after updating tlmgr itself first) until it started working.

sudo tlmgr update --self
sudo tlmgr update latexmk

The reason why I use latexmk is that it's recommended by VimTeX, the vim and neovim latex plugin I'm using.

This plugin is really impressive. In a latex file, simply :VimtexCompile and the generated pdf document is opened in your preferred pdf viewer.

Regarding the pdf viewer, I'm using Sioyek, and it's very impressive. VimTeX recommends using zathura, but I had trouble installing it, and once it was installed it couldn't automatically open the pdf file due to some issues with synctex. Nevermind that, just

brew install --cask sioyek

The auto-reload feature of Sioyek is super nice, and the setup (so far) more or less identically resembles overleaf. Only in the comfort of my editor.

Here's a short video of me showcasing my setup:

setup.mp4

External packages

External packages are stored as .sty files under tex/latex/<package>/<package>.sty in a specific package directory. For latexmk, this package directory can be seen using tlmgr conf under TEXMFHOME for user specific directory (similar to TEXMFLOCAL for system directory or TEXMFDIST for distribution wide packages).

For this project, the package directory is ./latex-packages/, so you'll have to set the environment variable manually:

# for zsh
echo "export TEXMFHOME=$(pwd)/latex-packages" >> ~/.zshrc && source ~/.zshrc

Note that this only works while you're only locally compiling latex for this project. If you're locally compiling latex for other projects, you'll need to use the original TEXMFHOME, storing the external libraries used here in a separate file and using a script to ensure they're installed.

Installing external packages

Installing packages is often as easy as sudo tlmgr install <package>, found using tlmgr search <package>. However, this will install the package in TEXMFDIST, which makes it hard to compile between devices. Also, sometimes these packages aren't available to the tlmgr directory. This encourages us to find and build the .sty files manually.

To do this, we require an .ins installer file and .dtx documented source file for the package - this can usually be found online. Then, to create the .sty file from these files, run:

latex <package>.ins

Ensuring that both the .ins and .dtx files are in the same directory, this will generate the .sty file required by latexmk.

Installing packages and fonts is all about placing them in the correct directories within the TEXMFHOME directory. Fonts exist using .tfm, .vf, .fd, .map, .enc and .pfb files, while most packages use the .sty extension. These have to be placed in the correct sub-directories within TEXMFHOME, for example $TEXMFHOME/fonts/vf/, $TEXMFHOME/fonts/tfm/ or $TEXMFHOME/tex/latex/

After moving a font or package to a directory, update the local LaTeX database using mktexlsr $TEXMFHOME or simply using mktexlsr. Then, to check whether a file is known by your local LaTeX database, use kpsewhich <file>. This helps a lot while installing libraries.

Remember to continuously compile with a clean cache latexmk -C clears cache, to get good error messages for what's next.

Releases

No releases published

Packages

No packages published

Languages