0

In my Bibliography, I would like to keep the first “given” name only (besides, obviously, the “family” name): No further given names, no initials. This has been surprisingly difficult to achieve. Consider this MWE:

\documentclass{scrreprt}

\usepackage[shorthands=off,american]{babel}
\usepackage{csquotes} 

\begin{filecontents}{\jobname.bib}

@article{Becker.2012,
  title = {Male gender bias in autism and pediatric autoimmunity},
  author = {Becker, Kevin G and John Q. Public},
  date = {2012},
  journaltitle = {Autism research},
  volume = {5},
  number = {2},
  pages = {77--83},
  langid = {english},  
}

@article{Bejerot.Eriksson.2014,
  title = {Sexuality and gender role in autism spectrum disorder},
  author = {Bejerot, Susanne Barbara Camelia and Eriksson, Jonna M},
  date = {2014},
  journaltitle = {PloS one},
  volume = {9},
  number = {1},
  pages = {111--141},
  langid = {english},  
}

@book{Cardon.Matson.2016,
  title = {Technology and the Treatment of Children with Autism Spectrum Disorder},
  editor = {Cardon, Teresa and Matson, Johnny X.},
  date = {2016},
  publisher = {Springer},
  location = {Heidelberg and New York and Dordrecht and London},
  langid = {english},
 }

\end{filecontents}

\usepackage[bibstyle=verbose, language=auto, autolang=other, dashed=true,
 maxcitenames=2, sorting=nyt, alldates=year]{biblatex}

\addbibresource{\jobname.bib}

% FAMILYNAME in small caps:
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}

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

How can I get rid of the “superfluous” names, as it were, short of removing them from my .bib file, which is frequently recompiled from sources that I have little control over?

enter image description here

