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.

Anybody know how revtex accomplishes its amazing citation handling. For instance, if I have a list of references in natbib using any bibstyle it looks like this [1,2,3,4,5] or [2,4,5,3,1] depending on the order of the \cite{key2,key4,key5,key3,key1}. However in revtex it takes that list, no matter the order and makes it [1-5] even for the \cite command I quote above (assuming they're already referenced).

I am trying to write a thesis which is not compatible with revtex, but I don't want to have to hunt down all my \cites and put them in order manually. Additoinally there is no way to "shorten" the list on first citation by simply doing \cite{ref1}--\cite{ref5} as it would read [1]-[2] if 2,3,4 haven't already been cited.

There must be a way to get the actually superscript reference numbers in order by just "borrowing" one of the revtex packages? Anyone know which one does it? An example from my thesis to illustrate:

Typically this material has been a high-κ dielectric [50,42,51,86,65,63,64].

which I would like to read:

Typically this material has been a high-κ dielectric [42,50,51,63-65,86].

Suggestions???

share|improve this question
    
Did you try the package cite? –  egreg Jul 29 '11 at 23:26
add comment

3 Answers

Revtex loads Patrick Daly's very versatile natbib package for this functionality. You can get the effect you are after with something like

\usepackage[numbers,sort&compress,mcite]{natbib}
share|improve this answer
    
although arthur ogawa is indeed responsible for revtex, the (definitely very versatile) natbib package is the work of patrick daly, also the co-author (with helmut kopka) of the excellent book "guide to latex", now in its fourth edition. –  barbara beeton Jul 30 '11 at 12:07
    
@barbara, of course you are right: I had a mental glitch (and fixed the answer). –  Lev Bishop Jul 30 '11 at 13:23
    
This looks promising I'm going to try adding those options to my natbib thank you for the suggestion. –  bcoss Aug 1 '11 at 15:23
    
Oh snap, that was it! You guys rock, how do you I give kudos for answers. All the suggestions worked! –  bcoss Aug 1 '11 at 15:29
add comment

The cite package provides this functionality - the ability to compress citation lists.

share|improve this answer
    
And (seemingly) superscript cites, too. –  mbork Jul 29 '11 at 23:42
    
I think I have the cite package included already, is there an option I need to include too? –  bcoss Aug 1 '11 at 15:23
    
Oh snap, that was it! You guys rock, how do you I give kudos for answers. All the suggestions worked! –  bcoss Aug 1 '11 at 15:29
add comment

You could also look at the amsrefs package, which also allows to compress cites. And the biblatex package is yet another (powerful) solution to many problems with bibliographies.

share|improve this answer
    
Thank you for the two suggestions. I am sure one of these answers will get the job done. This community is wonderful! Thank you all. –  bcoss Aug 1 '11 at 15:24
    
Oh snap, that was it! You guys rock, how do you I give kudos for answers. All the suggestions worked! –  bcoss Aug 1 '11 at 15:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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