I am trying to develop a workflow as I begin writing my dissertation (in the social sciences). I am using emcas as my LaTeX editor, Zotero as my citation manager, and Linux Mint as OS. I had a question of a simple workflow to allow me to add citations from Zotero. I know one way is to export a bib file from Zotero and use that in my .tex file. But the problem with this workflow is that it requires exporting a bib file each time I make an addition to citations. Is there better emacs+zotero+biblatex integration?
[Tex/LaTex] citing from zotero for workflow in emacs/AUCTex
auctexbiblatexbibtexemacszotero
Related Solutions
You can set up Jabref to automatically import a reference from Firefox into the current database, but it's somewhat arcane. Here is my solution under Linux:
1) Select Options -> Preferences -> Advanced -- and check "Listen for remote operation ..." I don't think it matters which port.
2) Create a small bash script (text file) named "jabref-import" that looks like this:
#!/usr/bin/env bash
java -jar ~/local/jabref/JabRef-2.8.1.jar -i --importToOpen "$*"
Replace "~/local/jabref/JabRef-2.8.1.jar" with the path to your Jabref .jar file on your machine. Or if you have a working executable called "jabref", you can replace everything before the "-i" with "jabref". Just make sure your executable accepts command-line options (mine didn't).
In Ubuntu 13.04, the following variant of the script works:
#!/usr/bin/env bash
jabref -i --importToOpen "$*"
3) Make the file executable:
chmod ugo+x jabref-import
4) Make sure Jabref is already open. Go to Firefox, download a citation file. It could be a .bib or .ris or .ref or whatever. Select the "Open with..." option in the dialog, and select the jabref-import executable that you just made. The import dialog should pop up in Jabref with your citation.
I solved my issues of compatibility between the BibTex file exported from Zotero and BibLatex. I recap the solution here. Apparently BibLatex is much more sensible than BibTex when it comes to reading a BibTex file...
To export correctly the bibliography from Zotero and then into a Tex document via BibLatex I used this BibTeX Export Translator (modified by Robin Wilson) with two important tweaks:
1) On line 11 of the translator script you need to set "exportNotes": true,
to "exportNotes": false,
(of course just in case you have added notes to your Zotero items, e.g. you extract annotations from PDFs). This will avoid BibLatex crashing on too long fields.
2) On line 2256 you need to tell the translator to avoid adding a comma after each bibliography item (the comma will result in BibLatex giving a warning on the first line of each entry excluding the first...) changing this line: Zotero.write((first ? "" : ",\n\n") + "@"+type+"{"+citekey);
with this line: Zotero.write((first ? "" : "\n\n") + "@"+type+"{"+citekey);
Another possible source of problems of the BibTeX Export Translator could be the character encoding. In my translator I kept as in source file "exportCharset": "ISO-8859-1",
on line 10. I tried to change it to UTF-8 but it created another class of issues, not with BibLatex (it run without errors) but with Latex,
[1{/usr/local/texlive/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./bib/price2012.tex [2]
! Undefined control sequence.
<to be read again> \edef \blx@tempa {193\x
{FFFD}\x {FFFD}\x {FFFD}219}
l.8 \printbibliography[heading=subbibliography]
for each refsection. It also messed with the "pages" field of some items, outputting:
Andrea B. Hollingshead. “Information suppression and status persistence in group decision making the effects of communication media”. In: Human Communication Research 23.2 (1996), 193fffdfffdfffd219.
I then switched back to "exportCharset": "ISO-8859-1",
and both BibLatex and Latex run without warnings or errors. The PDF output was correct:
Andrea B. Hollingshead. “Information suppression and status persistence in group decision making the effects of communication media”. In: Human Communication Research 23.2 (1996), 193–219.
and I also get correct output with the umlaut of Habermas:
EDIT: The problem with the page field was probably due by a odd "-" character that you sometimes get to separate the 2 page numbers when you download the citation from the Internet.
Best Answer
Better BibTeX for Zotero allows for automated export to BibTeX/BibLaTeX (a.o.). It's set-and-forget; you export a collection to a file, tick "Keep updated", and Bob's your proverbial uncle. Any changes you make to that collection or its entries will cause a background update of the bib file.
You can have multiple of such exports set up -- BBT implements heavy caching, so most of the time you won't even notice that its busy (except that one user with a crazy 22k entries in a single collection -- that takes a little under a minute).
Full disclosure: I am the author of BBT.