I have encountered a problem when doing multiple citations using BibTeX and the document class IEEEtran
in Mac OS X (Version 10.6.8). The desired effect is similar to this:
References [1, 2, 3].
with thin spaces in-between. Instead, I get
References [1], [2], [3].
For more details, see the attached example code. I tried the package cite
and it didn't solve the problem. In fact, using cite
(without options) produces this
References [1]-[3]
which is not what I want (I don't want compressed citations, which is a different thing, so this is not a duplicate of this question). The [nocompress]
option of cite
doesn't help either.
This is the example code:
\documentclass[12pt, draftclsnofoot, onecolumn]{IEEEtran}
\usepackage[T1]{fontenc}
%\usepackage{cite}
\begin{document}
\section{Introduction}
References~\cite{ref1, ref2, ref3}.
\bibliography{mybiblio}{}
\bibliographystyle{ieeetr}
\end{document}
And this is the mybiblio.bib
file:
@article{ref1,
Author = {Surname1, N. and Surname2, N. and Surname3, N.},
Journal = {Test},
Number = 0,
Pages = {1-2},
Title = {Reference title},
Volume = 0,
Year = 2016
}
@article{ref2,
Author = {Surname1, N. and Surname2, N.},
Journal = {Test},
Number = 0,
Pages = {1-2},
Title = {Reference2 title},
Volume = 0,
Year = 2016
}
@article{ref3,
Author = {Surname1, N.},
Journal = {Test},
Number = 0,
Pages = {1-2},
Title = {Reference3 title},
Volume = 0,
Year = 2016
}
P.S. I can't use the natbib
package.
Best Answer
IEEEtran
explicitly defines citations to be separated into distinct[1],[2],[3]
rather than the default[1,2,3]
when thecite
package is used by the\def\citepunct{], [}
command which is used bycite
. To over-rule this you can just use\def\citepunct{,}
to produce[1,2,3]
or insert a manual space, i.e. for a small spacing\,
after the comma\def\citepunt{,\,}
produces the following.Produced from
It may be worth noting that
IEEEtran
does the same for the compressed citation by defaulting to\def\citedash{]--[}
producing[1]--[3]
rather than[1--3]
which may be the expected result.