You can edit abbrvnat.bst
to be some sort of a mix between alpha
and abbrv
. Save the resulting file as alphanat.bst
. Note that this is only a proof of concept, it works for the MWE but it may break at any point.
The modifications to abbrvnat.bst
are as follows.
- Copy the function
format.lab.names
(the label formatting function) and a few lines above that, unmodified, to alphanat.bst
and rename the function to format.lab.alphanames
:
INTEGERS { et.al.char.used }
FUNCTION {initialize.et.al.char.used}
{ #0 'et.al.char.used :=
}
EXECUTE {initialize.et.al.char.used}
FUNCTION {format.lab.alphanames}
{ 's :=
s num.names$ 'numnames :=
numnames #1 >
{ numnames #4 >
{ #3 'namesleft := }
{ numnames 'namesleft := }
if$
#1 'nameptr :=
""
{ namesleft #0 > }
{ nameptr numnames =
{ s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ "{\etalchar{+}}" *
#1 'et.al.char.used :=
}
{ s nameptr "{v{}}{l{}}" format.name$ * }
if$
}
{ s nameptr "{v{}}{l{}}" format.name$ * }
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
numnames #4 >
{ "{\etalchar{+}}" *
#1 'et.al.char.used :=
}
'skip$
if$
}
{ s #1 "{v{}}{l{}}" format.name$
duplicate$ text.length$ #2 <
{ pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
'skip$
if$
}
if$
}
- Change the function
author.key.label
to concatenate the output of the regular label formatting, an open parentheses, and the output of the function copied from alpha.bst
:
FUNCTION {author.key.label}
{ author empty$
{ key empty$
{ cite$ #1 #3 substring$ }
'key
if$
}
{ author format.lab.names "(" * author format.lab.alphanames * }
if$
}
- In the comments it was noted that there was an issue with a different
.bib
file, it turned out that the solution did not work for @book
entries. These entries call the function author.editor.key.label
instead of author.key.label
. Therefore that function should be adapted as well, similar to the modification to author.key.label
:
FUNCTION {author.editor.key.label}
{ author empty$
{ editor empty$
{ key empty$
{ cite$ #1 #3 substring$ }
'key
if$
}
{ editor format.lab.names "(" * editor format.lab.alphanames * }
if$
}
{ author format.lab.names "(" * author format.lab.alphanames * }
if$
}
Note that the functions author.key.organization.label
and editor.key.organization.label
should also be modified accordingly for entries where organizations are involved.
- Modify the function
calc.label
in order to remove the parenthesis and to print only the last two digits of the year:
FUNCTION {calc.label}
{ calc.short.authors
short.list
year #-1 #2 substring$ duplicate$ empty$
short.list key field.or.null = or
{ pop$ "" }
'skip$
if$
*
'label :=
}
Finally, load natbib
with the option square
to get square brackets, and load the new alphanat
style:
\documentclass{article}
\usepackage[square]{natbib}
\bibliographystyle{alphanat}
\begin{document}
See \cite{waseem16}.
\bibliography{myrefs}
\end{document}
Result:

Edit: Of course it is nice if the alpha
key is also shown in the bibliography itself. To do that, you should copy a slightly modified version of the format.lab.alphanames
function somewhere above the format.authors
function around line 250 (so the modified function is defined when format.authors
needs it):
FUNCTION {format.lab.anames}
{ 's :=
s num.names$ 'numnames :=
numnames #1 >
{ numnames #4 >
{ #3 'namesleft := }
{ numnames 'namesleft := }
if$
#1 'nameptr :=
""
{ namesleft #0 > }
{ nameptr numnames =
{ s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ "+" * }
{ s nameptr "{v{}}{l{}}" format.name$ * }
if$
}
{ s nameptr "{v{}}{l{}}" format.name$ * }
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
numnames #4 >
{ "+" * }
'skip$
if$
}
{ s #1 "{v{}}{l{}}" format.name$
duplicate$ text.length$ #2 <
{ pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
'skip$
if$
}
if$
}
The difference to format.lab.alphanames
is that the symbol for more than 4 authors (+
) is hardcoded.
Then you can modify format.authors
to use the label and the year:
FUNCTION {format.authors}
{ author empty$
{ "" }
{ "[" author format.lab.anames * year #-1 #2 substring$ * "] " * author format.names * }
if$
}
Result:

Note that this would be much easier with BibLaTeX - but with BibTeX the question is more interesting :)
\PrintBib
come from? Never seen that before. Please provide a full but minimal example instead of a sniplet like this. Basically provide something others can copy and use as is in order to test whatever issue you are having.