[Tex/LaTex] Automatic sorting and compression of a range of numeric-style citation call-outs

bibtexcite-packageciting

Hi All I want to display the following citation call-outs as [1-10] instead of [1-3,3-4,4-7,7-10].

I use the following code

\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage[top=1in, bottom=1.25in, left=0.3in, right=0.3in]{geometry}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{dcolumn}
\usepackage{enumerate}
\renewcommand{\thesection}{\Roman{section}}
\renewcommand{\thesubsection}{\thesection.\Roman{subsection}}
\usepackage{mathrsfs,amsmath}
\usepackage{mathtools}

\usepackage[noadjust,compress]{cite}
\bibliographystyle{unsrt}

\usepackage[section]{placeins}
\usepackage{authblk}

\begin{document}

\cite{xin2011multitaper,wang2009multitaper,al2010multitaper,%
    al2010multitaper,jataprolu2012optimal,chiang2009optimal,%
    yousif2014new,jataprolu2012optimal}

\bibliography{Ref}{}
\bibliographystyle{plain}

\end{document}

Best Answer

The main issue with your code is that two of the entry keys in the \cite instruction are repeated. Eliminate the repeats, and you'll immediately obtain the desired format of the sorted citation call-outs.

By the way, since there are only 6 distinct entry keys in your \cite instruction, the most you can get is [1-6], not [1-10].

Separately, do also make up your mind whether you want to employ the unsrt or the plain bibliography style. (You should have gotten a warning message about this during the BibTeX run.) There can be only one bibliography style in effect in your sample document.

A full MWE (note that I've eliminated all unnecessary instructions from the preamble):

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{Ref.bib}
@misc{xin2011multitaper,   author={X}, title={AA}, year=3001} 
@misc{wang2009multitaper,  author={W}, title={BB}, year=3002} 
@misc{al2010multitaper,    author={A}, title={CC}, year=3003} 
@misc{jataprolu2012optimal,author={J}, title={DD}, year=3004} 
@misc{chiang2009optimal,   author={C}, title={EE}, year=3005} 
@misc{yousif2014new,       author={Y}, title={FF}, year=3006} 
\end{filecontents}

\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage[top=1in, bottom=1.25in,hmargin=0.3in]{geometry}

\usepackage[noadjust]{cite} % 'sort' and 'compress' are enabled by default
\bibliographystyle{unsrt}% or: \bibliographystyle{plain}

\begin{document}

bad: \cite{xin2011multitaper,wang2009multitaper,al2010multitaper,%
        al2010multitaper,jataprolu2012optimal,chiang2009optimal,%
        yousif2014new,jataprolu2012optimal}

good: \cite{xin2011multitaper,wang2009multitaper,
         al2010multitaper,jataprolu2012optimal,
         chiang2009optimal,yousif2014new}

\bibliography{Ref}
\end{document}
Related Question