Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using BibTeX to manage my bibliography, and have about 250 references. I cannot keep track of the order they were cited in, which leads to some funny formatting. To explain, consider this scenario...

The first citation goes like this \cite[ref1, ref2, ref3], and results in an in-text citation of "[1,2,3]", and also in a bibliography entry of:

  1. Ref 1 details
  2. Ref 2 details
  3. Ref 3 details

All normal so far. The difficulty occurs when I cite these again, but 'out of order', i.e., \cite[ref3, ref2]. This results in an in-text citation of "[3,2]". That looks very odd. What I'd like to do is tell LaTeX/BibTeX that order doesn't matter, and for it to automatically make the second citation appear in-text as "[2,3]".

It seems like a petty request in this fake example, but for a full 'book' with over 250 references that are named by authors rather than numbers, there's no way I can do this ordering manually, particularly as references get added or deleted with revisions.

I've tried adding in the command \usepackage[sort&compress]{natbib}, but it came up with this error:

! Package natbib Error: Bibliography not compatible with author-year citations. (natbib) l.287 ...and\NAT@force@numbers{}\NAT@force@numbers ?

EDIT: Never mind, problem solved, it was as simple as adding \usepackage{cite}. Admins, feel free to delete this question.

share|improve this question
    
EDIT: Never mind, problem solved, it was as simple as adding \usepackage{cite}. Admins, feel free to delete this question. –  Max Sep 22 '11 at 14:12
add comment

closed as too localized by Marco Daniel, lockstep, Joseph Wright Sep 22 '11 at 17:03

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

\usepackage{cite}

This package works with the standard \cite command and does sorting and compressing.

In order to use natbib, one has also to choose a compatible bibliography style, such as plainnat.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.