# How to cite multiple references within a single pair of brackets?

I was using a style file(.bst) from IEEE. When I cited multiple references like:

\cite{ref1, ref2,ref3}


I expected to get [1,2,3] or [1-3], however I got [1],[2],[3]. I am wondering if there is something wrong with my style file, if there is, how can I fix it to get all citations in one pair of brackets?

thanks for help!

• The output is the correct format according to the IEEE specifications/style – Guido May 28 '20 at 8:50
• Welcome to TeX SX! It should be possible with biblatex, which has a biblatex-ieee module. – Bernard May 28 '20 at 8:51
• @Bernard But the style there also deliberately adds brackets to each number: that#s the IEEE citation style – Joseph Wright May 28 '20 at 10:48
• @JosephWright: I agree, but my point of view is that it is easier to modify with biblatex than modifying a .bst file (except for specialists, of course…). – Bernard May 28 '20 at 12:40

Use the option compress when loading natbib package. By default, IEEE and most journals that use numerical citation specify that all citations must be numbered in the order of their appearance in your paper. Thus, you may want to include the option sort as well

\usepackage[sort&compress, numbers]{natbib}

\begin{filecontents*}{sample.bib}
@article{aldaoudeyeh2016,
title={{Photovoltaic-battery scheme to enhance PV array characteristics in partial shading conditions}},
author={Aldaoudeyeh, Al-Motasem I},
journal={IET Renewable Power Generation},
volume={10},
number={1},
pages={108--115},
year={2016},
publisher={IET}
}
@ARTICLE{wu2017,
title={{Assessing Impact of Renewable Energy Integration on System Strength Using Site-Dependent Short Circuit Ratio}},
author={Wu, Di and Li, Gangan and Javadi, Milad and Malyscheff, Alexander M and Hong, Mingguo and Jiang, John Ning},
journal={IEEE Transactions on Sustainable Energy},
year={2017},
publisher={IEEE}
}
@article{wu2019,
title={A method to identify weak points of interconnection of renewable energy resources},
author={Wu, Di and Aldaoudeyeh, Al Motasem and Javadi, Milad and Ma, Feng and Tan, Jin and Jiang, John N and others},
journal={International Journal of Electrical Power \& Energy Systems},
volume={110},
pages={72--82},
year={2019},
publisher={Elsevier}
}
\end{filecontents*}

\documentclass[]{IEEEtran}

\usepackage[x11names]{xcolor}

\usepackage[sort&compress, numbers]{natbib}

\usepackage{hyperref}

\begin{document}

\cite{aldaoudeyeh2016,wu2019,wu2017}

\newpage
\bibliographystyle{IEEEtran}
\bibliography{sample}

\end{document}