3
  • biblatex has no notion of a middle name. Leaving aside the "von" and "junior" parts everything that is not family name is the given name. (See also github.com/plk/biblatex/issues/980.) You could use the extended name format to tell Biber about given vs middle names, but that means you will have to use rather 'unnatural' input (cf. e.g. tex.stackexchange.com/q/313176/35864). Alternatively you could try to use some string manipulation on the LaTeX side to drop everything but the first given name. (I'd look into expl3 regexes)
    – moewe
    Jul 28, 2021 at 9:58
  • Yes, this is what makes it so hard. It’s not really a middle name, it’s multiple first names. I suppose I might be able to figure out how to move them all to an array of sorts (split by space) and drop everything but the first element, but I would have thought this more of a standard feature: it can use the first initial after all, why not the first (given) name? Thanks for chiming in, as always.
    – Ingmar
    Jul 28, 2021 at 10:11
  • 1

2 Answers 2

2

As mentioned in the comments, biblatex (and indeed BibTeX) has no concept of a middle name. Everything that is not family name, "von" part (prefix), "junior" part (suffix) is understood as given name.

It would be possible to make biblatex distinguish between first given names and middle names if we use the extended name format and add a new name part. But this requires a slightly unnatural input (cf. Bibtex/Biber: how to cite an author using Ethiopian conventions?) and in particular would not change the handling of names specified in the normal <prefix> <family>, <suffix>, <given> or <given> <prefix> <family> order in the .bib file. This solution has the advantage that Biber knows about the different name parts and can act accordingly for sorting, name uniqueness etc.

A simpler solution (with the drawback that Biber does not know about it) is to have the middle names identified and dropped on the LaTeX side after the names have been parsed. l3regex makes that fairly easy if you know about the special format biblatex uses for names (name parts are separated with \bibnamedelima, \bibnamedelimb, \bibnamedelimi and not just spaces).

\documentclass{scrreprt}

\usepackage[shorthands=off,american]{babel}
\usepackage{csquotes} 
\usepackage[bibstyle=verbose, language=auto, autolang=other, dashed=true,
 maxcitenames=2, sorting=nyt, alldates=year]{biblatex}

\renewcommand*{\mkbibnamefamily}{\textsc}
\renewcommand*{\mkbibnamegiven}{\getfirstgivenname}

\ExplSyntaxOn
\seq_new:N \l_ingmar_givennames_seq
\regex_const:Nn \c_ingmar_splitnames_regex { \c{bibnamedelim(a|b|i)}|\s+ }

\cs_new_protected_nopar:Npn \__ingmar_getfirstgiven:n #1
  {
    \regex_split:NnN \c_ingmar_splitnames_regex { #1 } \l_ingmar_givennames_seq
    \seq_item:Nn \l_ingmar_givennames_seq {1}
  }
  
\cs_generate_variant:Nn \__ingmar_getfirstgiven:n { o }
  
\NewDocumentCommand \getfirstgivenname {m}
  {
    \__ingmar_getfirstgiven:o {#1}
  }
\ExplSyntaxOff

\begin{filecontents}{\jobname.bib}
@article{Becker.2012,
  title        = {Male gender bias in autism and pediatric autoimmunity},
  author       = {Becker, Kevin G. and John Q. Public},
  date         = {2012},
  journaltitle = {Autism research},
  volume       = {5},
  number       = {2},
  pages        = {77--83},
  langid       = {english},  
}
@article{Bejerot.Eriksson.2014,
  title        = {Sexuality and gender role in autism spectrum disorder},
  author       = {Bejerot, Susanne Barbara Camelia and Eriksson, Jonna M.},
  date         = {2014},
  journaltitle = {PloS one},
  volume       = {9},
  number       = {1},
  pages        = {111--141},
  langid       = {english},  
}
@book{Cardon.Matson.2016,
  title     = {Technology and the Treatment of Children with Autism Spectrum Disorder},
  editor    = {Cardon, Teresa and Matson, Johnny X.},
  date      = {2016},
  publisher = {Springer},
  location  = {Heidelberg and New York and Dordrecht and London},
  langid    = {english},
}
\end{filecontents}
\addbibresource{\jobname.bib}

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

Becker, Kevin and John Public. “Male gender bias in autism and pediatric autoimmunity”. In: Autism research 5.2 (2012), pp. 77–83.
Bejerot, Susanne and Jonna Eriksson. “Sexuality and gender role in autism spectrum disorder”. In: PloS one 9.1 (2014), pp. 111–141.
Cardon, Teresa and Johnny Matson, eds. Technology and the Treatment of Children with Autism Spectrum Disorder. Heidelberg et al.: Springer, 2016.

You can see how that goes wrong in

\documentclass{article}

\usepackage[shorthands=off,american]{babel}
\usepackage{csquotes} 
\usepackage[style=authoryear]{biblatex}

\renewcommand*{\mkbibnamefamily}{\textsc}
\renewcommand*{\mkbibnamegiven}{\getfirstgivenname}

\ExplSyntaxOn
\seq_new:N \l_ingmar_givennames_seq
\regex_const:Nn \c_ingmar_splitnames_regex { \c{bibnamedelim(a|b|i)}|\s+ }

\cs_new_protected_nopar:Npn \__ingmar_getfirstgiven:n #1
  {
    \regex_split:NnN \c_ingmar_splitnames_regex { #1 } \l_ingmar_givennames_seq
    \seq_item:Nn \l_ingmar_givennames_seq {1}
  }
  
\cs_generate_variant:Nn \__ingmar_getfirstgiven:n { o }
  
\NewDocumentCommand \getfirstgivenname {m}
  {
    \__ingmar_getfirstgiven:o {#1}
  }
\ExplSyntaxOff

\begin{filecontents}{\jobname.bib}
@book{doe:a,
  title        = {Book A},
  author       = {Jane Emilia Doe},
  date         = {2020},
}
@book{doe:b,
  title        = {Book B},
  author       = {Jane Edith Doe},
  date         = {2020},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
  \cite{doe:a,doe:b}
  \printbibliography
\end{document}

Jane Doe 2020; Jane Doe 2020
References
Doe, Jane (2020). Book B.
Doe, Jane (2020). Book A.

The two different works appear to have the same citation label and doe:b is seemingly incorrectly sorted before doe:a.


A fusion of the two approaches would be to use a Biber sourcemap to drop the undesired middle name initials directly when the data is read. Unfortunately, such a solution would have to replicate parts of the name parsing itself, because it would have to deal with all of Jane Emilia Doe, Doe, Jane Edith, Georgina Anne de la Name Nother before they are split into their name parts.

1
  • I understand that “post-processed names”, as it were (i.e., Firstgiven FAMILY) still need to be unique. Luckily this is not much of an issue for me, and should be easy to check for, or fix. Apart from that I am happy to report that your solution works exactly as intended. You, sir, are a gentleman and a scholar!
    – Ingmar
    Jul 29, 2021 at 7:45
0

(This is sort of a non-answer, but too long for a comment.)

You can't safely make an acceptable name form automatically from a full name like that. If you have "John Ronald Reuel Tolkien" in your bib file it would be just bad to have a program erroneously make him into "John Tolkien" in the bibliography. Similarly with "Alan Milne", "Thomas Eliot" and many more.

Also bad to have "Johan August Strindberg" in your bib file and have a program output that as "Johan Strindberg". That is just wrong. In this case you should have just "Strindberg, August" in the bib, since that is that author's name as used, on title pages and elsewhere. The bibliography is not the place for the full legal name, so don't put it in the bib file to begin with.

If an author uses several given names on title pages etc., like for example Philip José Farmer it is not up to you to decide that just "Philip Farmer" is enough. The same with initials. It may be the case that a name appears in print in various forms. There are for example book covers where Robert A. Heinlein is called just "Robert Heinlein" but an automatic system doing what you want won't know that, and if let loose will create name forms that just aren't acceptable.

3
  • I am aware of the ramifications, but we are not talking about well-known authors, or even writers at that: in my case it’s scientists, and if it’s acceptable to shorten their names to initials (as some style guides, or even the authors themselves at times, do), it’s acceptable in my book to drop every one but the very first given name, provided it remains unique. The bibliography is not the place for the full legal name, so don't put it in the bib file to begin with. Ah, but I don’t. I get citations from libraries, Google Scholar, crossref.org etc.
    – Ingmar
    Jul 29, 2021 at 7:54
  • Yes, it is acceptable and very common to shorten their names to initials. So do that! That the authors aren't well-known is no excuse for mishandling their names. I used well-known examples just so it would be obvious how bad this is. It doesn't mean that it is less bad for other authors. It doesn't matter what your source is for the bib entry you have. If it is bad (as they often are), then just edit it.
    – pst
    Jul 29, 2021 at 9:30
  • Thank you for your concern. For me, BibLaTeX simply does automatically what I would otherwise (have to) do by hand. I am happy with the result and consider this question resolved.
    – Ingmar
    Jul 29, 2021 at 10:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .