2

I've noticed that the Friggeri template seems to demand each entry to have at least one descriptive line (4th argument) or it breaks the code. For example:

    \section{Awards}
    \begin{entrylist}
    \entry
    {2014}{Cookie Award}{Bakery Bob}
    {--This argument has to be here or it breaks everything--}
    \end{entrylist}

I want to have this line be optional, so I can have some entries with just 1 line. Ideas? Deleting the undesired argument generates a ton of errors and breaks it, while leaving the argument empty generates an empty line instead. Can the cls file be edited to ignore empty arguments for example?

1

An easy way around this is to just add an empty argument:

\entry{2014}{Cookie Award}{Bakery Bob}{}

which does work, but messes up the spacing. The reason is found by looking at the definition of \entry:

\newcommand{\entry}[4]{%
  #1&\parbox[t]{11.8cm}{%
    \textbf{#2}%
    \hfill%
    {\footnotesize\addfontfeature{Color=lightgray} #3}\\%
    #4\vspace{\parsep}%
  }\\}

This adds a \\ after the third argument. Now if the last argument #4 is empty, the linebreak is still done, which creates this ugly empty line. To prevent LaTeX from doing the linebreak if the 4th argument is empty, we can just check if the argument is empty, and only do the linebreak and print #4 if it exists:

\documentclass[]{friggeri-cv}

\renewcommand{\entry}[4]{%
  #1&\parbox[t]{11.8cm}{%
    \textbf{#2}%
    \hfill%
    {\footnotesize\addfontfeature{Color=lightgray} #3}%
    \ifthenelse{\equal{#4}{}} 
        {}                      % if #4 == blank
        {\\#4\vspace{\parsep}}  % else
  }\\}

\begin{document}
    \header{john}{smith}{junior business analyst}
    \section{Awards}
    \begin{entrylist}
        \entry{2014}{Cookie Award}{Bakery Bob}{An optional description}
        \entry{2013}{Cake Award}{Bakery John}{}
        \entry{2012}{Bread Award}{Bakery Jack}{}
    \end{entrylist}
\end{document}

Resulting output, with and without description

  • An elegant solution to the problem, thanks! One remark though is that the code still breaks if the 4th argument contains a linebreak (\): 'undefined control sequence'. – k11 Sep 22 '15 at 14:03
  • What if you use \newline instead of \\ to add a line break? – hbaderts Sep 22 '15 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.