1

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.

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. The first error likely has nothing to do with Zotero or your .bib file, and may be answered here. For the second error, you'll need to look at line 1095 of the .bib file with a text editor. Can't really give better guidance yet. – Mike Renfro Sep 27 '15 at 15:35
  • Thank you - however, using \bibliographystyle{plainnat} does not resolve the error unfortunately. – tomka Sep 27 '15 at 15:39
  • You'll need to make a minimal working example (MWE), then. Two files should suffice: a single-item .bib file, plus a simple document with your intended document class, bibliography style, and a single citation command. – Mike Renfro Sep 27 '15 at 15:42
  • @MikeRenfro I made an MWE using the first entry created by Zotero, and in fact it is working when I delete all others. So it seems that there is one of the hundreds of bibtex items in my list which causes a problem. Potentially the same entry that causes the problem in JabRef. Do you have advice on how to trace down the culprit? – tomka Sep 28 '15 at 10:22
  • I found the cause of the error to some extent. It was caused by bib items for which 'too many' entries were missing. This again was caused by my Zotero data base in which there were some abandoned files on library level (e.g. pdfs, screenshots) that did not have any annotation. After deleting all of these abandoned files from the Zotero data base and exporting again, it worked fine. Thanks for your suggestions! – tomka Sep 28 '15 at 17:41
1

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.

0

The Better BibTeX Zotero add-on I write fixes these problems. It's not JabRef, but I do humbly submit it's literally the next best thing. If you want to use BibTeX and Zotero, you really want this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.