我被要求将其中一篇论文的书目参考文献格式改为 APA 格式,但使用 apacite 命令时,文档无法编译。MWE 如下所示。
我的问题是:
1)当使用\usepackage{apacite}
并\bibliographystyle{apacite}
带有\citep
引用时,出现错误:
! "Argument of \citeauthoryear has an extra }."
2)如果我将参考样式更改为\cite
或\citeA
,与 apacite 包相对应的样式,我会收到另一个错误:
! Extra \endgroup.
3)尝试使用该选项时\usepackage[natbibapa]{apacite}
,它无法识别该选项
! LaTeX Error: Unknown option `natbibapa' for package `apacite'.
尽管 apacite 包从 2013 年开始实施。
我将感谢任何帮助,因为我必须在很短的时间内完成它,并且在论坛上长时间搜索类似问题后,我找不到任何可行的答案。
提前致谢
\documentclass[english]{elsarticle}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{array}
\usepackage{units}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{esint}
\usepackage{babel}
\usepackage{apacite}
%\usepackage[natbibapa]{apacite}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
\usepackage{endfloat}
\usepackage{array}
\makeatother
\begin{document}
\title{Title of my paper}
\author[rvt]{M.~Surname\corref{cor1}}
\ead{[email protected]}
\author[focal]{A.B.~Doe}
\author[rvt]{C.D.~Smith}
\cortext[cor1]{Corresponding author}
\address[rvt]{Department of Physics, University of Aaaaa, Aaaaa St,
1234 City, Country }
\address[focal]{Institute of Technology, University of Bbbb,
Bbbb St, 4321 City, Country}
\begin{abstract}
The analysis of data from measurements is analyzed.
\end{abstract}
\begin{keyword}
key1\sep key2\sep key3\sep key4\sep key5.
\end{keyword}
\maketitle
\section{Section 1 of my paper}
Lorem ipsum ad his scripta blandit partiendo, eum fastidii accumsan euripidis in, eum liber hendrerit an. Qui ut wisi vocibus suscipiantur, quo dicit ridens inciderint id. Quo mundi lobortis reformidans eu, legimus senserit definiebas an eos \citep{author99,author05}. Eu sit tincidunt incorrupte definitionem, vis mutat affert percipit cu, eirmod consectetuer signiferumque eu per. In usu latine equidem dolores. Quo no falli viris intellegam, ut fugit veritus placerat per.
Ius id vidit volumus mandamus, vide veritus democritum te nec, ei eos debet libris consulatu. No mei ferri graeco dicunt, ad cum veri accommodare. Sed at malis omnesque delicata, usu et iusto zzril meliore.
\begin{equation}
A_{b}=\frac{B_{c}}{2\pi\mu}.\label{eq:Eq-classic}
\end{equation}
Dicunt maiorum eloquentiam cum cu, sit summo dolor essent te. Ne quodsi nusquam legendos has, ea dicit voluptua eloquentiam pro, ad sit quas qualisque. Eos vocibus deserunt quaestio ei.
\section*{References}
\bibliographystyle{apacite}
\bibliography{bibliotest}
\end{document}
还有 bibliotest.bib 文件:
@article{author99,
title = {A fine title},
year = {1899},
volume = {40},
number = {12},
pages = {1052-1057},
author = {A.B. Cdefg and W. Z. John},
journal = {Madness}
}
@article{author05,
title = {The best title},
year = {1905},
volume = {40},
number = {12},
pages = {1052-1057},
author = {Doe, J. and Kirk, J.P.},
journal = {Insanity}
}
答案1
我最终使用 apalike 包解决了这个问题。
正如 Mico 所评论的,elsarticle 嵌入了 natbib 包,当使用 apacite 包时,该包会以某种方式崩溃。我的解决方案是将选项 authoryear 添加到 elsarticle 文档类中:
\documentclass[english,authoryear]{elsarticle}
并包含 apalike 包:
\usepackage{babel}
\usepackage{apalike}
并在\bibliographystyle{apalike}
。
这样,我就能编写出符合所需参考文献格式的文档。
无论如何,感谢大家,希望这能帮助到和我处境相同的人 ;)
问候
答案2
我也遇到过这个问题。不幸的是,这里的答案对我没有帮助。对我有用的是更换
%\RequirePackage[\@biboptions]{natbib}
行elsarticle.cls
(第 642 行)
\RequirePackage[natbibapa]{apacite}
但是,这会使biboptions
命令无法运行,并且通常可能不是一个好的解决方案,因为它会改变它elsarticle.cls
本身(但无论如何,这似乎是一个未维护的类文件;从 CTAN 安装给了我一个 2009 年的版本...)
答案3
您可以按如下方式解决此问题(elsarticle.cls
与 APA 书目参考样式一起使用):
\documentclass[preprint,authoryear,12pt]{elsarticle}
\usepackage{natbib}
\begin{document}
bla bla bla \cite{author99}
\newpage
\bibliographystyle{dcu}
\bibliography{refs}
\end{document}
====================================
以及refs.bib
文件:
@article{author99,
title = {A fine title},
year = {1899},
volume = {40},
number = {12},
pages = {1052-1057},
author = {A.B. Cdefg and W. Z. John},
journal = {Madness}
}