I created my bibliography style (author-year) in "custom-bib" using natbib. References are generated using bibtex and sorted alphabetically. Publisher wants to, they were still numbered from 1 to n.

I have a qestion: How to add numbering of references without changing the style of the citation from 'author-year' to a numbered?

• \usepackage[numbers]{natbib}...? – Werner Feb 20 '16 at 0:04
• No, I used '\usepackage[round]{natbib}' – Bartłomiej Stępień Feb 20 '16 at 0:17
• No, I used \usepackage[round]{natbib}. When I used \usepackage[numbers]{natbib} the citations in the text are changed to numbers, wheras references are OK. However I wants 'author-year' citations in the text. – Bartłomiej Stępień Feb 20 '16 at 0:29
• Can you supply the community with your (custom) .bst and a minimal working example (MWE) that replicates the current behaiour? It would help greatly trying to solve your problem. – Werner Feb 20 '16 at 0:47
• This makes no sense. How are readers to find things in the bibliography if the labels you cite them by are not the labels labelling them in the bibliography? The whole point is for the labels to match. Whichever labelling system you use, they are labels. They are not just for decorative effect. It is the equivalent of continuing to refer to everyone by name, but labelling their numbers in the telephone directory with numbers. How would you find John's phone number if you know him as 'John' but the telephone directory labels his phone number as '58'? – cfr Feb 20 '16 at 3:10

The following code seems to do what you are looking for. Since you're using a your own .bst file, you'd need to change that in the example and replace the demo .bib files with your own. It's much easier to do this with biblatex (see Adding numbers to Author Year citations in list of references for an example.)

\documentclass{article}
\usepackage{etoolbox}
\usepackage{natbib}
\usepackage{hyperref,url}
\newcounter{bibcount}
\makeatletter
\patchcmd{\@lbibitem}{\item[}{\item[\hfil\stepcounter{bibcount}{\thebibcount.}}{}{}
\setlength{\bibhang}{2\parindent}
\renewcommand\NAT@bibsetup%
[1]{\setlength{\leftmargin}{\bibhang}\setlength{\itemindent}{-\parindent}%
\setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}}
\makeatother
\bibliographystyle{agsm}
\begin{document}
\cite{*}
\bibliography{%
/usr/local/texlive/2015/texmf-dist/doc/latex/latex-bib-ex/articles,/usr/local/texlive/2015/texmf-dist/doc/latex/latex-bib-ex/books}
\end{document}


• @Alan Munn, Thank you very much for your answer. It works! – Bartłomiej Stępień Feb 20 '16 at 22:33
• Useful one if you want to number the references in the order they are cited. Useful for IEEE journals. \usepackage[numbers]{natbib} \usepackage[english]{babel} \usepackage[ %backend=biber, natbib=true, style=numeric, sorting=none ]{biblatex}  Ref: tex.stackexchange.com/questions/51434/biblatex-citation-order – vineeshvs Feb 27 '20 at 8:28