In my references, there is a problem with the doi. When using \usepackage{doi}
I get hyperlinks, which is what I want. In combination with \usepackage{apacite}
however, I then have to suppress the doi prefix with \renewcommand{\doiprefix}{}
(otherwise "doi:" would get displayed two times).
This combination of commands results in too many white spaces in front of the doi in the references section, e.g.:
Here is a MWE:
\documentclass[11pt, oneside, a4paper]{book}
\usepackage[ngerman]{babel}
\usepackage[tocbib, natbibapa, nosectionbib]{apacite}
\renewcommand{\doiprefix}{}
\usepackage{doi}
\usepackage{hyperref}
\hypersetup{colorlinks, citecolor=black, filecolor=black, linkcolor=black, urlcolor=blue}
\begin{filecontents}{test.bib}
@article{A,
author = {Ackerman, P. L. and Beier, M. E. and Boyle, M. O.},
title = {Working memory and intelligence: The same or different constructs?},
journal = {Psychological Bulletin},
volume = {131},
pages = {30-60},
DOI = {10.1037/0033-2909.131.1.30},
year = {2005}
}
\end{filecontents}
\begin{document}
\citet{A}.
\bibliographystyle{apacite}
\renewcommand\bibname{References}
\bibliography{test}
\end{document}
Does anybody know how to remove one white space in front of the doi? Or does anybody know how to turn the doi's into hyperlinks without using the doi package?
bbl
file, you'll notice\begin{APACrefDOI} \doi{10.1037/0033-2909.131.1.30}
. See the space, between\begin{APACrefDOI}
and\doi
? Define\renewcommand\doiprefix{\ignorespaces}
and you will get rid of this extra space.\doiprefix
and set\renewcommand\doitext{}
(which is the text you get from thedoi
package).