使用符合当前 DOI 规范的 APA6 样式

使用符合当前 DOI 规范的 APA6 样式

我正在用 LaTeX 写一篇带有 BibTeX 参考文献的论文。使用 apa6 类和 \usepackage{apacite} 以及我的 BibDesk 参考文献,我可以打印符合当前 APA 样式的参考文献。但是,APA 最近已与 crossref 一起切换到使用新的 doi 格式 - 使用 https:// doi.org/10.XXXXXX(此处故意破坏链接,因为否则我无法发布图片)而不是 doi: 10.XXXX(过去首选)。

现在,看看apacite 文档,听起来好像有一些命令写入其中 - 例如,使用 \doi{} 来“格式化 doi 字符串”并在 .bbl 文件中使用 \begin{APACrefDOI}。

该软件包还描述了一个术语 \doiprefix —— 应该可以解决这个问题,对吧?但我似乎无法在任何地方安全地使用它。如果能得到一些建议就好了。

一位评论者要求提供一个最低限度的工作示例,因此如下所示:

\documentclass[jou]{apa6}
\usepackage{apacite}
\usepackage{filecontents}

\begin{filecontents}{thebibliography.bib}
@article{examplecite,
    Author = {Author, Example E.},
    Date-Added = {2017-05-08 00:00:00 +0000},
    Date-Modified = {2017-05-08 00:00:00 +0000},
    Doi = {10.XXXX/YYYY},
    Journal = {\LaTeX{} Studies},
    Pages = {1--5},
    Title = {Example Citation with DOI},
    Volume = {1},
    Year = {2017}}
\end{filecontents}

\title{Example}

\begin{document}

\section{Introduction}

Section containing \LaTeX{} citation \cite{examplecite}. 

\bibliographystyle{apacite}
\bibliography{thebibliography}

\end{document}

这将创建以下文档:

样本文件

除了 doi 遵循旧标准外,其他一切都很好。将 doi.org 链接添加到引用中会导致“doi: https://”等;在任何地方调用 \doiprefix{} 都会导致错误。

答案1

\doiprefix设置当前前缀,负责打印参考文献中的“doi:”(默认定义)部分,\renewcommand{\doiprefix}{}清除它,DOI 通常按原样打印,但我们可以通过定义单个参数宏来定制它,\newcommand{\doi}[1]{https://doi.org/#1}然后它将“处理”DOI,在本例中是将https://doi.org组件添加到前面。

\documentclass[jou]{apa6}
\usepackage{apacite}
\usepackage{filecontents}
\begin{filecontents}{thebibliography.bib}
@article{examplecite,
    Author = {Author, Example E.},
    Date-Added = {2017-05-08 00:00:00 +0000},
    Date-Modified = {2017-05-08 00:00:00 +0000},
    Doi = {10.XXXX/YYYY},
    Journal = {\LaTeX{} Studies},
    Pages = {1--5},
    Title = {Example Citation with DOI},
    Volume = {1},
    Year = {2017}}
\end{filecontents}

\renewcommand{\doiprefix}{}
\newcommand{\doi}[1]{https://doi.org/#1}

\begin{document}
\section{Introduction}
Section containing \LaTeX{} citation \cite{examplecite}. 
\bibliographystyle{apacite}
\bibliography{thebibliography}
\end{document}

在此处输入图片描述

相关内容