I'm setting up my own bbx file in biblatex based on authoryear and want it to output the author in another name format when the book has a shorthand. Normally it should output e.g. “Albert E.”, so I defined
\DeclareNameAlias{sortname}{first-last}
\DeclareNameFormat{first-last}{%
\iffirstinits
{\usebibmacro{name:first-last}{#2}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#2}{#3}{#5}{#7}}%
\usebibmacro{name:andothers}
}
For books with a shorthand it should in contrast output e.g. “Albert Einstein”, without abbreviating the last name. How can I achieve this?
MWE:
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{filecontents}
\usepackage[backend=biber,style=authoryear-icomp,]{biblatex}
\begin{filecontents}{lit.bib}
@book{regular,
title = {Book's title},
author = {Lastname, Firstname},
location = {The City},
publisher = {Publisher},
date = {2005},
}
@book{withshorthand,
shorthand = {short},
title = {Book's title},
author = {Lastname2, Firstname2},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}
\addbibresource{lit.bib}
\DeclareNameAlias{sortname}{first-last}
\DeclareNameFormat{first-last}{%
\iffirstinits
{\usebibmacro{name:first-last}{#2}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#2}{#3}{#5}{#7}}%
\usebibmacro{name:andothers}}
\begin{document}
some\parencite{regular} text\parencite{withshorthand}
\printbibliography
\end{document}
Output:
As it has a shorthand, the second bibliography entry should have “Firstname2 Lastname2”, not abbreviating the author's last name as normal entries like #1 do.