2

How can I get biblatex labels consisting of the full name of the first author followed by two year digits (i.e., [Smith42], [Johnson87])?

I've found this question, which provides a solution for getting a label based on the first author only, but it only uses the first three letters. How can I extend that to the full name?

Bloops
  • 913

2 Answers2

3

We can modify the labelalpha-template to do this

\DeclareLabelalphaTemplate{
  \labelelement{
    \field[final]{shorthand}
    \field{label}
    \field[names=1]{labelname}
  }
  \labelelement{
    \field[strwidth=2,strside=right]{year}    
  }
}

Where the important change is in the fifth line: we only print one labelname (the first), but that to its full length.

If you want to get rid of the plus indicating "et al" you need to use

\renewcommand*{\labelalphaothers}{}

Alternatively, your modification could look like this

\DeclareLabelalphaTemplate{
  \labelelement{
    \field[final]{shorthand}
    \field{label}
    \field{labelname}
  }
  \labelelement{
    \field[strwidth=2,strside=right]{year}    
  }
}

With maxalphanames=1 explicitly set as an option.

MWE

\documentclass{article}
\usepackage[
  style = alphabetic,
  maxalphanames=1, 
  backend = biber,
]{biblatex}

\addbibresource{biblatex-examples.bib}

\DeclareLabelalphaTemplate{
  \labelelement{
    \field[final]{shorthand}
    \field{label}
    \field{labelname}
  }
  \labelelement{
    \field[strwidth=2,strside=right]{year}    
  }
}

\renewcommand*{\labelalphaothers}{}

\begin{document}
  This is plain filler \cite{wilde} and further on \cite{cicero} and \cite{baez/article}.
\end{document}
moewe
  • 175,683
1

This should help, although I didn't test it:

\DeclareLabelalphaTemplate{
  \labelelement{
    \field[{labelname}
  }
  \labelelement{
    \field[strwidth=2,strside=right]{labelyear}
  }
}

See details in the Sec. 4.5.4. "Labels" of the biblatex manual.

Oleg Domanov
  • 1,496