latexbibliography

Adding a Multi reference in latex


I'm using the {thebibliography}{widest-label} enviroment and I would like to for the citation to appear like the following output:

code:

cite{1,2}

output:

[1-2]

I tried using a lot of packages but it is giving me errors.

My Code:

 \documentclass[11pt, reqno]{jmcs-t}% cls. for J. Math. Comput. Sci.

\usepackage{amsmath, amsthm, amscd, amsfonts, amssymb, graphicx, color}
\usepackage[backref = true,colorlinks=true]{hyperref}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\usepackage{xparse}

\begin{document}
    \section{Introduction}
Multiple Citation cite{1,3}
\begin{thebibliography}{widest-label}

\end{thebibliography}

\bibitem{1} Author, \textit{Title}, Journal, {\bf 19} (Date), page--page.
\bibitem{2} Author, \textit{Title}, Journal., {\bf 19} (Date), page--page.
\bibitem{3} Author, \textit{Title}, Journal. Math., {\bf 19} (Date), page--page.

\end{document}

Solution

  • \documentclass[11pt, reqno]{jmcs-t}% cls. for J. Math. Comput. Sci.
    \usepackage{amsmath, amsthm, amscd, amsfonts, amssymb, graphicx, color}
    
    \usepackage{caption}
    \usepackage{subcaption}
    \usepackage{float}
    \usepackage{xparse}
    \biboptions{sort&compress}
    \usepackage[backref = true,colorlinks=true]{hyperref}
    
    \begin{document}
        \section{Introduction}
    Multiple Citation \cite{1,2,3}
    \begin{thebibliography}{3}
    \bibitem{1} Author, \textit{Title}, Journal, {\bfseries 19} (Date), page--page.
    \bibitem{2} Author, \textit{Title}, Journal., {\bfseries 19} (Date), page--page.
    \bibitem{3} Author, \textit{Title}, Journal. Math., {\bfseries 19} (Date), page--page.
    \end{thebibliography}
    
    \end{document}
    

    enter image description here