我已经寻找解决方案本论坛以及其他地方,但没有一个解决方案对我有用。
这是我的代码:
\documentclass[preprint,12pt]{elsarticle}
\usepackage{natbib}
%\bibliographystyle{abbrvnat}
%\bibliographystyle{plainnat}
\bibliographystyle{unsrtnat}
\biboptions{comma,round}
\usepackage{lineno}
\linenumbers
\begin{document}
test test test \citep{blazek_explainable_2021,woese2004}.
\bibliography{testref}
\end{document}
我的 testref.bib 文件包含这两个参考:
@article{woese2004,
author = {Carl R. Woese },
title = {A New Biology for a New Century},
journal = {Microbiology and Molecular Biology Reviews},
volume = {68},
number = {2},
pages = {173-186},
year = {2004},
doi = {10.1128/MMBR.68.2.173-186.2004},
URL = {https://journals.asm.org/doi/abs/10.1128/MMBR.68.2.173-186.2004}
}
@article{blazek_explainable_2021,
title = {Explainable neural networks that simulate reasoning},
volume = {1},
issn = {2662-8457},
url = {https://www.nature.com/articles/s43588-021-00132-w},
doi = {10.1038/s43588-021-00132-w},
language = {en},
number = {9},
urldate = {2021-10-15},
journal = {Nature Computational Science},
author = {Blazek, Paul J. and Lin, Milo M.},
month = sep,
year = {2021},
pages = {607--618},
}
我尝试了参考书目样式 abbrvnat、unsrtnat 和 plainnat。但在所有情况下,我都只得到数字引用,
test test test (1, 2).
我希望引用采用作者年份格式。例如 (Woese CR, 2004)。不确定我在这里遗漏了什么。我需要下载 .bst 文件吗?
我将非常感激您的帮助。提前致谢!
答案1
加载文档类时,传递卸载包的elsarticle
选项。然后您可以重新加载它并根据需要传递选项。此外,在参考书目条目中几乎实现了您想要的样式,但在引用标签中则不是。nonatbib
natbib
elsarticle-harv
平均能量损失
% !TeX document-id = {21024933-f6de-4c80-bd58-6d645072d057}
% !BIB TS-program = bibtex
\begin{filecontents*}{testref.bib}
@article{woese2004,
author = {Carl R. Woese},
title = {A New Biology for a New Century},
journal = {Microbiology and Molecular Biology Reviews},
volume = {68},
number = {2},
pages = {173-186},
year = {2004},
doi = {10.1128/MMBR.68.2.173-186.2004},
URL = {https://journals.asm.org/doi/abs/10.1128/MMBR.68.2.173-186.2004}
}
@article{blazek_explainable_2021,
title = {Explainable neural networks that simulate reasoning},
volume = {1},
issn = {2662-8457},
url = {https://www.nature.com/articles/s43588-021-00132-w},
doi = {10.1038/s43588-021-00132-w},
language = {en},
number = {9},
urldate = {2021-10-15},
journal = {Nature Computational Science},
author = {Blazek, Paul J. and Lin, Milo M.},
month = sep,
year = {2021},
pages = {607--618},
}
\end{filecontents*}
\documentclass[preprint,12pt,nonatbib]{elsarticle}
\usepackage{natbib}
\setcitestyle{semicolon}
\usepackage{lineno}
\linenumbers
\begin{document}
\citep{woese2004,blazek_explainable_2021}.
\bibliographystyle{elsarticle-harv}
\bibliography{testref.bib}
\end{document}