[Tex/LaTex] How to reverse name and first name

biblatexbiblatex-dw

With biblatex and verbose-trad2 style, I would like to reverse the order of the last name and the first name for inline references.

The default behavior is:

John DOE, Title, place : publisher, year

for inline references (in my case, in a footnote with footcite command) and:

DOE, John, Title, place : publisher, year

in the bibliography at the end of the document.

I would like to have both inline and final references in the following format (similar to the bibiography style).

DOE, John, Title, place : publisher, year

P-S : There are some close questions (like this one) but only about the final bibliography (and no inline references). \DeclareNameAlias{sortname}{last-first} works only for the ending references (not inline ones).

Best Answer

You will also have to set default, as the cite commands in verbose-trad2* temporarily set \DeclareNameAlias{sortname}{default} (and by ... default default is \DeclareNameAlias{default}{given-family}).

So just issue

\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{default}{family-given}

in the preamble. Note that default is used in a few other places as well, so this change also affects the bibliography. If you want a modification that affects only the citations, see below.

The MWE

\documentclass{article}  
\usepackage[style=verbose-trad2, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}

\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{default}{family-given}

\begin{document}
  A\footcite{wilde}
  B\footcite{cicero}
  \printbibliography
\end{document}

gives

enter image description here


* The code can be found in verbose-trad2.cbx, the sixth line below is the offending one.

\newbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \global\toggletrue{cbx:fullcite}%
  \printtext[bibhypertarget]{%
    \usedriver
      {\DeclareNameAlias{sortname}{default}}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

This shows us that a different solution would be

\DeclareNameAlias{sortname}{family-given}

\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \global\toggletrue{cbx:fullcite}%
  \printtext[bibhypertarget]{%
    \usedriver
      {}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

But of course that's longer. The effect is slightly different as this will only affect the name format in long citations and not anywhere else.


edit See the edit history for the pre-3.3 code if you are using an outdated version of biblatex. Cf. Biblatex 3.3 name formatting.