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}
Thanks so much… I was almost desperate ….
thanks!! helps a lot with my dissertation!
You are the man!
Which style did you use? I tried with unsrt, it did not work.
touché!
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??
This doesn’t seem to always work, can you put an example file for testing?
Thanks.
Hi Methew,
You are right. Check out my other post on Natbib.
Cheers,
Tom
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]
hi all
it also works for [1-4] 🙂
Hello
You are a life saver
thank you
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
Try \renewcommand{\bibfont}{\footnotesize}
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
Thank you so much, just saved me so much time – submission two days away!
thank you!
Thanks a lot, this info is surprisingly hard to find.. well, if it weren’t for the google result with this blog entry 🙂
Thanks a lot!
🙂
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.
Save me a lot of time…Thanks!
Great! Thank you so much.
Thank you, I _love_ summaries like yours, short and precise. 🙂
Thank you!!! You saved me a lot of browsing the web!
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…
I agree with Ben;
\usepackage{cite}
solved the problem for me.It’s easier just to type
\usepackage{cite}
… natbib-package didn’t work for me 🙁This has bugged me since I first began using LaTeX. Thank you for scratching that itch!
Finally found it here! Thanks!
Thank you soo much! I expected hours of google’ing and going down hundreds of levels in threads.
You are a life-saver
Thank you, saved me a lot of time, you’re awesome!
Hey, I like you’re bloq and you’re content is valuable, keep on blogging
Thanks for the generous post! Saved me a lot of work!
cool!
thanks, worked for me after including
\usepackage{cite}
.Arun
Thanks a lot. I love you
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.
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
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.
That’s it. Thank you tom.
AA
Thank you! Funny how sometimes the solution is quite simple, but we don’t think of it/know it.
thanks alot for help
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?
Hi Mike,
Just change the page numbering within your text where required:
Available styles include:
arabic, roman, Roman, alph and Alph
.Cheers, Tom.
Hi Tom,
I just did that and it worked perfectly! many thanks
cheers!
Mike
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 […]
Thank you …
thank you very much. I tried 100 type but this is working. thanks
You are welcome!
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.
Thanks for your comment. Great to know this was of help. Tom.
Thanks a lot Dear Tom. It was really helpful
In report class cite package is not working… it showing error..:(
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
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.
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
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
Try deleting all meta and output files (aux, blg, bbl, etc.) and rerun
latex
,bibtex
,latex
(2x). That should fix it.Cheers, Tom
I need this refernce multiple refernce style in Mendeley. Any one who can help, i will be thankfull.
Thank you so much (Y)
Thank you so much!
Thank you so much! I was searching through countless pages trying to figure this out, and finally found the solution here. I really appreciate it!