11

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?

  • 3
    \usepackage[numbers]{natbib}...? – Werner Feb 20 '16 at 00:04
  • No, I used '\usepackage[round]{natbib}' – Bartłomiej Stępień Feb 20 '16 at 00: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 00:29
  • 2
    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 00:47
  • 3
    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 03:10
  • @cfr I think all that is needed for the OP is just to sequentially number the alphabetically arranged author/year bibliography items. This is easy to do with biblatex; not so simple with natbib. See How to get a numbered alphabetical bibliography with (author,year) citations for an example using biblatex. And an even simpler version here: Adding numbers to Author Year citations in list of references – Alan Munn Feb 20 '16 at 04:35
  • @AlanMunn Why? Doesn't that just confuse people? If I look at a list of references, I expect the first thing to be a label and not just an ornamental addition. What's the purpose of numbering them? (Other than to satisfy the publisher, I mean.) – cfr Feb 20 '16 at 23:13
  • @cfr I don't find it inherently confusing, since the alphabetization is also so obvious. I'm not defending the practice, just that I don't find it so obviously senseless. I think your intuition is skewed by the latex referencing systems (numeric vs. author year) so that you always think that the numbers must correspond to those in the text. :) – Alan Munn Feb 20 '16 at 23:15
  • @AlanMunn No. My intuitions are skewed by the fact that using numbers as labels is virtually unknown in my discipline ;). I've never written a document using the numeric system (except MWEs). Footnote or endnote references are probably most popular, with author-year increasingly so. The former involve numbers, of course, but they label notes rather than sources and the number sequence isn't specific to the references. (I read psychology papers, too, where numeric is more common. But I'm on alien territory there, albeit a relatively familiar planet.) – cfr Feb 20 '16 at 23:43

1 Answers1

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}

output of code

Alan Munn
  • 218,180
  • @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: https://tex.stackexchange.com/questions/51434/biblatex-citation-order – vineeshvs Feb 27 '20 at 08:28