# Bib label in alphabetic style but with full 4-digit year

Consider the following bibliography example using alphabetic style, maxalphanames = 1 and deactivated + in case of multiple authors:

How can achieve a complete 4-digit year in the label? So in this case the desired output would be: Baa1989

I found a source explaining how to define a complete custom label. But I have a hard time believing that there is no simpler more generic switch to switch. Couldn't find any in the manual.

I'm looking for a solution for biblatex + biber.

Thank you.

## MWE

\begin{filecontents}{references.bib}
Title                    = {Direct self control of inverter-fed induction machine, a basis for speed control without speed-measurement},
Author                   = {Baader, U. and Depenbrock, M. and Gierse, Georg},
Booktitle                = {Industry Applications Society Annual Meeting, 1989., Conference Record of the 1989 IEEE},
Year                     = {1989},
Month                    = {Oct},
Pages                    = {486-492 vol.1},
}
\end{filecontents}

\documentclass{article}

\usepackage[style=alphabetic,%
backend=biber,
maxnames=99,
maxalphanames=1,
backref=true,
doi=false,isbn=false,url=false,
backref=false,
]{biblatex}
\renewcommand*{\labelalphaothers}{}

\bibliography{references.bib}

\begin{document}
\printbibliography
\end{document}

-
Just go with \DeclareLabelalphaTemplate{ \labelelement{ \field[final]{shorthand} \field{label} \field[strwidth=3,strside=left,ifnames=1,pcompound=true]{labelname} \field[strwidth=1,strside=left,pcompound=true]{labelname} } \labelelement{ \field{year} } } (line breaks not to scale). – moewe Jan 28 at 8:24
I really thought there would be a duplicate on this site, but I couldn't find one, so I went ahead and answered. We have the similar Biblatex alphabetic style like Smith, 2005, but there something else is going on. – moewe Jan 28 at 8:31

As far as I can see you will have to resort to \DeclareLabelalphaTemplate, but that is not too bad.

We can just copy the default from biblatex.def and change \field[strwidth=2,strside=right]{year} to \field{year}

\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field{label}
\field[strwidth=3,strside=left,ifnames=1,pcompound=true]{labelname}
\field[strwidth=1,strside=left,pcompound=true]{labelname}
}
\labelelement{
\field{year}
}
}


and that's it.

MWE

\begin{filecontents}{\jobname.bib}
Title                    = {Direct self control of inverter-fed induction machine, a basis for speed control without speed-measurement},
Author                   = {Baader, U. and Depenbrock, M. and Gierse, Georg},
Booktitle                = {Industry Applications Society Annual Meeting, 1989., Conference Record of the 1989 IEEE},
Year                     = {1989},
Month                    = {Oct},
Pages                    = {486-492 vol.1},
}
\end{filecontents}

\documentclass{article}

\usepackage[style=alphabetic,%
backend=biber,
maxnames=99,
maxalphanames=1,
backref=true,
doi=false,isbn=false,url=false,
backref=false,
]{biblatex}
\renewcommand*{\labelalphaothers}{}

\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field{label}
\field[strwidth=3,strside=left,ifnames=1,pcompound=true]{labelname}
\field[strwidth=1,strside=left,pcompound=true]{labelname}
}
\labelelement{
\field{year}
}
}

\begin{document}

What does pcompound = true do? It is undefined und throws and error. Leaving that out everyhting seems to work. – thewaywewalk Jan 28 at 9:09
@thewaywewalk pcompound is a new option that was introduced in biblatex 3.2. It is the compound equivalent for name prefixes. It was implemented because of LNI/alpha style at BibLaTeX with the usage of multiple “von” parts. Either make an update of biblatex and Biber, or just drop the pcompound=true. – moewe Jan 28 at 10:08