事实上,我之前已经查看过一篇关于引用论文范围(使用数字键)的帖子。问题是,当我想按照示例操作时,出现了错误,提示包 natbib 选项冲突。这是我的代码:
\documentclass[preprint,12pt,3p]{elsarticle}
\usepackage[numbers,sort&compress]{natbib}
\begin{document}
\title{Sample article to present \texttt{elsarticle} class\tnoteref{label0}}
\tnotetext[label0]{This is only an example}
\section{Introduction}
BLA BLA BLA \cite{ref1, ref2, ref3, ref4}
\bibliographystyle{unsrtnat}
\bibliography{sample}
\end{document}
答案1
运行你的代码,我们发现.log
The package natbib has already been loaded with options: [numbers] There has now been an attempt to load it with options [numbers,sort&compress] Adding the global options: numbers,numbers,sort&compress to your \documentclass declaration may fix this.
因此,第一次尝试修复的是:
- 删除
\usepackage[numbers,sort&compress]{natbib}
将选项传递给类
\documentclass[preprint,12pt,3p,numbers,sort,compress]{elsarticle}