简体   繁体   中英

How do I cite range of references using latex and bibtex

Hello Suppose I have 3 references that goes one after another ie [1][2][3].

But I want to see [1]-[3].

What should I do.

Thank you.

There are ways to change how bibtex formats your citations. One way is to use the cite package. Another is the natbib package perhaps with the sort&compress option (ie, \\usepackage[sort&compress]{natbib}). Many publications also have their own styles that will accomplish this, I often use the revtex styles even when not writing for APS journals since they work quite well. Try some of these to see if they help.

If you put more than one tag in your \\cite command, such as:

\cite{pugh1, pugh2, barneymcgrew}

these will be listed together within the same square brackets, and look something like [1,4,9] in the final document. If some or all of the references which you cite turn out to have sequential numbers, this will be indicated in the document something like [1,3-6,8-9] and so on.

Note that the way in which you sort your bibliography will make a difference to this: if you choose to list items in the order in which they are first cited in the text, this will largely happen naturally. However, if you sort your bibliography by, say, author's name, your references are much less likely to be consecutive.

If you're using biblatex, you can use the numeric-comp style (see Section 3.3.1 of the documentation)

\usepackage[style=numeric-comp]{biblatex}

This will sort (and compress) the numbers inside the citation [8, 3, 1, 7, 2] , becomes [1–3, 7, 8]

Additionally, if you want the citations to be numbered in the order they appear in the text, you can specify no sorting to biblatex with

\usepackage[style=numeric-comp, sorting=none]{biblatex}

So if the above example was the first citation in the text, it would become [1–5]

Using \\cite package would probably resolve your problem. You could add either of the following lines to your code:

\usepackage{cite}
\usepackage[noadjust]{cite}
\usepackage{cite} 
...
\bibliographystyle{unsrt} 

worked well for me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM