# Extra bracket error, europasscv + biblatex

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}

\DeclareBibliographyCategory{aa}
\DeclareBibliographyCategory{bb}

\begin{document}

\begin{europasscv}

\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
• 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

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}

\DeclareBibliographyCategory{aa}
\DeclareBibliographyCategory{bb}

\begin{document}

\begin{europasscv}