[Tex/LaTex] Problems to export Zotero to bibtex, Natbib error and JabRef error

apa-stylebibtexnatbib

I am very new to using references in Latex, so I may make stupid mistakes.

So far I used Zotero for reference managing in Word. Ultimately I need an APA style, where in-text is "Author (year)" format or parantheses format "(Author, year)".

Reading about Bibtex I exported the Zotero archive as Bibtex .bib extension file. When I give

 \bibliography{mybib}
 \bibliographystyle{apalike}

And in text \cite{author_first-title-word_year} (which seems to be the Zotero code in bibtex files), I succefully get the typical [1] format with APA-like references in the end as output in Latex. Now I am working towards the author, year format I need.

I have two problems. I read that I need the Natbib package for this format. When I use \usepackage{natbib} with my Zotero exported Bibtex file I get the following error:

Package natbib Error: Bibliography not compatible with author-year citations

The Zotero data base is also not compatible for opening in JabRef 2.10. If I open in JabRef, I get error in line1095: Expected = but received @.

I am wondering what useful steps are for going towards the author, year format with my Zotero data base. Thank you.

Best Answer

I am sure that tools like Zotero, Jabref, Manderley, Citavi, etc. are very usefull to get an overview over the used literature and cited parts.

All of them use their own way to store theese informations and have to change theese information into the BiBTeX format so that you can use it with LaTeX.

All of theese programms can produce faulty bib files, so you should test them before use them in your LaTeX thesis or other document. I know for example, that Zotero exports the abstact and other parts not usually used in BiBTeX files, containing wrong letters or missed field end sign } or ".

Some of my students had to fight with that thing.

A solution is to have a standard bib file test code to check theese exported files from that tools. In the following MWE I use package filecontents to simulate a bib file with some entrys. You can omit that and use just your file name for the bib file.

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Goossens,
  author    = {Goossens, Michel and Mittelbach, Frank and 
               Samarin, Alexander},
  title     = {The LaTeX Companion},
  edition   = {1},
  publisher = {Addison-Wesley},
  location  = {Reading, Mass.},
  year      = {1994},
}
@Book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
article{einstein,
  author  = {Albert Einstein},
  title   = {{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) 
             [{On} the electrodynamics of moving bodies]},
  journal = {Annalen der Physik},
  volume  = {322},
  number  = {10},
  pages   = {891--921},
  year    = {1905},
  DOI     = {http://dx.doi.org/10.1002/andp.19053221004},
}
\end{filecontents*}


\documentclass[10pt,a4paper]{article}

\usepackage[%
  newcommands     % \RaggedRight=\raggedright etc. 
 ,newparameters   % use default settings of ragged2e
]{ragged2e}
%\usepackage[margin=2.5cm]{geometry}
\usepackage{showframe}  % to visualise the typing area and margins
\usepackage{hyperref}

\begin{document}

This is text with \cite{Goossens} and \cite{adams}.

\nocite{*} % to test all bib entrys
\bibliographystyle{unsrt}
{\raggedright  % group to end left justification after bib
\bibliography{\jobname}    %<====== add here your file name without .bib
}              % ends group for left justified bibliography

\end{document}

With this testcode you can locate the faulty parts of your bib file and correct them, because you will get the line number of the bib file were the error was recognized.

Or you can use my MWE and copy one entry from your bib file into it, compile, no errors, next on. Errors? Correct them.

Because I think it is nicer to typeset a bibliography left justified, I have included the code for that in my MWE.