Generalshorten the citation of continuous numbered reference

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
carol
Posts: 105
Joined: Wed Dec 24, 2008 7:25 pm

shorten the citation of continuous numbered reference

Post by carol »

Hi,
Instead of having a citation like [2,3,4,5,6], how is it possible to shorten the continuous numbered reference to [2-6]?

Also consider a mixed case, a citation like [2,3,4,5,10, 20] that could be [2-5,10,20]. Note that I use \bibliographystyle{unsrt} and \usepackage [sort]{natbib}.

thanks

carol

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

shorten the citation of continuous numbered reference

Post by localghost »

Load the package with the compress option. Refer to the natbib manual for more information.


Best regards
Thorsten¹
carol
Posts: 105
Joined: Wed Dec 24, 2008 7:25 pm

Re: shorten the citation of continuous numbered reference

Post by carol »

It seems that the compress option is in natbib.sty file however, I get the following error message
/usr/share/texmf/tex/latex/natbib/natbib.sty:250:Unknown option `compress' for package `natbib'. \newcommand

I attach the style file
Attachments
natbib.sty
(33.97 KiB) Downloaded 353 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

shorten the citation of continuous numbered reference

Post by localghost »

The natbib package on your system needs an update.
carol
Posts: 105
Joined: Wed Dec 24, 2008 7:25 pm

Re: shorten the citation of continuous numbered reference

Post by carol »

I wanted to update natbib package but the package on ctan website http://www.ctan.org/tex-archive/macros/ ... ib/natbib/ doesn't contain natbib.sty
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: shorten the citation of continuous numbered reference

Post by localghost »

Just use the package manager of your LaTeX distribution. The archive on CTAN only contains the sources.
Post Reply