# Customize biblatex alpha labels

I'm facing some problems when customizing the standard alpha label definition of biblatex.

``````\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[strwidth=2,strside=right]{year}
}
}
``````

I'd like to have something like a position depending strwidth definition, e.g. to have strwidth=3 for the first author and strwidth=1 for the remaining authors. Is there a way to do this with biblatex?

As far as I can see after

``````\field[strwidth=1,strside=left,pcompound=true]{labelname}
``````

gets processed the labelname name list is empty, so putting something like

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

does not help.

• As far as I can tell the `labelname` list is never cleared after use, so something like `\DeclareLabelalphaTemplate{ \labelelement{ \field[strwidth=3,names=1]{labelname} } \labelelement{ \field[strwidth=1]{labelname} } \labelelement{ \field[strwidth=2,strside=right]{year} } }` works as expected, but of course it doesn't do what you want. I don't think there is a way yet to say that you only want letters from the \$n\$th to \$m\$th name in the list. If no-one comes along with a solution in due time, this might be worth a feature request for Biber. – moewe Jan 19 '16 at 16:03

This is supported in biblatex 3.3/biber 2.4 (currently in DEV folders on Sourceforge). The "names" option now takes a range rather than just one number. So, you can now specify which names to apply the substring to in a part. There is also support for open-ended ranges with upper bound as either the end of the list of names or the end of the visibility specified by `minalphanames`. I also added an option `noalphaothers` to suppress the `alphaothers` addition for truncated lists. See the PDF doc. Minimally, you can deal with your requirement like this now:

``````\DeclareLabelalphaTemplate{
\labelelement{
\field[strwidth=3,strside=left,names=-1,noalphaothers]{labelname}
}
\labelelement{
\field[strwidth=1,strside=left,names=2-,noalphaothers]{labelname}
}
}
``````
• wow. That was quick! thanks. works as described (even if do not get why one should ever want to use `names=2-` instead of `names=2-+`). btw there are a lot of typos in the corresponding part of the pdf (name -> names,...) – dba Jan 20 '16 at 13:22
• Typo corrected - was documented in a hurry. The "2-" is just to give the option of more explicit labels even though the actual bib is truncated. May be of some use in some circumstances which I can't imagine at the moment. – PLK Jan 20 '16 at 18:10