3

I am unfortunately an absolute beginner with regards to Latex and am currently trying to create a bibliography that corresponds to the apacite style, but does not contain any links, since the DOI code is enough for me.

Is there a command that makes the links disappear for my code? I would be very happy if someone could help me in a hurry. Below is my code example, I have inserted appropriate placeholders for the quote and the text and the references are pulled from a .bib file.

I've googled a lot already, but only came across descriptions that were so complicated that I couldn't apply them to my simple file.

I would be very pleased to receive an answer! Thank you very much!

\documentclass{article}
\usepackage{apacite}

\title {Demo Bibtex}
\author{Author}

\begin{document}
\maketitle

Text

\cite{Source}
\bibliographystyle{apacite}

\bibliography{/Users/Desktop/Latex/Bibtex-File/Bibliography.bib}

\end{document}

1 Answer 1

5

I don't see any option for turning this off selectively. The following is a bit of a hack but it works. It redefines the apacite URL environment to be empty, and then in that environment only redefines the \url command to be empty. I've also added some code to keep the doi: prefix attached to the actual DOI.

This will not work if you have online resources that only have URLs and don't have DOIs, since it removes all URLs.

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{Landau2007,
    Author = {Landau, Idan},
    Doi = {10.1162/ling.2007.38.3.485},
    Journal = {Linguistic Inquiry},
    Number = {3},
    Pages = {485-483},
    Title = {{EPP} Extensions},
    Volume = {38},
    Year = {2007},
    url = {http://doi.org/10.1162/ling.2007.38.3.485}
}
\end{filecontents*}
\usepackage{apacite}
\bibliographystyle{apacite}
\usepackage{etoolbox}
\renewenvironment{APACrefURL}[1][]{}{}
\AtBeginEnvironment{APACrefURL}{\renewcommand{\url}[1]{}}
\renewcommand{\doiprefix}{doi:~\kern-1pt}
\begin{document}
\cite{Landau2007}
\bibliography{\jobname}
\end{document}

output of code

3
  • 1
    Awesome, thanks a lot! Definitely made my day! :-)
    – Michael
    Commented Apr 7, 2018 at 22:25
  • Does not work anymore.
    – Pagol
    Commented Feb 27 at 11:43
  • @Pagol "does not work" doesn't provide any clue as to what happens. This code definitely (still) works. If you have a new problem, ask a question linking to this question and show an example like this one and the error or unexpected behaviour you get.
    – Alan Munn
    Commented Feb 27 at 14:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .