有人能解释为什么下面的代码中的sort&compress不起作用吗?解决方案是什么?
\documentclass[final,3p,times,10pt]{elsarticle}
\usepackage[centertags]{amsmath}
\usepackage{amsfonts,amssymb,amsthm,mathtools,epstopdf,newlfont,graphicx,subfigure,booktabs}
\PassOptionsToPackage{sort&compress}{natbib}
\usepackage[colorlinks=true]{hyperref}
%
\begin{document}
%
\section{*}
bla bla bla \cite{carnicer2010weighted,wang2010rational,bos2013bounding}.
\bibliographystyle{model1-num-names}
\bibliography{Bib}
\end{document}
您可以使用以下参考书目:
@article{carnicer2010weighted,
title={Weighted interpolation for equidistant nodes},
author={Carnicer, Jesus M},
journal={Numerical Algorithms},
volume={55},
number={2},
pages={223--232},
year={2010},
publisher={Springer}
}
@article{wang2010rational,
title={A rational interpolation scheme with superpolynomial rate of convergence},
author={Wang, Qiqi and Moin, Parviz and Iaccarino, Gianluca},
journal={SIAM Journal on Numerical Analysis},
volume={47},
number={6},
pages={4073--4097},
year={2010},
publisher={SIAM}
}
@article{bos2013bounding,
title={Bounding the {L}ebesgue constant for {B}errut’s rational interpolant at general nodes},
author={Bos, Len and De Marchi, Stefano and Hormann, Kai and Sidon, Jean},
journal={Journal of Approximation Theory},
volume={169},
pages={7--22},
year={2013},
publisher={Elsevier}
}
The updated code is as follows:
\listfiles
\PassOptionsToPackage{numbers,sort&compress}{natbib}
\documentclass[final,3p,times,10pt]{elsarticle}
\usepackage[centertags]{amsmath}
\usepackage{amsfonts,amssymb,amsthm,mathtools,epstopdf,newlfont,graphicx,subfigure,booktabs}
\usepackage[colorlinks=true]{hyperref}
%
\begin{document}
%
\section{*}
bla bla bla \cite{carnicer2010weighted,wang2010rational,bos2013bounding}.
\bibliographystyle{model1-num-names}
\bibliography{Bib}
\end{document}
答案1
elsarticle
自动加载,natbib
因此您放置的
\PassOptionsToPackage{sort&compress}{natbib}
已经太晚了,此时包裹已经装载好了。
如果你把它移到上面\documentclass
,那么它就可以工作了
\PassOptionsToPackage{sort&compress}{natbib}
\documentclass[final,3p,times,10pt]{elsarticle}
或者(正如@leandriis 提到的)你也可以将其作为类选项传递
\documentclass[final,3p,times,10pt,sort&compress]{elsarticle}
也有效