2

I am using the apacite package for references. I would like to avoid having the URLs printed in the bibliography for all types of references.

Here is an entry from the bibliography (.bib):

@article{Wason1960,
abstract = {abstract here.},
author = {Wason, P C},
doi = {10.1080/17470216008416717},
isbn = {0033-555X},
journal = {Quarterly Journal of Experimental Psychology},
number = {3},
pages = {129--140},
publisher = {Routledge},
title = {{On the failure to eliminate hypotheses in a conceptual task}},
url = {http://dx.doi.org/10.1080/17470216008416717},
volume = {12},
year = {1960}
}

Here is the tex file:

\documentclass[a4paper, 12pt, oneside] {book}
\usepackage{hyperref,bookmark,tocloft}
\usepackage[nosectionbib, nodoi] {apacite}

\begin{document}
Text here \cite{Wason1960}
\bibliographystyle{apacite}
\bibliography{library}

\end {document}

And here is the output reference list:

Wason, P. C. (1960). On the failure to eliminate hypotheses in a conceptual task. Quarterly Journal of Experimental Psychology, 12 (3), 129{140. Retrieved from http://dx.doi.org/10.1080/17470216008416717

I would like to get rid of the part starting with 'Retrieved from:' for all types of references.

0

1 Answer 1

0

This is some kind of hacky solution and I'm not sure whether it's a good idea to do so or not. Experience users, might kindly comment on this.

Locate apacite.bst file. In my linux system it is at

/usr/share/texlive/texmf-dist/bibtex/bst/apacite/apacite.bst

Copy it to your working directory and rename it to something like Myapacite.bst. Open Myapacite.bst in your favorite text editor and find the function FUNCTION {format.url}. In my machine it is at line 3867. Comment the body of the function, i.e., change from this:

FUNCTION {format.url}
{ type.2 empty$
    { begin.end.url.env }
    { type.2 "\bibmessage" =
        { begin.end.msg.env }
        { begin.end.url.env }
      if$
    }
  if$
  "\url{" url * "}" *
  enclose.check
}

to this:

FUNCTION {format.url}
{% type.2 empty$
%    { begin.end.url.env }
%    { type.2 "\bibmessage" =
%        { begin.end.msg.env }
%        { begin.end.url.env }
%      if$
%    }
%  if$
%  "\url{" url * "}" *
%  enclose.check
}

Save it and use it with \bibliographystyle{Myapacite}. You probably need to clean your auxiliary files first.

1
  • This works, but it leaves the space between references. So for example if reference was taking 4 lines with url and it can fit in 2 line without url, bibliography will still have 4 lines for this entry (with 2 lines just being empty). Any suggestion on how to fix that?. Apr 28, 2017 at 20:48

You must log in to answer this question.

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