As pointed out by Bernard in the comments, the problem might be caused by the editor. This was indeed the case.
I'm using TeXnicCenter 2, which has a list of output profiles for different compilers and post-processors. By default, all of these output profiles invoke bibtex
, and without any content being written to bibtex
(seeing as I'm using biblatex
instead), bibtex
writes an empty file to the .bbl
file every time the document is compiled, thus overwriting whatever biber
has written before.
Disabling BibTeX from the output profiles solves this entire problem. To find the window where output profiles can be changed, either press Alt+F7
or click the menu Build -> Define Output Profiles...
.
TeXnicCenter 1 is likely to have the same issue.
Here's a schematic answer, since you seem as eager to learn the principles involved as you are in getting an answer.
For CVs, I like to break each section into discrete files, which you can then \input
or not as needed. You could combine this with some boolean logic to determine if things get included or not. In the example below, you can see how to add the conditional clause into a macro definition and how to operate with \if
-constructions directly.
So you need some "sections" in independ files:
% cv-associations.tex
\section{Associations}
\lipsum[1]
% cv-contact.tex
\section{Contact Info}
\lipsum[1]
% cv-education.tex
\section{Education}
\cvendnote{\lipsum[2]}%
\lipsum*[1]
\cvendnote{\lipsum[3]}%
% cv-outreach.tex
\section{Outreach}
\cvendnote{\lipsum[2]}%
\lipsum*[1]
\cvendnote{\lipsum[3]}%
% cv-presentation.tex
\section{Presentations}
\lipsum[1]
% cv-publications.tex
\section{Publications}
\lipsum[1]
% cv-teaching.tex
\section{Teaching}
\cvendnote{\lipsum[2]}%
\lipsum*[1]
\cvendnote{\lipsum[3]}%
Then you need the masterfile:
\RequirePackage{etoolbox}% etoolbox's \bool*-related commands work with normal \if-related commands
\providebool{fullCV}% default: false
%\booltrue{fullCV}
%
\documentclass{article}
\usepackage{fontspec}
\usepackage{fontawesome,url,marvosym}
% An example of how you might conditionally load packages
\iffullCV
\usepackage{ebgaramond}
\else
\usepackage{libertine}
\fi
\usepackage{lastpage}
\usepackage{xcolor}
\usepackage{fnpct}
\usepackage{enotez}
\usepackage{multicol}
\usepackage{footmisc}
\usepackage{csquotes}
\usepackage{lipsum}% just for dummy text
% for things you sometimes want to \input
\newcommand{\cvinput}[1]{%
\iffullCV
\input{#1}
\else\fi}
% conditionally include \endnotes
\newcommand{\cvendnote}[1]{%
\iffullCV
\endnote{#1}%
\else\fi}
\begin{document}
% regular \input files will always be included
\input{cv-contact}
\input{cv-education}
\input{cv-publications}
% \cvinput files will only be included if \fullCVtrue is active
\cvinput{cv-presentations}
\input{cv-teaching}
\cvinput{cv-outreach}
\input{cv-associations}
\iffullCV
\printendnotes
\else\fi
\end{document}
Now you can compile the file directly and simply uncomment the \booltrue
line as needed. But the reason it's set up this way above the \documentclass
line is so you can use the command line to compile both files with one command. Something like this, for example (assuming the filename is multioutputCV.tex
):
xelatex -jobname=CVfull "\newif\iffullCV\fullCVtrue\input{multioutputCV.tex}" && xelatex -jobname=CVshort "\newif\iffullCV\fullCVfalse\input{multioutputCV.tex}"
(Compile twice, though, to get the endnotes in place for the full version.)
Should result in two files: CVshort.pdf
and CVfull.pdf
. You could now write a Makefile
if you liked, but that is somewhat beyond the scope of this question.
Best Answer
I do this by using symlinks and testing the jobname. That is, I have a main (la)tex file and a bunch of symlinks to it. To find out which symlink was actually used, I examine the
\jobname
macro in my document and set certain parameters accordingly. In particular, if\jobname
contains the string "handout", then the beamer class is called using thehandout
option. I do this by using a "wrapper" class which sets things up before calling the real class.