我無法獲得所需的引文形式。一旦我引用了,我想看到作者的名字而不是數字。非常規的事情是我必須使用文件類別 elsarticle (這是編輯的要求),它總是產生數字。這就是我所擁有的
\documentclass{elsarticle}
\usepackage{natbib}
\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}
\begin{document}
\bibliographystyle{plainnat}
\bibliography{references}
\end{document}
有人可以幫我解決這個問題嗎?
這是擴充的 MWE。
\documentclass{elsarticle}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amsmath, mathtools}
\usepackage{natbib}
\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}
\usepackage{changes}
\usepackage{appendix}
\usepackage{filecontents}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}
\section{The Model}
The main environment modifies that of \cite{Diamond1965}, into two main dimensions
\newpage
\bibliographystyle{elsarticle-harv}
\bibliography{references}
\end{document}
答案1
您應該authoryear
在類別選項中指定。
\begin{filecontents*}{\jobname.bib}
@article{Diamond1965,
author={J. A. L. Diamond},
title={Some Like It Hot},
journal={J. High Level Cinema},
year={1965},
}
\end{filecontents*}
\documentclass[authoryear]{elsarticle}
\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}
\begin{document}
\section{The Model}
The main environment modifies that of \cite{Diamond1965}, into two main dimensions
\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}
環境filecontents*
只是為了使範例自包含,你不需要它;將該行更改\bibliography
為您的檔案名稱.bib
。
是的,我知道《熱情似火》並不是 1965 年拍攝的。;-)
添加到authoryear
不是natbib
一個解決方案,因為該類別elsarticle
已經加載了它,所以有
\usepackage[authoryear]{natbib}
序言中的內容只會導致有關衝突選項的錯誤。
答案2
由於您使用的是elsarticle
文檔類,因此您可能需要使用elsarticle-harv
而不是plainnat
參考書目樣式。顧名思義,它elsarticle-harv.bst
為您提供作者年份風格的引文(又名哈佛風格的引文),以及根據大多數愛思唯爾運營的期刊(需要作者年份風格的引文)的指南格式化的參考文獻。
此外,為了啟動完整的authoryear樣式(使用年份而不是數字),authoryear
應該指定為文件類別選項:
\documentclass[authoryear]{elsarticle}
(此資訊是在 OP 發布 MWE 後添加的。)
答案3
如果您使用 elsevier 參考樣式(其中包含所有套件本身),您可以提供以下參考書目選項:
\bibliographystyle{elsarticle-harv}\biboptions{authoryear}