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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

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

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.
http://tex.stackexchange.com/questions/24456/i-would-like-to-borrow-revtexs-amazing-footnote-and-bibtex-macros
tex.stackexchange.com
crawl=CC-MAIN-2016-07
89090
application/http; msgtype=response
sha1:2ANY7BUHOHOXHVVLPF32EAPHPZLYDBJZ
<urn:uuid:54ffea3a-a421-43e4-95a2-5e65ea0d0a06>
2016-02-06T03:16:19Z
104.16.119.182
sha1:HPITMCDEVKW4OSYM46E54F4MNR6WZONH
<urn:uuid:cbe49f05-572c-42e0-b681-24ec6f2fcbd6>
http://tex.stackexchange.com/questions/24456/i-would-like-to-borrow-revtexs-amazing-footnote-and-bibtex-macros
response
<urn:uuid:8568894d-b776-4e2b-966c-930504d98fb9>
robots: classic
hostname: ip-10-236-182-209.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2016-07
operator: CommonCrawl Admin
description: Wide crawl of the web for February 2016
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf