[Tex/LaTex] Sort by author in Alpha bibliography

biblatexbibtexsorting

Using the alpha bibliography style, citations are sorted by the citation key. I'd like to use the same style of authors-year citation keys (e.g., [CP92]) but have the bibliography sorted by the first author's lastname instead of alphabetically by the citation key itself. This would keep the same papers by the same first author together.

For example, alpha would produce the following sorted order:

  • [Cha81] D. Chaum. Untraceable…
  • [CL04] J. Camenisch and A. Lysyanskaya. Signature…
  • [CP92] D. Chaum and T. Pedersen. Wallet…

Whereas, abbr would produce the following sorted order:

  • [1] J. Camenisch and A. Lysyanskaya. Signature…
  • [2] D. Chaum. Untraceable…
  • [3] D. Chaum and T. Pedersen. Wallet…

I am looking for the same sorting as abbr but maintaining the citation key style of alpha.

Is there a way to achieve this hybrid style?

Best Answer

For users of traditional BibTeX, i.e., without using biblatex: Copy TEXMF/bibtex/bst/base/alpha.bst to a new file alpha-abbrvsort.bst in a place where BibTeX will find it. Open it in an text editor, locate the function presort, and comment the four lines as shown here:

FUNCTION {presort}
{ calc.label
  % sort.label   %% four lines commented out to obtain presort of abbrv.bst
  % "    "       %%
  % *            %%
  type$ "book" =
  type$ "inbook" =
  or
    'author.editor.sort
    { type$ "proceedings" =
    'editor.organization.sort
    { type$ "manual" =
        'author.organization.sort
        'author.sort
      if$
    }
      if$
    }
  if$
  % *            %%
  "    "
  *
  year field.or.null sortify
  *
  "    "
  *
  title field.or.null
  sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
}

Save and close, and use it as normal:

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{PulpSpy.bib}
  @misc{a, author={Chaum, D.}, title = {Untracable ...}, year = {1981}}
  @misc{b, author={Chamenisch, J. and Lysyanskaya, A.}, title={Signature...}, year={2004}}
  @misc{c, author={Chaum, D. and T. Pedersen, T.}, title={Wallet...}, year={1992}}
\end{filecontents}

\begin{document}
\nocite{*}
\bibliographystyle{alpha-abbrvsort}
\bibliography{PulpSpy}
\end{document}

Works:

reference output