例子如下:
\begin{filecontents}{\jobname.bib} @article{demo1, title = {Some things {I} did}, author = {Other, A. N.}, journal = {J. Irrep. Res.}, year = {2012}, pages = {x-y} } @article{demo2, title = {Cool!}, author = {Nobacon, D.}, journal = {Ann. Improb. Res.}, year = {2012}, pages = {a-b} } \end{filecontents} \documentclass{article} \usepackage[numbers,sort&compress]{natbib} \usepackage{etoolbox} \makeatletter \patchcmd{\NAT@citexnum} {% \ifx\NAT@last@yr\relax \def@NAT@last@yr{\@citea}% \else \def@NAT@last@yr{--\NAT@penalty}% \fi } {% \def@NAT@last@yr{--\NAT@penalty}% } {}{\FAIL} \makeatother \bibliographystyle{unsrtnat} \begin{document} \cite{demo1,demo2} \bibliography{\jobname} \end{document}
有兴趣的话可以自行编译。Happy LaTeXing!~
选自:https://tex.stackexchange.com/questions/86987/cite-like-1-2-instead-of-1-2/86991#86991
发表评论 取消回复