In my kile documents, I want to add multiple citations. For this I use the command
\cite{cristo,taylor,polgar,phillips,speirs,simoes,roberto}
The names in this command give numeric references, which is what I wanted, but not in the way I want it. It gives [1,2,3,4,5,6,7]
instead of [1,2,4-8]
. Is there any other way to manage this?
My bibliography style is elsarticle-num
, and I use bibtex
for the bibliography.
I use this preamble in my document:
\documentclass[review,preprint,twocolumn,3p]{elsarticle}
\usepackage{graphicx}
\usepackage{color}
\usepackage{url}
\usepackage{ctable}
\usepackage{booktabs}
\usepackage{cite}
\usepackage{tabularx}
\usepackage{array}
\usepackage{soul}
\usepackage{multirow}
\usepackage{lineno}
\usepackage{subfigure}
\usepackage{amssymb,amsmath}
\newcommand{\tab}{\hspace{5mm}}
Best Answer
(Answer modified after the OP provided additional, crucial information about the document's setup.)
Since you're using the
elsarticle
document class, which loads thenatbib
citation management package, just issue the commandin the preamble. This instructs
natbib
to sort and compress numeric-style citations. (Note that there seems to be a typo in the documentation of theelsarticle
document class: The option should be spellednumbers
rather thannumber
.)Perfect!! This command works greatly for
elsarticle