BibTeX, biblatex and biberHow to cite like [1-7] instead of [1,2,3,4,5,6,7]?

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
kirpi
Posts: 2
Joined: Tue Jul 07, 2009 5:24 pm

How to cite like [1-7] instead of [1,2,3,4,5,6,7]?

Post by kirpi »

Hi all,

I want modify an existing BST file to change the way that multiple references look.

For example, currently, when I type \cite{ref1,ref2,ref3,ref4,ref5}, the pdf output looks like this: [1,2,3,4,5]. However, I want to have an output like this when there are more than three references: [1-5].

Could you please help me about that?

Thanks in advance

Recommended reading 2024:

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

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

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

How to cite like [1-7] instead of [1,2,3,4,5,6,7]?

Post by josephwright »

The bst file has nothing to do with it. Try

Code: Select all

\usepackage[sort&compress]{cite}
Joseph Wright
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

How to cite like [1-7] instead of [1,2,3,4,5,6,7]?

Post by spiegboy »

josephwright wrote:The bst file has nothing to do with it. Try

Code: Select all

\usepackage[sort&compress]{cite}
should be

Code: Select all

\usepackage[sort&compress]{natbib}
or

Code: Select all

\usepackage{cite}
kirpi
Posts: 2
Joined: Tue Jul 07, 2009 5:24 pm

Re: How to cite like [1-7] instead of [1,2,3,4,5,6,7]?

Post by kirpi »

That's great!

Thank you very much!
Post Reply