# How to get references with numbers in author-year style with biblatex?

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}
\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.

• Why do you want numbers at the end if you are never going to use them? They are only going to take away attention from the author and year and create confusion. – moewe Jan 18 at 14:58

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}

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


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}

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


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}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}