2

This question already has an answer here:

I have been using mainly Mendeley and its web importer to handle my references and generate the .bib file. In order to generate my APA conforming references, I opted for \usepackage[natbibapa]{apacite} and \bibliographystyle{apacite} which work quite well, but, as it is, Mendeley web importer often includes URLs that unfortunately will show up in the references as well as the month of publication.

The only way to get the "references of my dreams", therefore, would be to manually delete all theURLs and months. I tried finding and replacing url = with %url = to comment out this part but for some reason, the years become something like (n.d. April).

\documentclass[12pt,oneside]{scrartcl}
\usepackage[natbibapa]{apacite} 
\bibliographystyle{apacite}
\usepackage{url}

\begin{filecontents*}{bib3.bib}
@article{Barth2001,
abstract = {This new and comprehensive database...},
address = {Washington, D.C.},
author = {Barth, James R. and Caprio, Gerard and Levine, Ross},
doi = {10.1353/pfs.2001.0003},
file = {:Users/Documents/Mendeley Desktop/.pdf:pdf},
institution = {The World Bank},
issn = {1533-4430},
journal = {Brookings-Wharton Papers on Financial Services},
month = feb,
number = {2588},
pages = {183--240},
series = {Policy Research Working Paper},
title = {{The Regulation and Supervision of Banks around the World: A New Database}},
url = {http://papers.ssrn.com/abstract=262317 http://muse.jhu.edu/content/crossref/journals/brookings-wharton\_papers\_on\_financial\_services/v2001/2001.1barth.html},
year = {2001}
}
@article{Banker1984,
abstract = {In management contexts...},
author = {Banker, R. D. and Charnes, A. and Cooper, W. W.},
doi = {10.1287/mnsc.30.9.1078},
isbn = {00251909},
issn = {0025-1909},
journal = {Management Science},
month = sep,
number = {9},
pages = {1078--1092},
pmid = {7347358},
title = {{Some Models for Estimating Technical and Scale Inefficiencies in Data Envelopment Analysis}},
url = {http://pubsonline.informs.org/doi/abs/10.1287/mnsc.30.9.1078},
volume = {30},
year = {1984}
}
@article{Alexander2010,
abstract = {We conduct a two-stage ...},
author = {Alexander, W. Robert J. and Haug, Alfred A. and Jaforullah, Mohammad},
doi = {10.1007/s11123-010-0173-3},
file = {:Users/Documents/Mendeley Desktop/pdf:pdf},
issn = {0895-562X},
journal = {Journal of Productivity Analysis},
month = apr,
number = {2},
pages = {99--110},
title = {{A two-stage double-bootstrap data envelopment analysis of efficiency differences of New Zealand secondary schools}},
url = {http://link.springer.com/10.1007/s11123-010-0173-3},
volume = {34},
year = {2010}
}
\end{filecontents*}
\begin{document}

\citet{Barth2001} wrote bla.
Bla \citep{Banker1984}. 
In \citeyear{Alexander2010}, bla.

\bibliography{bib3.bib}
\end{document}

My question: Using the apacite package, is there a way to adjust the code of the bibtex style file instead of changing entry by entry manually? I.e. get rid of the months and urls.

Obviously, I tried using biblatex but got a whole bunch of error messages, duplicates, etc., which makes me believe that the Mendeley bib file is not really compatible with biblatex. The duplicate reference keys refer to keys I don't even use in the current file, that is, I don't get any error message when I compile as bibtex.

The codes I used instead of the above apacite commands:

\usepackage[autostyle]{csquotes}
\usepackage[american]{babel}
\usepackage[backend=biber,style=apa,sortlocale=en_US,url=false,doi=true,eprint=false
]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{library.bib}
...
\printbibliography

There is the log when biblatex is used:

Process started: /usr/texbin/biber “testfile”
INFO - This is Biber 1.8
INFO - Config file is '/Users/Desktop/Papers/testfile/biber.conf'
INFO - Logfile is 'testfile.blg'
INFO - Reading 'testfile.bcf'
INFO - Found 24 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'library.bib' for section 0
INFO - Decoding LaTeX character macros into UTF-8
INFO - Found BibTeX data source 'library.bib'
WARN - Entry N does not parse correctly
WARN - Duplicate entry key: '2006' in file 'library.bib', skipping ...
…another 49 “Duplicate entry key” Warnings
WARN - Entry RePEc:bla:jbfnac:v:27:y:2000-09:i:7 does not parse correctly
WARN - BibTeX subsystem:  /var/folders/kj/f9mldj395715pfhjqp2rhv080000gn/T/fD9qTSEKI9/library.bib_1057.utf8, line 6,               
warning: 176 characters of junk seen at toplevel
ERROR - BibTeX subsystem: /var/folders/kj/f9mldj395715pfhjqp2rhv080000gn/T/fD9qTSEKI9/library.bib_1057.utf8, line 983, syntax error: found "ue2006a", expected ","
INFO - WARNINGS: 50
INFO - ERRORS: 1

Process exited with error(s)

The code works fine for the example above but as soon as the bib file is longer and is generated by Mendeley or Zotero, it doesn't compile. I have roughly 500 entries in my bib file and I don't mind if there are duplicate entries to which I am not referring in the current file. Also, I don't mind if there are reference key that are created by the web-importer or the website I'm on such as RePEc:bla:jbfnac:v:27:y:2000-09:i:7, because I am not referring to it. If I was referring to it, I'd name it something like "AuthorYear".

Another annoying thing is that Mendeley adds a declaration on top of the bib file, which explains the 176 characters of junk seen at toplevel. All this, plus countless hours of experimenting led me to the conclusion that biblatex is NOT a workaround here. (Unless someone can tell me how, of course.) I am therefore looking for a code to adjust the APA bst. file.

As I am not the only one working with these applications, I am quite certain that this question is of interest to a lot of people.

marked as duplicate by Guido, Svend Tveskæg, Heiko Oberdiek, user31729, dustin Dec 5 '14 at 21:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • If you want to use biblatex with biber (an external helper program you have to call just like bibtex), you, well, have to call it. -> biber nameOfYourMainFileWithOutEnding – Johannes_B Dec 5 '14 at 17:42
  • As biblatex is not a viable option for Mendeley/Zotero, I was hoping for a bibtex solution. – joergW3673 Dec 6 '14 at 3:41
  • Duplicate entries in your .bib files are a problem whichever software you use - bibtex will complain as much as biblatex. You only have 1 error but you haven't shown us that, so it is impossible to know what it is. biber tends to generate a lot of spurious warnings, especially if your .bib files contain comments. Is it really not compatible with Mendeley/Zotero? That seems prima facie unlikely but you haven't said why you think so. – cfr Dec 6 '14 at 4:24
  • I am not sure what you are asking for. biblatex is backwards compatible, but provides more possibilities to enter data. You told biblatex to use biber as the backend, so obviously you are not looking for a bibtex solution. Can you make your question more clear? – Johannes_B Dec 6 '14 at 11:49
  • FWIW, as opposed to Mendeley, Zotero does export not just bibtex but also biblatex. No preamble to the .bib file, either. – adam.smith Dec 7 '14 at 23:52