# Biblatex / biber code stopped working

This piece of code has recently started to flag errors having never done so before. The error is

Illegal parameter number in definition of \blx@defformat@d. ...\addcomma\addspace #1\addcomma\addspace #4 (followed by: })


and code is:

\DeclareNameFormat{author}{%
\ifnumequal{\value{listcount}}{1}
{\ifnumequal{\value{liststop}}{1}
{\ifnumless{\value{listcount}}{\value{liststop}}
}%


Any reason why this should now be happening please and how should I fix it?

• See Biblatex 3.3 name formatting. What exactly do you seek to achieve with that code? There should be less intrusive ways to get a family-given name format and an "and" before the last author. – moewe Sep 14 '16 at 12:13
• The code is a legacy from this question, which justifies the intrusiveness:tex.stackexchange.com/a/146870/4954 – DGarside Sep 14 '16 at 12:16
• I just saw that, hang on for a bit, there must be an easier way. – moewe Sep 14 '16 at 12:16
• So the only thing you are missing from a default with \DeclareNameAlias{sortname}{family-given}  say is the last comma after the last author (before the year)? – moewe Sep 14 '16 at 12:19
• yes that is correct – DGarside Sep 14 '16 at 12:20

With biblatex standard styles and version 3.5 you could get what you asked for in punctuation after authors/editors in bib latex with the two lines

\DeclareNameAlias{sortname}{family-given}


Unfortunately, biblatex-philosophy doesn't as of now use these fancy new features, we will have to enable them ourselves. We have just changed \addspace for \printdelim{nameyeardelim}/\printdelim{nonameyeardelim} at the appropriate places. (Note that the macros from biblatex-classic.bbx are almost exact copies of their counterparts in authoryear.bbx with support for nameaddon added.)

\renewbibmacro*{author}{%
\ifboolexpr{%
test \ifuseauthor
and
not test {\ifnameundef{author}}
}%
{\usebibmacro{bbx:dashcheck}%
{\bibnamedash}%
{\usebibmacro{bbx:savehash}%
\printnames{author}%
\iffieldundef{authortype}%
{\setunit{\printdelim{nameyeardelim}}}%
\iffieldundef{authortype}%
{}%
{\usebibmacro{authorstrg}%
\setunit{\printdelim{nameyeardelim}}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}%
\setunit*{\printdelim{nonameyeardelim}}}%
\usebibmacro{date+extrayear}}%

\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{%
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}%
{\usebibmacro{bbx:dashcheck}%
{\bibnamedash}%
{\printnames{editor}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{editor}%
\setunit{\printdelim{nameyeardelim}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}%
\setunit*{\printdelim{nonameyeardelim}}}%
\usebibmacro{date+extrayear}}%


From which point on the two lines from above do exactly the right thing.

MWE (adapted from punctuation after authors/editors in bib latex)

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[a4paper,twoside]{memoir}
\usepackage[english]{babel}
\usepackage[style=british]{csquotes}
\usepackage[style=philosophy-classic, giveninits=true, uniquename=init, natbib=true, backend=biber, indexing=true, defernumbers=true]{biblatex}

\DeclareNameAlias{sortname}{family-given}

% Bibliography customisation

\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]

\renewbibmacro{in:}{%
}

% Remove parentheses from year
\renewbibmacro*{date+extrayear}{%
\begingroup%
\clearfield{month}%
\clearfield{day}%
\ifboolexpr{%
test {\iffieldundef{date}}
and
test {\iffieldundef{year}}
}%
{\iftoggle{bbx:nodate}{\printtext{%
\midsentence\bibstring{nodate}}}{}}%
{\printtext{\printdateextra}}%
\endgroup}%

% Dot after year

% Put number in parentheses
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}

\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
\printfield{eid}}

\renewbibmacro*{author}{%
\ifboolexpr{%
test \ifuseauthor
and
not test {\ifnameundef{author}}
}%
{\usebibmacro{bbx:dashcheck}%
{\bibnamedash}%
{\usebibmacro{bbx:savehash}%
\printnames{author}%
\iffieldundef{authortype}%
{\setunit{\printdelim{nameyeardelim}}}%
\iffieldundef{authortype}%
{}%
{\usebibmacro{authorstrg}%
\setunit{\printdelim{nameyeardelim}}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}%
\setunit*{\printdelim{nonameyeardelim}}}%
\usebibmacro{date+extrayear}}%

\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{%
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}%
{\usebibmacro{bbx:dashcheck}%
{\bibnamedash}%
{\printnames{editor}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{editor}%
\setunit{\printdelim{nameyeardelim}}}%
{\global\undef\bbx@lasthash%
\usebibmacro{labeltitle}%
\setunit*{\printdelim{nonameyeardelim}}}%
\usebibmacro{date+extrayear}}%

\begin{document}
\cite{sigfridsson,aksin,geer,worman,knuth:ct:a,knuth:ct:b,knuth:ct:c,cicero}
\printbibliography
\end{document}


• A very instructive answer! – Sveinung Sep 14 '16 at 14:45
• Agreed, @moewe is really quite the expert on the latest biblatex features. – PLK Sep 17 '16 at 14:10