2

My foo.bib is like this:

@book{tgt,
  title = {The Great Title},
  author = {Jane Doe and Ron Wonder},
  year = {2022},
  publisher = {Macmillan},
  address = {Paris},
}

My LaTeX code like this:

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\DeclareNameAlias{author}{family-given}
\addbibresource{foo.bib}
\begin{document}

A proof can be found at \textcite{tgt}.

\printbibliography
\end{document}

Output I get:

    A proof can be found at Doe and Wonder (2022).

References

Doe, Jane and Wonder, Ron (2022). The Great Title. Paris: Macmillan.

But if I change my LaTeX code to:

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\DeclareNameAlias{sortname}{family-given}
\addbibresource{foo.bib}
\begin{document}

A proof can be found at \textcite{tgt}.

\printbibliography
\end{document}

I still get the exact same output.

What is the difference between \DeclareNameAlias{author}{family-given} and \DeclareNameAlias{sortname}{family-given}? Under what circumstance do these two ways of sorting first name, last name give different results?

1 Answer 1

2

The author is not the only name that can appear at the head of an entry. If you cite an entire @collection (e.g. gaonkar in biblatex-example.bib), the editor will appear in the author position. In certain situations you can even have a translator there.

sortname applies to author, editor and translator in the "primary name" position. author only applies to author. For consistency I'd always use sortname.

Compare the effects in

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear]{biblatex}

\DeclareNameAlias{sortname}{family-given}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson,vizedom:related,gaonkar,westfahl:frontier,nussbaum}

\printbibliography
\end{document}

Note that some styles don't define sortname, so there you might have to say

\DeclareNameAlias{author}{sortname}
\DeclareNameAlias{editor}{sortname}
\DeclareNameAlias{translator}{sortname}

first to see any effect.

3
  • Got two questions. 1) Thank you so much for a detailed answer. I generated two outputs with your code example. With sortname first: sortname.png. And again with author: author.png. The only difference I see between the two is how the name "Caffee, Gabrielle L." is sorted. In the first one it has family-given but in the second it has given-family. Why is only "Caffee, Gabrielle L." affected? Is it because this name occurs in translator field (not author field)? Jan 20, 2023 at 8:39
  • 2) I see that the difference between sortname and author is reproducible with a shorter \autocite like Lorem \autocite{vizedom:related}. Is there a reason why you chose a long \autocite like you did in your post? What are gaonkar:in and other citations relevant in your example? (Sorry, I am still new to this stuff and trying to wrap my head around all of this. Thank you for your help!) Jan 20, 2023 at 8:42
  • @LoneLearner Oops wrong gaonkar reference. It should have been gaonkar not gaonkar:in. Though to be fair you can't really see a lot because sortname is family-given/given-family by default, so a difference to family-given only comes in for the second name. Try given-family instead of family-given to see a real difference. (Or make up your own @collection entry with several editors.)
    – moewe
    Jan 20, 2023 at 8:55

You must log in to answer this question.

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