I am using apacite package for my BibTex file, but according to my writing style, it's not required for url to be listed in the bibliography if doi is available. Is there any way I can forced apacite to suppress url in bibliography and display only the doi?


1 Answer 1


We can use the specific format of \bibitem produced by the apacite.bst style.



  title = "DOI and URL",
  author = "Author, Author",
  year = 2000,
  journal = "Apacite Examples",
  url = "http://www.example.com/1",
  doi = "123/123"
  title = "Only URL",
  author = "Author, Author",
  year = 2001,
  journal = "Apacite Examples",
  url = "http://www.example.com/2"
  title = "No DOI no URL",
  author = "Author, Author",
  year = 2002,
  journal = "Apacite Examples" 
  title = "Only DOI",
  author = "Author. Author",
  year = 2004,
  journal = "Apacite Examples",
  doi = "123/124"






    {\iftoggle{biburl}{\unskip\unskip}{}Doi: \usebox{\bib@doi}}
    {\iftoggle{biburl}{Retrieved from \usebox{\bib@url}}}{}





apacite uses APACrefURL and APACrefDOI environments to wrap \url and doi. Thus we can use lrbox to store such pieces of text and set toggle to identify whether they are present or not. Then, apacite inserts \PrintBackRefs at the end of each bibitem thus we can use it to hook into it the commands to print the url and doi. In this hook we do the reasoning to determine which ones has to be printed (and undo spaces).

enter image description here

  • 1
    This works brilliantly. However, with this solution URLs are no longer broken up into multiple lines when they are too long. Is there any way to restore the line breaking?
    – RoyalTS
    Apr 23, 2014 at 16:47
  • There's a new posting -- see tex.stackexchange.com/q/195512/5001 -- that would like to make use of your method while allowing line breaks to be inserted in url and doi strings. Pleas consider posting an addendum to your answer to show how this might be done. (It would involve not using \lrbox, right?)
    – Mico
    Aug 8, 2014 at 19:08
  • See tex.stackexchange.com/questions/195512/linebreak-in-url for a modification to the solution that allows line breaks in url and doi fields.
    – Guido
    Aug 8, 2014 at 20:54

You must log in to answer this question.

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