3

Here is the Springer Nature template. I can't add multiple references in this format: [1-4]; instead it is adding references as [1,2,3,4]. Here is my reference code.

\cite{de_florio_physics-informed_2022,de_florio_physics-informed_2022-1,aliakbari_predicting_2022,abueidda_enhanced_2022}

and here is the output.

enter image description here

If I include \usepackage{cite} I get lots of errors in the document.

ADDING ADDITIONAL INFORMATION:

I am adding the whole preamble.

\documentclass[pdflatex,sn-basic]{sn-jnl}
\usepackage{array}
\usepackage{float}
\usepackage{xcolor}
\usepackage{subfig}
\jyear{2022}%
\theoremstyle{thmstyleone}%
\newtheorem{theorem}{Theorem}%  meant for continuous numbers
\newtheorem{proposition}[theorem]{Proposition}% 

\theoremstyle{thmstyletwo}%
\newtheorem{example}{Example}%
\newtheorem{remark}{Remark}%

\theoremstyle{thmstylethree}%
\newtheorem{definition}{Definition}%
\providecommand{\tabularnewline}{\\}
\raggedbottom

I didn't modify anything in sn-basic.bst

4
  • Please tell us which document class options you employ.
    – Mico
    Commented Aug 21, 2022 at 16:25
  • 1
    its \documentclass[pdflatex,sn-basic]{sn-jnl} Commented Aug 21, 2022 at 16:30
  • Umm, the sn-basic class option tells LaTeX to load the natbib citation management package with the authoryear option, which tells LaTeX to generate authoryear-style citation call-outs. Put differently, with the sn-basic option in effect, there's no way LaTeX will generate numeric-style citation call-outs unless your document contains some code -- about which you have so far not revealed any details -- that overrides the defaults and institutes numeric-style citation call-outs instead. Please do share these essential details with us. The macro name to look for may be \setcitestyle.
    – Mico
    Commented Aug 21, 2022 at 16:49
  • Hi I have added the preamble. I could find \setcitestyle in the main tex file or in the sn-basic.bst file. Commented Aug 21, 2022 at 17:05

1 Answer 1

3

The code you've shown in your query does not generate numeric-style citation call-outs. Instead, it generates authoryear-style citation call-outs. I can only surmise that your document contains additional code -- possibly invoking the macros \setcitestyle and/or \biboptions. Not being blessed (cursed??) with any usable psychic divination powers, I can't and won't speculate on what this additional code may be.

What I do know, though, is that if you (a) specify sort&compress as an additional document class option and (b) add the directive

\setcitestyle{numbers,square,citesep={,}} 

in the preamble, your document will generate sorted and compressed numeric-style citation call-outs.


enter image description here

\documentclass[pdflatex,sn-basic,sort&compress]{sn-jnl} %% 'sort&compress' is new 

%% create a sample bib file with four dummy entries:
\begin{filecontents}[overwrite]{mybib.bib}
@misc{de_florio_physics-informed_2022,author={A},title={Eee},year=3001} 
@misc{de_florio_physics-informed_2022-1,author={B},title={Fff},year=3002} 
@misc{aliakbari_predicting_2022,author={C},title={Ggg},year=3003} 
@misc{abueidda_enhanced_2022,author={D},title={Hhh},year=3004} 
\end{filecontents}

\usepackage{array}
\usepackage{float}
\usepackage{xcolor}
\usepackage{subfig}
\jyear{2022}%
\theoremstyle{thmstyleone}%
\newtheorem{theorem}{Theorem}%  meant for continuous numbers
\newtheorem{proposition}[theorem]{Proposition}% 

\theoremstyle{thmstyletwo}%
\newtheorem{example}{Example}%
\newtheorem{remark}{Remark}%

\theoremstyle{thmstylethree}%
\newtheorem{definition}{Definition}%
\providecommand{\tabularnewline}{\\}
\raggedbottom

\setcitestyle{numbers,square,citesep={,}} %% <-- new

\begin{document}
\noindent
\cite{de_florio_physics-informed_2022,
       aliakbari_predicting_2022,
       de_florio_physics-informed_2022-1,
       abueidda_enhanced_2022}
\bibliography{mybib}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .