9

I am updating my old CV based on Friggeri's template, and now that I am using texlive 2015 instead of texlive 2013, I am finding maaaaany errors...

I compile it with LuaLaTeX and Biber for the bibliography.

I think most of the errors have to deal with the bibliography, which format all of a sudden is not understood...

Let me include a MWE below, where I think most of the errors are:

This is a MWE tex file:

\documentclass{MWE}
\addbibresource{MWE.bib}

\begin{document}
\section{Publications}
\printbibsection{article}
\clearpage
\end{document}

This is a MWE cls file:

\ProvidesClass{MWE}[2016/08/31 CV class]
\NeedsTeXFormat{LaTeX2e}
\DeclareOption{print}{\def\@cv@print{}}
\DeclareOption*{%
    \PassOptionsToClass{\CurrentOption}{article}%
}
\ProcessOptions\relax
\LoadClass{article}
\usepackage{hyperref}

%%%%%%%%%%%%%
% Structure %
%%%%%%%%%%%%%

\RequirePackage{parskip}
\newcounter{colorCounter}

\def\@sectioncolor#1#2#3#4#5{%
  {%
    \color{%
      \ifcase\value{colorCounter}%
        green\or%
        blue\or%
        magenta\or%
        yellow\or%
        brown\or%
        turquoise\fi%
    } #1#2#3#4#5%
  }%
  \stepcounter{colorCounter}%
}
\renewcommand{\section}[1]{
  \par\vspace{\parskip}
  {%
    \LARGE\headingfont\color{headercolor}%
    \@sectioncolor #1%
  }
  \par\vspace{\parskip}
}
\renewcommand{\subsection}[2]{
  \par\vspace{.5\parskip}%
  \Large\headingfont\color{headercolor} #2%
  \par\vspace{.25\parskip}%
}
\pagestyle{empty}

%%%%%%%%%%%%%%%%%%%%
% List environment %
%%%%%%%%%%%%%%%%%%%%

