I would like to create a custom format for citing authors' names in the text, let's call it "newformat". One option I can think of is creating a new bibmacro for names where the parameters are changed to my liking, such as
\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}{\printnames{authors}}
\DeclareNameFormat{newformat}{%
\usebibmacro{name:newformat}{\textbf{#1}}{\textbf{#3}}{#5}{#7}%
\usebibmacro{name:andothers}%
}
\begin{document}
\section*{Testing the format here}
I am citing
\citename{Doe12}[newformat]{author}
\printbibliography % to make sure that the .bib file is properly formated.
\end{document}
Here, I just used \textbf
for the sake of the example, but I ultimately want to use other functions, say upper case or palindrome!
However, I get this weird error message:
! Illegal parameter number in definition of \blx@defformat@d.
<to be read again>
3
l.20 \usebibmacro{name:last}{#1}{#3
}{#5}{#7}%
which seems to indicate that the second option {#3} is not expected. I am a bit at a lost here; I checked the biblatex package and \usebibmacro{name:last} must be given 4 parameters, isn't it? Please advise.
\mkbibnamefamily
and friends. That way you don't have to fiddle round with name formats.