# biblatex - Family name + initial for everyone, but full given name for ambiguous entries

I am compiling a large bibliography with biblatex (3.16) and am struggling with the uniquename feature as applied to initials and full names. (The question is limited to the format of the bibliography, since the document consistently uses \nocite.)

I cite authors as "Family, G." (and other roles as "G. Family"), where "G." is the abbreviated given name. (Since prefixes play a role too, I am including the relevant code in my MWE.) Individuals sharing a last name and an initial require separate treatment, though, as "Family, G." becomes ambiguous.

This is the the notorious Bernoulli brothers problem (though that question dealt with bibtex not biblatex). To identify Jacob and Johann Bernoulli, I need to use their full given names.

I feel that there has to be an option to take care of this automatically, but so far, I couldn't get any of the approaches in the documentation to work. If I execute option giveninits, this abbreviates all given names. But then, it also seems to deactivate the function of uniquename, and the two J. Bernoulli's become indistinguishable. With uniquename=full (or similar values) and without giveninits, however, all names appear unabbreviated, regardless of disambiguation. And this elegant answer did not work for me.

I would like to avoid workarounds, such as (1) enclosing the names in braces: {Bernoulli, Johann} (which by the way needs to be inverted to {Johann Bernoulli} depending on the role), or (2) fully committing to giveinits and inputing the unwieldy author = {family=Bernoulli, given=Johann, given-i={Johann\nopunct}}. These workarounds function on a case-by-case, entry-by-entry basis, do not cover potential new ambiguities when adding new entries, they are error-prone in a large bibliography.

I'm hoping for a general solution that should ideally:

• abbreviate given initials as "G." in the bibliography, unless the initial "G." is common to distinct individuals, then output "Given".

• be able to scan across different namelists for doubles: say one of the Bernoullis is "author", another "translator" or some other custom roles that we may employ (f.i. we use "correspondent" in a custom entrytype letter).

Here is my MWE:

\begin{filecontents}{uniquename.bib}
@book{translator-jac-bernoulli,
title = {A book translated by Jacob Bernoulli},
translator = {Bernoulli, Jacob}}

@book{book-daniel-bernoulli,
author = {Bernoulli, Daniel},
title = {A book by Daniel Bernoulli}}

@collection{editor-joh-bernoulli,
editor = {Bernoulli, Johann},
title = {A collection edited by Johann Bernoulli}}

@book{book-jac-Bernoulli,
author = {Bernoulli, Jacob},
title = {A book by Jacob Bernoulli}}

@book{book-joh-bernoulli,
author = {Bernoulli, Johann},
title = {A book by Johann Bernoulli}}
\end{filecontents}{uniquename.bib}

\documentclass{article}
\usepackage[T1]{fontenc}

\usepackage[%
style=numeric,
giveninits,     % the desired look, though incompatible with uniquename
%uniquename=full,
backend=biber
]{biblatex}

\DeclareNameAlias{author}{family-given}

\ExecuteBibliographyOptions{useprefix=true}
\DeclareSortingNamekeyTemplate{
\keypart{\namepart{family}}
\keypart{\namepart{prefix}}
\keypart{\namepart{given}}
\keypart{\namepart{suffix}}}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


I think you need a new name format for this.

\documentclass{article}
\usepackage[T1]{fontenc}

\usepackage[%
style=numeric,
uniquename=full,
backend=biber
]{biblatex}

\DeclareNameFormat{always-init}{%
\ifnumequal{\value{uniquename}}{2}
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}%
\usebibmacro{name:andothers}}

\DeclareNameAlias{author}{always-init}
\DeclareNameAlias{editor}{always-init}

\ExecuteBibliographyOptions{useprefix=true}
\DeclareSortingNamekeyTemplate{
\keypart{\namepart{family}}
\keypart{\namepart{prefix}}
\keypart{\namepart{given}}
\keypart{\namepart{suffix}}}