[Tex/LaTex] How to get a numbered alphabetical bibliography with (author,year) citations

bibliographiesbibtex

I'm sure variations of this question have been asked dozens of times, but I couldnt find anything specific to my case.

I want a bibliogrpahy format which will accomplish these 4 goals:

  1. get the citations in (Author,year) format
  2. get a numbered bibliography
  3. get the bibliography in alphabetical order.
  4. use the natbib package, if possible

I have not seen any solution which can do these 3 things together.

Best Answer

The following solution uses biblatex:

\documentclass{article}
\usepackage[
    natbib=true,
    style=authoryear,
    labelnumber,
    ]{biblatex}
\addbibresource{references.bib}
\DeclareFieldFormat{labelnumberwidth}{[#1]}
\defbibenvironment{bibliography}  % from numeric.bbx
  {\list
    {\printtext[labelnumberwidth]{%
      \printfield{prefixnumber}%
      \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}

\begin{filecontents}{references.bib}
@article{Smith:01,
  author = {Smith, John},
  year = {2001},
  title = {Article title},
  journal = {Journal title}, 
  volume = {13},
  pages = {1--2}
}

@book{Mueller:02,
  author = {M{\"u}ller, Hans},
  year = {2002},
  title = {Book title},
  publisher = {Publisher},
  address = {Address}
}
\end{filecontents}

\begin{document}
\cite{Smith:01}, \cite{Mueller:02} 

\printbibliography 

\end{document}

enter image description here

Edit: Of course, if you're happy with the standard numeric style, there is an even simpler solution with biblatex, because one can make the difference between citestyle and bibstyle.

\documentclass{article}
\usepackage[
    natbib=true,
    citestyle=authoryear,
    bibstyle=numeric,
    ]{biblatex}
\addbibresource{references.bib}

\begin{filecontents}{references.bib}
@article{Smith:01,
  author = {Smith, John},
  year = {2001},
  title = {Article title},
  journal = {Journal title}, 
  volume = {13},
  pages = {1--2}
}

@book{Mueller:02,
  author = {M{\"u}ller, Hans},
  year = {2002},
  title = {Book title},
  publisher = {Publisher},
  address = {Address}
}
\end{filecontents}

\begin{document}
\cite{Smith:01}, \cite{Mueller:02} 
\printbibliography 
\end{document}
Related Question