Displaying in-text citations in a compressed way (e.g. [1-3]) instead of the default one [1]-[3] using cite package inside IEEEtran/journal mode
First the citation issue. Citing from the ieeetran manual
Citations are made with the
\cite
command as usual. IEEEtran will produce citation numbers that are individually bracketed in IEEE style. (“[1], [5]” as opposed to the more common “[1, 5]” form.) The base IEEEtran does not sort or produce compressed “ranges” when there are three or more adjacent citation numbers. However, IEEEtran pre-defines some format control macros to facilitate easy use with Donald Arseneau’scite
package [13]. So, all an author has to do is to call cite package:\usepackage{cite}
and the adjacent citation numbers will automatically be sorted and compressed (ranged) IEEE style. (Of course, multiple adjacent citations should always all be declared within a single
\cite
, comma separated, for this to work.) Invokecite.sty
’snoadjust
option to prevent an unwanted leading space from occurring should a citation ever need to be enclosed in parenthesis.
.......
Note that, if needed (e.g., next to a non-punctuation/nonspace character),
cite.sty
’s\cite
command will automatically add a leading space. i.e., “(\cite{mshell01}
)” will become like “( [1])”. If this behavior is not desired, use thecite
package’snoadjust
option (cite.sty V3.8 and later) which will turn off the added spaces:\usepackage[noadjust]{cite}
However, one should keep in mind that IEEE has an unexplainable what-you-submit-is-NOT-what-you-get type of workflow. I can understand that they might have reasons for that but still, sometimes the changes are too dramatic. Citation style is also affected from that in particular they are probably modified manually by a copy editor. Most often, the missing Oxford commas are added. Moreover, the compressed and uncompressed citations are separated from each other as groups. Some examples from published articles
Long story short, it seems that IEEE does not fully automate their citation style which is context dependent, therefore, for the users simply following the manual is sufficient. A copy editor will fix your article hence there is no need on the user side to tweak the underlying citation mechanism. You don't even need to balance the last page as they will manually insert line breaks to the bibliography items and adjust the spacing accordingly. I think this is also unfair to the author of ieeetran class as I'm sure he can come up with fully automated mechanism had IEEE decided on something concrete as a standard.
\begin{rant}
As it happened to me with siunitx
usage, they actually don't like extra bits, for example don't even think of leaving your TikZ code in, they will be replaced with bitmap images. They also tend to remove TeX modifications (in my case changed all the per-mode=frac
typeset units into hard coded N/m
and I'm not even going into the things that they do to your vector images).
Moreover, they don't allow you to receive the modified TeX file but you annotate the corrected proof PDF result. Hence, you only send your rough idea about the article and they create it for you. That's cutting edge technology right there. It might happen that some people just want to see their hard work in a mildly pleasing format.
The counter argument for this is the idiot academician who can't manage to write a proper minimal LaTeX code but somehow manage to prove things using sophisticated math arguments. Scientific publication is part of the job description of the academician. They are responsible to write proper articles as much as they are responsible for the contribution of their results. The whole IEEE community can not resort back to its weakest link just because some person refuses to read the manual (probably with an all-time classic I don't have time for that nonsense argument invoked; Firm steps towards the fourth Nobel prize ladies and gentlemen step aside!).
So IEEE can send the article back to the author and ask for a better code. Somehow the article payments and extra page charges are fully automated to the smallest detail and the procedure just stops until we pay... a short dramatic silence.... So same care can go into the content too. I'm not asking much; just the 175$ extra page charge for my online article which is probably enriched with BeCu compounds such that the paper size is invariant under all adverse climate changes and remains in its optimal readability conditions for at least 400 hundred more years.
\end{rant}
If you use Natbib, with the sort&compress
option, this feature is 'Easy Peasy Japaneasie'.
This is the preamble command that I use, and it does EXACTLY what you have specified.
\usepackage[numbers,sort&compress,square]{natbib}
Forget \cite{blabla}
, its hopeless, use \citep{blabla}
or \citet{blabla}
or any of the other options as per the following link(s):
http://merkel.zoneo.net/Latex/natbib.php
http://texblog.org/2008/03/17/natbib-multiple-reference-citation/
As you will see, there are a number of items including various alternate commands, things like \citeyear
or \citeauthor
which allows you to really structure your wording exactly how you like.
Cheers.