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
General ⇒ shorten the citation of continuous numbered reference
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
Load the package with the compress option. Refer to the natbib manual for more information.
Best regards
Thorsten¹
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: shorten the citation of continuous numbered reference
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
/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
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
shorten the citation of continuous numbered reference
The natbib package on your system needs an update.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: shorten the citation of continuous numbered reference
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
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: shorten the citation of continuous numbered reference
Just use the package manager of your LaTeX distribution. The archive on CTAN only contains the sources.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10