[Tex/LaTex] using APA6 style with current DOI specifications

apa-styleapacitebibtex

I am writing a paper in LaTeX with BibTeX references. Using the apa6 class and \usepackage{apacite} — along with my BibDesk references — I'm able to print references that follow current APA style. However, the APA has recently switched with crossref to using a new doi format — using https:// doi.org/10.XXXXXX (link intentionally broken here because I can't post the image otherwise) instead of doi: 10.XXXX (which was preferred in the past).

Now, looking at the apacite documentation, it sounds like there's some commands that are written into it — e.g., using \doi{} to "format the doi string" and using \begin{APACrefDOI} in the .bbl file.

The package also describes a term \doiprefix — which should presumably solve this issue, right? But I don't seem to be able to safely use it anywhere. Some advice would be appreciated.

A commenter asked for a minimum working example, so that follows:

\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}

This creates the following document:

sample document

Everything about that is fine except for the doi, which follows the old standard. Adding the doi.org link into the citation results in "doi: https://" etc.; calling \doiprefix{} anywhere causes an error.

Best Answer

The \doiprefix macro sets the current prefix, this is responsible for printing the "doi: " (the default definition) part in the references, \renewcommand{\doiprefix}{} clears this, the DOI is normally printed as is, however we can customise this by defining the single argument macro \newcommand{\doi}[1]{https://doi.org/#1} which will then "process" the DOI, in this case prepending the https://doi.org component.

\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}

enter image description here