1

Am trying to use europasscv and biblatex with the publications split into categories, but get an error.

pdflatex <file>
[...]
! Argument of \end has an extra }.
<inserted text> 
                \par 
l.23 \printbibtabular[title=A,category=aa]

Here is the Latex file:

\documentclass[swedish,a4paper,10pt]{europasscv}
\usepackage[T1]{fontenc}
\usepackage[backend=bibtex,sorting=ynt,style=numeric,maxnames=99]{biblatex}
\usepackage{europasscv-bibliography}

\addbibresource{mwe}

\DeclareBibliographyCategory{aa}
\DeclareBibliographyCategory{bb}

\begin{document}

\begin{europasscv}

\addtocategory{aa}{A:2019}
\addtocategory{bb}{B:2019}

\nocite{A:2019}
\nocite{B:2019}

\renewcommand{\section}[2]{\ecvitem{#2}}

\printbibtabular[title=A,category=aa]
\printbibtabular[title=B,category=bb]

\end{europasscv}
\end{document}

and here is the .bib file:

@Book{A:2019,
  author =   {A},
  title =    {A},
  publisher =    {A},
  year =     {2019}
}
@Book{B:2019,
  author =   {B},
  title =    {B},
  publisher =    {B},
  year =     {2019}
}

Edit: how do I get it to run without errors AND produce nice output?

  • The redefinition of \section (\renewcommand{\section}[2]{\ecvitem{#2}}) is faulty. If I remove it the example compiles fine. – moewe Jun 13 at 5:45
  • @moewe: that messes up the format, as it puts bigger headings in normal font and black colour instead of the proper ones. I need to do something about the section commands that the bibliography prints. – Tomas By Jun 13 at 5:49
  • I think ecvitem is the proper command to use at that point. – Tomas By Jun 13 at 5:51
  • Try \renewcommand{\section}[2]{\ecvitem{#2}{}} it is still wrong, but might look more like what you have in mind. The problem with the initial definition was that \ecvitem has two mandatory arguments. With \renewcommand{\section}[2]{\ecvitem{#2}} you only have it one argument and \ecvitem would just go on and swallow whatever followed it as its second argument. Understandably, that does not always go well and so you got an error. – moewe Jun 13 at 5:53
  • Ok, thanks. Yes, I'm not really sure how it should look, as the cite keys are on the left of the dividing line. – Tomas By Jun 13 at 6:03
1

According to the europasscv documentation \ecvitem takes one optional and two mandatory arguments.

\ecvitem[vspace]{left}{right}

With the redefinition

\renewcommand{\section}[2]{\ecvitem{#2}}

\section{#1}{#2} will be replaced with \ecvitem{#2} and so \ecvitem is missing its second argument. It will just go on and gobble whatever comes next as its second argument. Understandably, that can not always go well. (Note that the \section{#1}{#2} here is a bit misleading. Since biblatex uses \section* as default heading, the #1 will actually just be the *. So we actually replace \section*{#2} with \ecvitem{#2}. Naturally this would come out wrong if one were to use \section{Title} or even worse \section[Short]{Long}.)

I'm not entirely sure what exactly you want, but you could try

\renewcommand{\section}[2]{\ecvitem{#2}{}}

or

\renewcommand{\section}[2]{\ecvitem{#2}{#2}}

I'm not too happy about this since this redefinition does not really reflect normal usage of the command \section in most document classes (where you could have \section*{Unnumbered} or \section[Short]{Long}), but it will work without error for this use case.

Note the defernumbers option.

\documentclass[swedish,a4paper,10pt]{europasscv}
\usepackage[T1]{fontenc}
\usepackage[backend=bibtex, style=numeric, sorting=ynt, defernumbers, maxnames=99]{biblatex}
\usepackage{europasscv-bibliography}

\addbibresource{biblatex-examples.bib}

\DeclareBibliographyCategory{aa}
\DeclareBibliographyCategory{bb}

\begin{document}

\begin{europasscv}

\addtocategory{aa}{sigfridsson}
\addtocategory{bb}{nussbaum}

\nocite{sigfridsson,nussbaum}

\renewcommand{\section}[2]{\ecvitem{#2}{}}
\printbibtabular[title=A,category=aa]
\printbibtabular[title=B,category=bb]

\end{europasscv}
\end{document}

CV

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.