[Tex/LaTex] How to get references with numbers in author-year style with biblatex

biblatextexshop

I am using TeXShop as my editor, and author-year style for the bibliography. The references appear just fine but with a problem, they are not numbered. I would like to get numbered references with the same style as I have right now, i.e. author-year.

The script I have is given below:-

\usepackage[style=authoryear, backend=bibtex]{biblatex}
\addbibresource{references.bib}
\DeclareNameAlias{sortname}{family-given}

\begin{document}
 % other things in between
\printbibliography
\end{document}

Being new to using LaTeX and biblatex etc., I would prefer a simple solution which can get my references numbered without doing much tweaking about. I only want the numbering at the end of the document i.e Bibliography, not in-text citations.

Best Answer

If the numbers are not going to be used as references in the text they serve no real purpose in the bibliography and are useless and superfluous.

In fact I would argue that the numbers can make it harder to navigate the bibliography because take away attention from the important bits of the entry, namely the author name and year.

Compare

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\DeclareNameAlias{sortname}{family-given}

\defbibenvironment{bibliography}
  {\begin{enumerate}}
  {\end{enumerate}}
  {\item}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,worman,nussbaum,geer}
\printbibliography
\end{document}

Numbered author-year bibliography

(as found in Biblatex enumerating sorted bibliography (using authoryear-ibid style))

to the standard

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\DeclareNameAlias{sortname}{family-given}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,worman,nussbaum,geer}
\printbibliography
\end{document}

Unnumbered author-year bibliography

The names of the authors, which determine the sorting, are much more prominent here, making it easier to navigate a longer bibliography.


The solution above naively just uses enumerate and does not expose the numbers for use in citations or elsewhere. With code similar to How to add citation number to bibliography when using bibstyle=authoryear and justification issue (I just copied the relevant code from numeric.bbx) you can let biblatex take care of the numbering, which means that is part of the entry data and can be used in citations directly.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, labelnumber, backend=biber]{biblatex}

\DeclareNameAlias{sortname}{family-given}

\DeclareFieldFormat{labelnumberwidth}{#1.}
\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
        \printfield{labelprefix}%
        \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,worman,nussbaum,geer}
\printbibliography
\end{document}

Another numbered bibliography


Conversely, it is possible to combine a full numeric citation style with the layout of the author-year bibliography. See Combining style numeric with style authoryear in BibLaTeX.

Related Question