Text FormattingQuestion about \cite

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
pixinot
Posts: 1
Joined: Fri Oct 15, 2021 7:33 pm

Question about \cite

Post by pixinot »

When using \cite{link1, link2, link3 etc} in my article, the output is [1,2,3], although it should be [1-3]. Can you tell me what is wrong in my code?
I use bibtex, and there is a sample of my code:

Code: Select all

\documentclass[a4paper,fleqn]{cas-dc}
\usepackage[numbers]{natbib}
\bibliographystyle{elsarticle-num}
\begin{document}
\section{Introduction}
Text text text \cite{Askari2015, Song2017705, EbrahimiKhabbazi201335}.
\bibliography{cas-refs}
\end{document}
Last edited by Stefan Kottwitz on Sat Oct 16, 2021 9:04 am, edited 2 times in total.
Reason: Code marked

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Question about \cite

Post by Bartman »

Please try to provide a Infominimal working example and mark your code as code.

The natbib package offers other options besides numbers, which are listed and described in its manual, e.g. those to compress multiple numerical citations if possible.
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Question about \cite

Post by kaiserkarl13 »

You need to add the "sort&compress" option to natbib.
Post Reply