Malak
Malak

Reputation: 35

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}

Upvotes: 0

Views: 2510

Answers (1)

  • cite{1,3} should be \cite{1,2,3}
  • the \bibitems need to be inside the thebibliography environment
  • you should load hyperref after the other packages
  • you should replace widest-label with the widest label, e.g. a single digit number like 3 in your example.
  • two letter font commands like \bf should not be used
  • as the class internally uses the natbib package, you can use the sort&compress bib option:
\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

Upvotes: 2

Related Questions