1

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}
      {#1\addcomma\addspace #4\addcomma\isdot}
      {#1\addcomma\addspace #4}}
    {\ifnumless{\value{listcount}}{\value{liststop}}
      {\addcomma\addspace #1\addcomma\addspace #4}
      {\addcomma\addspace\bibstring{and} #1\addcomma\addspace #4\addcomma\isdot}%
    }%

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
4

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} 
\DeclareDelimFormat[biblist,bib]{nameyeardelim}{\addcomma\space}

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{nameaddon}{}%
          {\setunit{\addspace}%
           \printtext[brackets]{\printfield{nameaddon}}}%
        \iffieldundef{authortype}%
          {\setunit{\printdelim{nameyeardelim}}}%
          {\setunit{\addcomma\space}}}%
     \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}%
        \setunit{\addspace}%
        \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} 

\addbibresource{biblatex-examples.bib} 

 % Bibliography customisation
\renewcommand*{\newunitpunct}{\addcomma\space}

\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{#1\adddot\nopunct\isdot}


\renewbibmacro{in:}{%
    \printtext{\bibstring{In}\addcolon\space}%
}

% 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
\renewcommand{\labelnamepunct}{\adddot\space}

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

\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
%  \setunit*{\adddot}% DELETED
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

\DeclareDelimFormat[bib]{nameyeardelim}{\addcomma\space}
\DeclareDelimFormat[biblist]{nameyeardelim}{\addcomma\space}

\renewbibmacro*{author}{%
  \ifboolexpr{%
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }%
    {\usebibmacro{bbx:dashcheck}%
       {\bibnamedash}%
       {\usebibmacro{bbx:savehash}%
        \printnames{author}%
        \iffieldundef{nameaddon}{}%
          {\setunit{\addspace}%
           \printtext[brackets]{\printfield{nameaddon}}}%
        \iffieldundef{authortype}%
          {\setunit{\printdelim{nameyeardelim}}}%
          {\setunit{\addcomma\space}}}%
     \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}%
        \setunit{\addspace}%
        \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}

page three - the bibliography - of the MWE

  • 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

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.