# How to remove square brackets adjacent to the hyphen generated by the package “cite”?

I am using the following packages:

\documentclass[journal]{IEEEtran}

% *** MISC UTILITY PACKAGES ***
\usepackage{graphicx}
\usepackage[caption=false]{subfig}
\usepackage[sort,compress]{cite}
%\usepackage{caption}

% *** MATH PACKAGES ***
\usepackage[cmex10]{amsmath}
\usepackage{amssymb}
\usepackage[mediumspace,mediumqspace,Gray,squaren]{SIunits}
\usepackage[citebordercolor={0 1 0}]{hyperref}

\begin{document}
% paper title
% can use linebreaks \\ within to get better formatting as desired
\title{Fabrication}

\markboth{JOURNAL OF MICROELECTROMECHANICAL SYSTEMS}%
{ \MakeLowercase{\textit{et al.}}: Fabrication, Characterization and Modeling of Fully-Integrated Piston-Type Electrodynamic Microactuators}

% make the title area
\maketitle
\begin{abstract}
%\boldmath
This paper presents
\end{abstract}

\IEEEpeerreviewmaketitle

\section{Introduction}
\IEEEPARstart{E}{lectrodynamic}
harvesters\cite{f11:Kulkarni2008,f11:Sari2008,f11:Wang2009,f11:Zhu2010,f11:Peng2011}.
These devices rely.

\bibliographystyle{IEEEtran}
\bibliography{f11}

\end{document}


After I compile my document I get the following as a part of my resulting .pdf document:

I want to get rid of the square brackets adjacent to the hyphens, e.g. I want "[9-13]" and not "[9]-[13]", which is the how it is right now.

Any suggestions?

-
If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it) –  Caramdir Jul 7 '12 at 1:41
Oh.... I did spend some time trying to get it correct but couldn't. Thanks! –  Shashank Sawant Jul 7 '12 at 1:43
Try two things: first, load the cite package explicitly with the sort and compress options (as well as the nobreak option, if needed): \usepacakge[sort,compress,nobreak]{cite}. Second, be sure to load the hyperref package last. If the problems persist, please augment your code snippets to a full MWE (minimum working example) that duplicates the problem behavior you're encountering. Without such an MWE, it's very difficult (if not impossible) to correctly diagnose and fix the problems. –  Mico Jul 7 '12 at 2:01
I tried it but it didn't work... :( Even after adding nobreak, it didn't work. –  Shashank Sawant Jul 7 '12 at 2:23
The IEEE use the [x]-[y] style, not [x-y], and so the class is deliberately set up to give this output. From your example, I'd assume you are submitting to a journal, in which case altering this here seems like a bad idea. –  Joseph Wright Jul 7 '12 at 6:06

The extra [] pairs are added in here by the IEEEtran class. Luckily, it also provides a mechanism to remove them:

\renewcommand*{\citepunct}{, } % Was {], [}
\renewcommand*{\citedash}{--}  % Was {]--[}


This is documented in the class file only (around line 3100): it does not seem to be in the documentation.

-
Thanks! Actually you might be right about the change being a bad idea... –  Shashank Sawant Jul 7 '12 at 18:54

If you don't absolutely require the use of the cite package, natbib will let you do this and is in general much more flexible than cite.

For example, instead of \usepackage[sort,compress]{cite}, try:

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


Edit: Note that when changing bibtex packages you sometimes have to run latex and bibtex a couple of times each and use 'q' to skip past some errors.

-
there is really & in the package options? –  yo' Jul 7 '12 at 10:59
Yes, there is... –  codebeard Jul 7 '12 at 15:43