\setlength{\tabcolsep}{0pt}
\newenvironment{entrylist}{%
  \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
}{%
  \end{tabular*}
}
\renewcommand{\bfseries}{\headingfont\color{headercolor}}
\newcommand{\entry}[4]{%
  #1&\parbox[t]{11.8cm}{%
    \textbf{#2}%
    \hfill%
    {\footnotesize\addfontfeature{Color=lightgray} #3}%

    #4\vspace{\parsep}%
  }\\}

\makeatletter
\renewenvironment{entrylist}{%
  \par\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
}{%
  \end{tabular*}\par
}
\makeatother

%%%%%%%%%%%%%%%%
% Bibliography %
%%%%%%%%%%%%%%%%

\RequirePackage[style=verbose, maxnames=99, sorting=ydnt, backend=biber, dateabbrev=true]{biblatex}

\DeclareFieldFormat[article]{title}{#1\par}

\DeclareBibliographyDriver{article}{%
  \printfield{title}%
  \par\vspace{0.1\baselineskip}%
  \newblock%
  \printnames{author}%
  \par\vspace{0.1\baselineskip}%
  \newblock%
  {%
    \footnotesize \addfontfeature{Color=lightgray} \itshape%
    \usebibmacro{journal+issuetitle}%
    \setunit{\space}%
    \printfield{pages}%
    \newunit%
    \printlist{publisher}%
    %\setunit*{\addcomma\space}%
    %\printfield{year}%included in issuetitle
    \newunit%
  }
  \par\vspace{0.1\baselineskip}%
}

\DeclareFieldFormat[misc]{title}{#1\\}
\DeclareFieldFormat[misc]{type}{#1}

\newbibmacro*{bib:svtitle}{%
  \savefield{title}{\lasttitle}}

\newbibmacro*{bib:svauthor}{%
  \savename{author}{\lastauthor}}

\newbibmacro*{verifytitle}{%
    \iffieldequals{title}{\lasttitle}{\hspace{\bibhang}}{%
        \printfield{title}%
        \undef\lastauthor}%
    \usebibmacro{bib:svtitle}%
}

\renewbibmacro*{finentry}{\adddot\finentry}

\newbibmacro*{verifyauthor}{%
    \ifnameequals{author}{\lastauthor}
        {}
        {\printnames{author}\\}%
    \usebibmacro{bib:svauthor}}

\newbibmacro*{newtitle}{%
    \usebibmacro{verifytitle}}

\newbibmacro*{newauthor}{%
    \usebibmacro{verifyauthor}}

\DeclareBibliographyDriver{misc}{%
  \usebibmacro{newtitle}%
  \usebibmacro{newauthor}%
  {%
    \scriptsize \textcolor{lightgray}{\faCaretRight}%
  }
  {%
    \footnotesize \addfontfeature{Color=lightgray} \itshape%
    \hspace{5px}%
    \printfield{type} (\printfield{month} \printfield{year})%
    \setunit{\addperiod\space}%
    \printfield{note}%
    \setunit*{\addcomma\space}%
    \printlist{location}%
  }
  \usebibmacro{finentry}%
}

\DeclareFieldFormat[thesis]{title}{#1\par}

\DeclareBibliographyDriver{thesis}{%
  \printfield{title}%
  \par\vspace{0.1\baselineskip}%
  \newblock%
  \printnames{author}%
  \par\vspace{0.1\baselineskip}%
  \newblock%
  {%
    \footnotesize \addfontfeature{Color=lightgray} \itshape%
    \printfield{type}%
    \setunit{\addperiod\space}%
    \usebibmacro{institution+location+date}%
    \setunit{\addperiod\space}%
    \printfield{url}%
    \newunit%
  }
  \par\vspace{0.1\baselineskip}
}

\DeclareNameFormat{author}{%
  \small\addfontfeature{Color=lightgray}%
  \ifblank{#3}{}{#3\space}#1%
  \ifthenelse{\value{listcount}<\value{liststop}}
    {\addcomma\space}
    {}%
}

\newcommand{\printbibsection}[1]{
  \begin{refsection}
    \nocite{*}
    \printbibliography[sorting=chronological, type={#1}, heading=none]
  \end{refsection}
}

\DeclareSortingScheme{chronological}{
  \sort[direction=descending]{\field{year}}
  \sort[direction=descending]{\field{month}}
  \sort{\field{title}}
  \sort[direction=descending]{\field{day}} %I include the day in entries in the same month and year
}

This is a MWE bib file:

@article{Levine1991,
author = {Levine, A J and Momand, J and Finlay, C A},
journal = {Nature},
pages = {453--456},
title = {{The p53 tumor suppressor gene}},
volume = {351},
year = {1991}
}
@article{Scully2000,
author = {Scully, R and Livingston, D M},
journal = {Nature},
pages = {429--432},
title = {{In search of the tumour-suppressor functions of BRCA1 and BRCA2.}},
volume = {408},
year = {2000}
}

Some of the errors that I find are the following (the ones I can reproduce with the MWE):

Undefined control sequence. \section{Publications}

Undefined control sequence. \printbibsection{article}

You can't use `macro parameter character #' in horizontal mode. \printbibsection{article}

Missing $ inserted. \printbibsection{article}

You can't use `\spacefactor' in math mode. \printbibsection{article}

And warnings (the ones I can reproduce with the MWE):

sorting option to \printbibliography is no longer supported, use 'sorting' option to \newrefcontext.

Command \small invalid in math mode

Could anyone help me update the Friggeri's CV template? I have no idea what these errors/warnings mean and how to solve them. I think updating this CV template could be really useful for many people...

Thanks a lot!

Johannes_B
  • 24,235
  • 10
  • 93
  • 248
DaniCee
  • 2,217
  • 1
    friggeri-cv is now in a state of not working anymore. Nobody wants to update that hideous thing. It was merely working for quite a while, but the biblatex update from march finally broke the template. Good thing. – Johannes_B Aug 31 '16 at 07:17
  • Oh wow, I was not aware of that... Is there a similar template out there that works well? – DaniCee Aug 31 '16 at 07:20
  • 2
    It is a CV, you need no template. All you need is maybe a tabular, a description list and an itemize list. That is really all you need. – Johannes_B Aug 31 '16 at 07:49
  • IMO modernCV looks nicer anyway, and just plain works (including biblatex). @Johannes_B is perhaps a little optimistic, depending on the field, as things like a multi-column list can be useful without having to wrap itemizes inside tabulars. – Chris H Aug 31 '16 at 07:53
  • @moewe If you want to fix the bib-related things, i can manage to update the template on ltemplates. You would also be mentioned (if you want to). – Johannes_B Aug 31 '16 at 07:56
  • @ChrisH I never said to place lists inside tabulars. But depending on the output you want to achieve, that can even be a good thing. It really depends what the output should look like. A CV is not a scientific report, something (La)TeX was made for. It is manually placing boxes and building the CV like you would do to build a house with lego blocks. – Johannes_B Aug 31 '16 at 07:58
  • @Johannes_B, no, you didn't, but it's one way to achieve what I do (and what modernCV offers) using the tools you suggest. The downside of too much manual placement is the potential for inconsistency (I say this as someone who's spent the last few days woking in beamer -- similar placement issues -- but wouldn't do a poster in anything other than inkscape) – Chris H Aug 31 '16 at 08:01
  • @ChrisH But if the template (not specifically mentioning moderncv) specifies the inconsistencies, the user has absolutely no gain in using it. Templates confuse me. – Johannes_B Aug 31 '16 at 08:05
  • @Johannes_B Fortunately, there were only two changes needed to get things running again, feel free to update the package. But I'd prefer not to have my name associated with the template. – moewe Aug 31 '16 at 08:27
  • @Johannes_B TeX is a box stacking language ;) I mean it literally – percusse Aug 31 '16 at 08:50
  • To the deleted question: You should start with something close or completely from scratch. moderncv is a class that many like for its visual appearance, but from a coding point of view, it is a real horror. And extremely complicated to mess with. Digging into moderncv will be a waste of time compared to setting up a bit stuff from scratch. – Johannes_B Oct 31 '16 at 13:21
  • That is exactly what I am realizing... moderncv seems like a take it or leave it choice, and messing with it might not be a good idea, at least with my knowledge of Latex. On the other hand, I don't even know where to start if I am going to do it from scratch... normal article? – DaniCee Nov 01 '16 at 02:39
  • I probably just want to change moderncv to add a left column on the left to place floating boxes, change the header, the footer, and the font... but no idea how to do it. – DaniCee Nov 01 '16 at 02:45
  • There is a new version here: https://github.com/mlda065/friggeri-letter . However I don't see how to add more than one aside like I used to. – alfC Aug 04 '17 at 06:18

2 Answers2

9

Some of the bibliography code could probably be streamlined, but this answer shall focus on making things work again.

The main problem is the name format (see biblatex 3.3 name formatting) which can be fixed with

\DeclareNameFormat{author}{%
  \small\addfontfeature{Color=lightgray}%
  \ifgiveninits
    {\usebibmacro{name:given-family}
      {\namepartfamily}
      {\namepartgiveni}
      {\namepartprefix}
      {\namepartsuffix}}
    {\usebibmacro{name:given-family}
      {\namepartfamily}
      {\namepartgiven}
      {\namepartprefix}
      {\namepartsuffix}}%
  \usebibmacro{name:andothers}}

instead of the current \DeclareNameFormat{author}. Maybe there is a better solution than that, but this will restore proper functionality.

Another issue is that the sorting option is not valid as an argument to \printbibliography any more, it needs to be passed to a refcontext.

So we want

\newcommand{\printbibsection}[2]{%
  \begin{refsection}%
    \newrefcontext[sorting=chronological]%
    \nocite{*}%
    \printbibliography[type={#1}, title={#2}, heading=subbibliography]%
  \end{refsection}}

for \printbibsection.

Something similar goes for the manual re-enactment of \printbibsection in cv_10.tex.

moewe
  • 175,683
  • 1
    I can't understand why you don't want to be assosiated with that template :-) +1 and Thanks – Johannes_B Aug 31 '16 at 08:43
  • When I make this change to the classe file, I get an error and no output file is produced. The message I get is: stdin -> CV:pdf[1][2][3] xdvipdfmx:warning: invalid CMap xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object. Output file removed. Did somebody run into the same problem ? – Pierrick Oct 24 '16 at 09:44
  • @Pierrick At face value that looks like something else entirely. Can you isolate the problem into an MWE and ask it as a new question. Preferably with details about how you compile your document as well as software versions. – moewe Oct 24 '16 at 16:26
  • @moewe I will try to isolate it as soon as I get time to do it. will probalbly be in two weeks. – Pierrick Oct 26 '16 at 12:25
0

replacing bibheading with subbibliography after @moewe suggestion fixed everything. Thanks, wasn't really looking forward to create a new CV from scratch...

\newcommand{\printbibsection}[2]{%
\begin{refsection}%
    \newrefcontext[sorting=chronological]%
    \nocite{*}%
    \printbibliography[type={#1}, title={#2}, heading=subbibliography]%
\end{refsection}}
Stefan Pinnow
  • 29,535
  • Is this still specific to Friggeri's CV? If so, why doesn't moewe's answer work with bibheading? – Werner Mar 13 '17 at 21:38
  • This is not an answer: at best it is a comment to @moewe's answer. And the best way to signal your approval with an answer on this site is to upvote it. (Of course, you may also leave a comment about the minor change.) – jon Mar 14 '17 at 01:46
  • Not sure why it didn't work, latex complained that bibheading was not defined. You're right, I tried to add this as a comment but the system said I didn't have enough reputation to comment (it was my first comment). I also cannot upvote (min 15 reputation). Anyway, you can delete this or do as you see fit. Thanks again moewe – Paulo Maia Mar 15 '17 at 10:51