11

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}}
18

(Answer modified after the OP provided additional, crucial information about the document's setup.)

Since you're using the elsarticle document class, which loads the natbib citation management package, just issue the command

\biboptions{numbers,sort&compress}

in the preamble. This instructs natbib to sort and compress numeric-style citations. (Note that there seems to be a typo in the documentation of the elsarticle document class: The option should be spelled numbers rather than number.)

Perfect!! This command works greatly for elsarticle

  • Thanks for the reply Mico. I checked that cite package already is installed under texlive. However, I got this error when multiple citations are given with the cite command: paragraph ended befor \@citex was complete ? – Rıza Bayoğlu Nov 11 '12 at 13:03
  • @RızaBayoğlu - please augment your question with some code that demonstrates what exactly you're doing. Without such information, it's going to be virtually impossible to come up with a solution. Thanks. – Mico Nov 11 '12 at 13:30
  • \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}} – Rıza Bayoğlu Nov 11 '12 at 13:38
  • I use the command in introduction part of my document in kile: \cite{cristo,taylor,polgar,phillips,speirs,simoes,roberto}. But the names in this command gives numeric refecences which is what I wanted, but not in the way I mentioned in my question. I mean it gives [1,2,3,4,5,6,7]. I hope that information is adequate. @Micho – Rıza Bayoğlu Nov 11 '12 at 13:44
  • 1
    @RızaBayoğlu - Hmm, there seems to be a typo in the documentation for the elsarticle document class: the option should be spelled numbers and not number! I'm updating my answer accordingly. – Mico Nov 11 '12 at 16:15
3

put the command sort&compress in the documentclass options: \documentclass[3p,sort&compress]{elsarticle}

Perfect!! This command works greatly for elsarticle

  • 2
    Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. Your "answer" would be better as a comment on Mico's answer. All you are saying is that option can be passed to the class rather using the \biboptions command. – Andrew Swann Jun 4 '13 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.