Biblatex 3.3 name formatting

In biblatex 3.3. the format of \DeclareNameFormat has changed. In its code part it no longer accepts 8 arguments, but only one. For the various parts of a name there are now macros which you get by splitting the main name data with \namepart.

The change in the name formatting also affects commands like \mkbibnamelast (now \mkbibnamefamily) and bib-macros like \name:first-last (now name:given-family) and options like firstinits (now giveninits). This means that quite a number of older documents and styles must be adapted. One should to check the documentation when using older examples involving the formatting of names.

Your example could look like this in the new format

\documentclass{article}

  \usepackage{filecontents}
  \usepackage[backend=biber]{biblatex}[2016/01/01] %the latest version of biblatex?
  % biber is version 2.4; the latest?

\begin{filecontents}{\jobname.bib}
@misc{Doe12,
  author = {Doe, John},
  year = {2012},
  title = {A macro for formatting names},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\nocite{*}

\newbibmacro{name:newformat}{%
   \textbf{\namepartfamily}  % #1->\namepartfamily, #2->\namepartfamilyi
   \textbf{\namepartgiven}   % #3->\namepartgiven,  #4->\namepartgiveni
   [prefix: \namepartprefix] % #5->\namepartprefix, #6->\namepartprefixi
   [suffix: \namepartsuffix] % #7->\namepartsuffix, #8->\namepartsuffixi
   }

\DeclareNameFormat{newformat}{%
  \nameparts{#1}% split the name data, will not be necessary in future versions
  \usebibmacro{name:newformat}%
  \usebibmacro{name:andothers}%
}

\begin{document}

  \section*{Testing the format here}

  I am citing
  \citename{Doe12}[newformat]{author}

\end{document}

Be aware: I did not try to make a good looking format. E.g I didn't add suitable tests for empty name parts.

The example also don't use the same style as the standard definitions. biblatex itself would define the bib macro as a macro with 4 arguments:

   \newbibmacro*{name:newformat}[4]{ \textbf{#1} \textbf{#2} ...}

and then call the macro with arguments in \DeclareNameFormat

    \usebibmacro{name:newformat}{\namepartfamily}{\namepartgiven}{...}{...}

Imho my version is easier to understand and easier to extend, but this is a matter of taste.

The bonus is that the name system is now extensible and new name parts can be added in the future.

Links for further reading:

https://github.com/plk/biblatex/issues/372

http://www.texdev.net/2016/03/13/biblatex-a-new-syntax-for-declarenameformat/

Check also the documentation, the release notes (in the doc folder of biblatex) and the examples (for an example how to extend the name system).

Tags:

Biblatex