Recently, I was wondering how to cite multiple references at once, e.g. [1, 5, 9] or even [1-3, 6, 8]. It took me quite some time to find a solution on the web, which is one of the reasons I am posting this article here.
The solution is astonishingly easy. If you want to cite multiple references within the same brackets, you just need to separate the labels with a comma. In addition, you’ll need to load the cite
package which will automatically check if your labels are part of an ordered list and reduce the list by replacing all the “in-betweens” with a hyphen.
\usepackage{cite} ... \cite{citation1, citation2, citation3}
Here is a minimal working example:
\documentclass{article} \usepackage{cite} \begin{filecontents}{publication.bib} @book{knuth2006art1, title={The art of computer programming: Generating all trees: history of combinatorial generation}, author={Knuth, D.E.}, year={2006}, publisher={Addison-Wesley} } @book{knuth2006art2, title={The art of computer programming: Generating all trees: history of combinatorial generation}, author={Knuth, D.E.}, year={2006}, publisher={Addison-Wesley} } @book{knuth2006art3, title={The art of computer programming: Generating all trees: history of combinatorial generation}, author={Knuth, D.E.}, year={2006}, publisher={Addison-Wesley} } \end{filecontents} \begin{document} Dummy citation \cite{knuth2006art1, knuth2006art2, knuth2006art3} \bibliographystyle{plain} \bibliography{publication} \end{document}
sanam
Thanks so much… I was almost desperate ….
meg
thanks!! helps a lot with my dissertation!
Bill
You are the man!
Kamalesh
Which style did you use? I tried with unsrt, it did not work.
Jaume Barceló Vicens
touché!
sinistrarcobaleno
uhm, I got [1,2,3] instead of [1-3]. Should I put something somewhere to tell bibtex to check the orere of my citations??
Mathew
This doesn’t seem to always work, can you put an example file for testing?
Thanks.
tom
Hi Methew,
You are right. Check out my other post on Natbib.
Cheers,
Tom
ali
Hi all
at first mine didnt work too
but when i added the Natbib to my latex it worked!!!
i dont know what is their relation but it works now
i added the below line in the beginning
and used
and got
[1,2]
i did not test [1-2]
ali
hi all
it also works for [1-4] 🙂
Hassan
Hello
You are a life saver
thank you
Hung La
I already \usepackage[square, comma, sort&compress]{natbib} and get good result [1-10], but the font size of reference section is bigger than other sections. For example in its font size is 11 pt, others are 10pt although I set \documentclass[letterpaper, 10 pt, conference]{ieeetran}. Can someone else help me to out this problem?
Thanks very much
Greg
Try \renewcommand{\bibfont}{\footnotesize}
tom
Hi,
What you can try is the following: After your \usepackage…
\bibfont\small or whatever size of font you are using.
Here is a complete reference of the natbib package:
http://mirror.switch.ch/ftp/mirror/tex/macros/latex/contrib/natbib/natbib.pdf
Hope this works,
Tom
Olivia
Thank you so much, just saved me so much time – submission two days away!
anon
thank you!
allefant
Thanks a lot, this info is surprisingly hard to find.. well, if it weren’t for the google result with this blog entry 🙂
Roozbeh Daneshvar
Thanks a lot!
🙂
mine
Great info thanks. BTW, make sure you don’t leave spaces around the commas. eg – \cite{a,b,c} and not \cite{a, b, c}. The latter breaks for me.
Lu
Save me a lot of time…Thanks!
Chris
Great! Thank you so much.
San
Thank you, I _love_ summaries like yours, short and precise. 🙂
Matic
Thank you!!! You saved me a lot of browsing the web!
Ben
If the comma separation does not work, try to include the “cite”-package.
\include{cite}
It does the trick for me, without using special natbib cite commands…
Roozbeh
I agree with Ben;
\usepackage{cite}
solved the problem for me.Jussi
It’s easier just to type
\usepackage{cite}
… natbib-package didn’t work for me 🙁anon
This has bugged me since I first began using LaTeX. Thank you for scratching that itch!
mlm
Finally found it here! Thanks!
Thomas
Thank you soo much! I expected hours of google’ing and going down hundreds of levels in threads.
You are a life-saver
Mex
Thank you, saved me a lot of time, you’re awesome!
George
Hey, I like you’re bloq and you’re content is valuable, keep on blogging
GC
Thanks for the generous post! Saved me a lot of work!
jonathan
cool!
arun
thanks, worked for me after including
\usepackage{cite}
.Nagaraja
Arun
Thanks a lot. I love you
DecoL
Thank you so much. I was trying to do the same thing and went thru a lot of pages until I found my solution here. Thank you again.
Kaioh
Dear all, can someone please enlight me on this;
If I put the following:
the citations will appear like this:
[1], [2], [3], [4], and with a hyper ref.
If I put the following:
the citations will appear like this:
[1-4], but without hyper ref
This seams a bit stupid, and strange, but I could not find the solution until now. Can someone help me on this, please?
Thank you all,
AA
tom
Hi AA,
I suggest you use the natbib package. The following options should do the trick:
For additional customization you may want to consult this reference sheet.
Best, Tom.
Kaioh
That’s it. Thank you tom.
AA
cysiphist
Thank you! Funny how sometimes the solution is quite simple, but we don’t think of it/know it.
sar
thanks alot for help
Mike
thanks guys, natbib thing didnt work for me, i used \usepackage{cite}. but hey guys, how do i have roman numerals for first pages of my thesis and then arabic numbers for the main body?
tom
Hi Mike,
Just change the page numbering within your text where required:
Available styles include:
arabic, roman, Roman, alph and Alph
.Cheers, Tom.
Mike
Hi Tom,
I just did that and it worked perfectly! many thanks
cheers!
Mike
SS
Thank you …. it works for me … Many thanks
Tips & Troubles with Thesis II « Beleaguered Apprentice
[…] multiple documents in a single set of brackets is darn easy. But to order the citation in increasing sequence of label takes a new package, natbib. Natbib is […]
ypid
Thank you …
eeeee
thank you very much. I tried 100 type but this is working. thanks
tom
You are welcome!
A. Douglas Stone
Thanks a lot – I have been annoyed by the consecutive citations spreading out over entire lines for a while, but never knew how to solve it.
tom
Thanks for your comment. Great to know this was of help. Tom.
Maryam
Thanks a lot Dear Tom. It was really helpful
swaroop
In report class cite package is not working… it showing error..:(
tom
Hi!
I’m almost certain the incompatibility is not with report. Do you use biblatex and biber? You will get automatic compression of citations there. Otherwise, take a look at the log file and please provide a minimal example or at least the error you get. Below is a biblatex example (it requires the publication.bib file from the post above).
HTH,
Tom
B.Dier
hi tom…
I am using
I have a problem of consistency of citations, like [4] [5] [2] [8] [3] etc. How can this be. fixed
thanks.
tom
Hi!
Try using the
unsrtnat
style instead and cite multiple references using the samecite
command (\cite{ref1,ref2,ref3}
). If that doesn’t help, please provide a minimal working example and I’ll be happy to see what’s going on in your code. Finally, I strongly suggest moving to the biblatex package, unless you need backward compatibility.Tom
B.Dier
hi Tom.
I was talking about following:
Input = ~\cite{14}~\cite{16}~\cite{18}~\cite{20}~\cite{30}
Output = [10] [5] [11] [6] [9]
thanks
Bd
tom
Try deleting all meta and output files (aux, blg, bbl, etc.) and rerun
latex
,bibtex
,latex
(2x). That should fix it.Cheers, Tom
Zia Ud Din
I need this refernce multiple refernce style in Mendeley. Any one who can help, i will be thankfull.
Muhammad Salman Khan
Thank you so much (Y)
Pablo Hernández
Thank you so much!