because LaTeX matters

Natbib: Multiple reference citation

Natbib is a reimplementation of the \cite command, providing both, author-year and numerical citations.You can get the distribution as well as the documentation from CTAN.Apparently, my previous post on this topic was not providing sufficient information in order to automatically create lists for multiple citations, e.g. [1,2,3, 5] -> [1-3, 5].Here is how it definitely works using “natbib”: First you include the package into your document with whatever options you prefer:

\usepackage[square, comma, sort&compress]{natbib}

Here, “sort&compress” provides the effect we are looking for, i.e. comma separation and hyphenation of multiple citations. By default, natbib uses round parentheses and colons, hence I changed them to square brackets and commas.Use

\citet{wikiEn}

for textual and

\citep{wikiEn}

for parenthetical citation, instead of \cite. The following example shows how Natbib replaces more than two consecutive citations by a hypen:

My apologies, I got something wrong here in the first place. Natbib is not a bibliography-style, but a package providing author-year and numerical citation. Natbib is supported by the following three styles:

plainnat.bst, abbrvnat.bst and unsrtnat.bst

which replace the standard bst-files.

(Source: http://merkel.zoneo.net/Latex/natbib.php)

Update

The code above doesn’t seem to work any longer. Here is the same code where natbib was replaced by cite (package documentation):

Like this:

Related

36 Comments

Thanks for the good info, this really helps. One thing that your posting does not cover though, and neither does any other site that I’ve found about natbib, is how to set page numbers for multiple citations.

What I mean is that sometimes it’s needed to have the citation like this: [2, p. 15 ; 4, p 181]

I am not experienced enough with LaTex to provide a work-around for this. If you have a clue on how to do this, please add it to your blog. Appreciate it. Thanks.

For some reason in my environment the natbib didn’t seem to have a command \citenum. All I got was an undefined control sequence error. But when I downloaded the natbib.sty and included in the directory where my tex files are, it is working.

Thank you for this post. I found that after adding \usepackage[square, comma, sort&compress]{natbib}, I got the error “! Package natbib Error: Bibliography not compatible with author-year citations.” After searching on another forum (http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2009-03/msg00162.html) I found that the solution is to add the option “numbers” to your \usepackage command above; i.e. \usepackage[square, comma, sort&compress, numbers]{natbib}. Just thought I’d add this in case anyone else is experiencing the same difficulty.

I have this problem: I renewed my pc and I installed MikTeX and TexMaker (the same programs I used before). However, when I try to run LaTeX an error message for the bibliography appears: “empty journal” or “empty booktitle” or “empty year” or “empty title”, something that did not happen before when I wrote an article (or any other reference) in the bilbiography without those details. I did not change anything from the previous version of my document.

I am using natbib package. Can you help me please? I have been trying to figure out what is happenning but I haven´t been able to understand the problem. I updated the LaTeX version using MikTex maintenance but nothing works so far.

These error messages mean that some required field is missing in the bib entry. The error probably also tells you the identifier of the bib entry where the problem was encountered. You can find a list of required fields for the different entry types (article, book, conference, etc.) here.