My CV LaTeX Setup
Worked my CV in \(\LaTeX\) + BibLaTeX over the weekend. Quite some work but I am happy with the result cv-nguyen.pdf (built from these 3 files cv.tex, cv.bib, tvn.png using these commands). The full git repo is at https://github.com/dynaroars/latex-cv.
Here are some main things the CV has:
- Minimal: build from scratch, e.g.,
documentclass{article}
; just use some few common packages; very little customizations (default on most things). This is a personal preference as I try to avoid using too many additional packages and having to learn about them. - Use a single
.bib
file to generate publications: also customize various fields (e.g., bold and styles to specific authors, conference names, etc). - Can generate different versions: generate different contents depending on a boolean flag. I have a single flag that when
true
, generate my CV based on required format for College of Engineering, and whenfalse
, generate a CV for my own use. Both versions share as much contents as possible.
1. Bib files
Previously, I put my publication entries directly in the CV. But since I have already maintained a cv.bib
file containing all my publications, I can just use information from that file instead. This means integrating my CV with cv.bib
.
It is easy to just print out entries from a bib file (e.g., using natlib
with \bibentry{key}
or biblatex
with \fullcite{key}
). However, I also want some customizations in certain bib fields (e.g., some conferences or journalds being bold and different formatting for my students, and additional information like url, acceptance rates). One easy way is to add these customizations directly to the bib entries in the cv.bib
file (e.g., we can do author={\textbf{authorA}, authorB}
). But this will affect other files that use the modfified entries in cv.bib
. There are also various suggestions on hacking the bib display driver or style, but these hacks break easily and I found them complicated and not elegant.
After various tries, I end up with this approach of "extending" bib entries using crossref
and customizing specific fields. I found this approach easy and does not mess up my original bib entries.
1.1. BibLaTeX
Below I describe the method using biblatex
and biber
(bibtex
should work similarly). My preamble has something like this
\documentclass[11pt]{article} % the max parameters limit the number of authors, e.g., print et al after the first 10 names \usepackage[backend=biber,doi=false,isbn=false,maxcitenames=10,maxbibnames=10,style=alphabetic]{biblatex} \addbibresource{cv.bib}
1.2. A single bib
file
Consists of 2 parts: the first part are regular bib entries, the second are additional customizations and formats for those entries.
This part contains standard bib entries, e.g.,
@inproceedings{nguyen2021gentree, title={GenTree: Using decision trees to learn interactions for configurable software}, author={Nguyen, KimHao and Nguyen, ThanhVu}, booktitle={International Conference on Software Engineering (ICSE)}, pages={1598--1609}, year={2021}, organization={IEEE} } @article{le2020dynamite, title = {DynamiTe: dynamic termination and non-termination proofs}, author = {Le, TonChanh and Antonopoulos, Timos and Fathololumi, Parisa and Koskinen, Eric and Nguyen, ThanhVu}, journal = {Proceedings of the ACM on Programming Languages}, volume = {4}, number = {OOPSLA}, pages = {1--30}, year = {2020}, publisher = {ACM New York, NY, USA} } ...
This part has bib entries that "inherit" the standard ones in the previous part. They allow us to customize the standard bib entries , e.g., bold top venues, students' names, additional info such as acceptance rate, etc.
@String{ ICSE={\textbf{International Conference on Software Engineering (ICSE)}}} @String{ PACMPL={\textbf{Proceedings of the ACM on Programming Languages}} } ... @inproceedings{nguyen2021gentreec, crossref = {nguyen2021gentree}, author={Nguyen$^1$, KimHao and Nguyen, ThanhVu}, booktitle=ICSE, url={https://dynaroars.github.io/pubs/nguyen2021gentree.pdf}, addendum={acceptance rate 22\%} } @article{le2020dynamitec, crossref={le2020dynamite}, journal = PACMPL, url={https://dynaroars.github.io/pubs/le2020dynamite.pdf}, addendum= {acceptance rate 36\%} } ...
Note: you can also create 2 bib
files for these two parts (but I prefer to have as few files as possible).
As can be seen, the entries from from the second part inherit those from the first part using crossref
, and override only fields that need to be customized (e.g., booktile
and author
in nguyen2021gentreec
). Entries from the second part also contain additional fields and information such as url
and acceptance rate
.
Now all I need to do is use cite the keys in the second part in my main TeX
files, e.g., calling \fullcite{nguyen2021gentreec}
will display the nguyen2021gentree
standard entry in but with customized author and book title, and the new information on url and acceptance rates. For example, the following
\begin{itemize} \item \fullcite{nguyen2021gentreec} \end{itemize}
will display:
- KimHao Nguyen\(^1\) and ThanhVu Nguyen. “GenTree: Using decision trees to learn interactions for configurable software”. In: International Conference on Software Engineering (ICSE). IEEE. 2021, pp. 1598–1609. url: https://dynaroars.github.io/pubs/nguyen2021gentree.pdf. acceptance rate 22%
Of course, we can add other customizations like changing color of authors and other fancy stuff by additing LaTeX commands to the entry like above (e.g., \textbf{...}
). For example, instead of having a separate URL field, you might want directly link the title to the file like this
@inproceedings{nguyen2021gentreec, crossref = {nguyen2021gentree}, title={\href{https://dynaroars.github.io/pubs/nguyen2021gentree.pdf}{GenTree: Using decision trees to learn interactions for configurable software}}, author={Nguyen$^1$, KimHao and Nguyen, ThanhVu}, booktitle=ICSE, addendum={acceptance rate 22\%} }
A note on naming convention: I simply append the letter c
to the keys to indicate customized bib entries. I also use the Google Scholar naming convention (LastnameYearFirstWordInTitle
) to manage my bib entries and pdf files.
2. Generating different outputs
Previously, I maintain 2 CV versions: a personal one (posted on my website and updated more frequently) and a work one (for annual evaluation with the College of Engineering). They have many differences in styles and structures but also share many things (after all, both are about me!). So now I decide to merge them into one so that I can reuse things and only have to maintain only one version. The simplest way I found is simply using conditions in the etoolbox
package.
In the preamble, I have
\newtoggle{usecoe} \settoggle{usecoe}{false} % not CoE version \newcommand{\coe}[1]{\iftoggle{usecoe}{#1}{}} \newcommand{\notcoe}[1]{\nottoggle{usecoe}{#1}{}} \newcommand{\coeite}[2]{\iftoggle{usecoe}{#1}{#2}}
Alternatively, if you don't want to use etoolbox
, you can use something like below
\newif\ifusecoe %\usecoetrue \usecoefalse % not CoE version \newcommand{\coe}[1]{{\ifusecoe #1\fi}} \newcommand{\notcoe}[1]{{\ifusecoe \else #1 \fi}} \newcommand{\coeite}[2]{{\ifusecoe #1 \else #2\fi}}
This allows me to have something such as
% CoE requires this section, so only include this when \coetrue is set \coe{ \section{CoE Specific} ... } % Only include this when not generating a CV format, i.e., \coefalse is set \notcoe{ \section{Personal} ... } % Or switch things \coeite{ \section{CoE Specific} ... } { \section{Personal} ... } % another example I like the College of \coeite{Engineering}{Art and Science}
3. Other stuff
3.1. The enumitem
package
I use the enumitem
package to itemize/enumerate and reference things with releveant prefixes (e.g., conference papers with C and journals paper with J, e.g., My undergraduate freshman student, KimHao, got a full research paper at ICSE'21 [C1])
% Conference paper list \begin{enumerate}[label=C\arabic*] \item \label{nguyen2021gentree} \fullcite{nguyen2021gentreec} \end{enumarate} % Journal paper list \begin{enumerate}[label=J\arabic*] \item \label{le2020dynamite} \fullcite{le2020dynamitec} \end{enumarate} % referering to a paper My undergraduate freshman student, KimHao, got a full research paper at ICSE'21~\ref{nguyen2021gentree}.
3.2. Other Macros
Other than the \coe
, \notcoe
, \coeite
macros above, I have several more macros to make things easier. I try not to use too many macros to keep things simple. One macros that I use often for listing publication entries is
\newcommand{\mypubc}[2]{\item \label{#1} \fullcite{#1c}\coe{, contribution #2}} %label,contribution percentage (CoE only)
This allows me to not having to type
\item \label{nguyen2021gentree} \fullcite{nguyen2021gentreec}
like above. Instead, I can just type
\mypubc{nguyen2021gentree}{50\%}
The last argument #2
is an additional information that only appears in the CoE version (to show how much you contribute in a paper, 50% in this example).
4. Building
$ latexmk -c #clean up things but don't delete pdf/dvi outputs $ # latexmk -C #really clean up everything $ latexmk cv.tex -pdf # build the file , this will also invoke biber (or bitex) and does everything