Integration with latex?

I've seen a couple discussions here about integration with Word -- but I'm a Latex user (specifically, TeXShop on a Mac) and I haven't been able to find any conversations/information about what the future might hold for people who want to use Latex and Zotero together. Is there any information out there?
«13
  • edited November 9, 2006
    Zotero can export to BibTeX, so you can already use it with LaTeX.

    I suppose it might be nice if some developer would add the ability to push to LyX/Kile, Emacs, WinEdt, etc. (just as JabRef already can).
  • In the absence of tighter integration, do you know if I can set things up so that every time I make a change in Zotero it automatically updates the BibTex file, so that I can work with Zotero and Latex smoothly? Or will I have to re-export over and over?
  • This functionality doesn't exist--you'll have to re-export it over and over.

    In principle, it should be possible to do this with a third-party plugin (I don't know if it is so common a need that the Zotero devs should add it to the core extension).
  • I'd like to second Noahwf's request to have Zotero automatically maintain a BibTeX file that's equivalent to an export of the whole library. This would be very useful for me. A simpler alternative would be to streamline the user interface for exporting, making it as painless as possible to export the entire library to the same file repeatedly.
  • I also agree with noahwf:
    it would be very useful to have a BibTeX-file which is constantly updated when changes in Zotero are made.
    It would be very nice also, if a field "abstract" would exist (and be exported to BibTeX) for the abstract of a paper and if the note fields in Zotero could also be exported (maybe as an option - choosen by the Zotero user).
  • I also work with Latex, and while I wasn't worried about having to re-export the file, I've found that I have lost all my citation keys - they've been overwritten with very long and illogical (from my viewpoint) keys that I could never remember. Is there any way I can set the citation keys in Zotero so that every time I re-export I don't have to reset hundreds of citation keys? I'm sure I need not add that this is never going to happen, and as I have been using the same method of giving keys that my filing system of papers and handwritten notes also uses I am not about to change.

    I figure there has to be somewhere that zotero stores the keys, otherwise every time you export you run the risk of having the citation keys change which would play havoc with in text citations.
  • Is there any way I can set the citation keys in Zotero so that every time I re-export I don't have to reset hundreds of citation keys?
    No & there hasn't yet been announcements that this is under consideration, although it has come up a few times in the forum. There has been some talk (by people who aren't actually zotero devs) about customizing the automated citekey instead.

    My personal solution is to just import zotero export into bibliographic tools more capable of handling bibtex for now. There are other utilities that can make sensible citekeys for you (but if you export everything several times rather than append new entries, it could be that you clobber some of your keys).
    I figure there has to be somewhere that zotero stores the keys, otherwise every time you export you run the risk of having the citation keys change which would play havoc with in text citations.
    This is exactly what happens right now--citekeys are auto-generated at the time of export.
  • I do agree with Andrew and Noahwf about maintening a BibTeX File...
  • @ Orange : I agree with you that automatically generated key in BibTex export are almost not usable. I proceed like Noksagt. I export in bibtex format. Then using Jabref, I regenerate a key using for instance Author Date. That way, I can continue to manage my bibliography in Zotero, even if I am writing something. Author Date is key that does not change too much when you add new item to your biblio.
  • Hello,

    I agree that it would be very useful, zotero to maintain an updated bibtex file.

    It would also be very useful to be able to copy and paste the bibtex key from zotero to the text editor.
  • @pqs:
    See http://forums.zotero.org/discussion/31/bibtex-export/
  • @noksagt, thank you.
  • edited September 27, 2007
    I agree that it would be very useful, zotero to maintain an updated bibtex file.
    The chances of our implementing this within Zotero are quite slim. But, as noksagt mentioned at the beginning of this thread, it could be done as a plugin—extremely easily without any optimization, or with a bit more work the more efficient the updating logic was.

    If anyone is interested, see our sample plugin and post a note on the dev list to let others know you're working on this.
  • To respond to noksagt's comment about using zotero with bibtex / latex and pushing citations to LyX/Kile, emacs, and WinEdit: Others are interested in this as well, see the posts at:

    http://forums.zotero.org/discussion/537/lyx-support

    If someone is working on the custom bibtex key generator or updater, please post to that discussion, since the projects would work well together.
  • Yes! I also would be very interested in this. Most importantly I would like to see the ability to have the citekey listed as a column in zotero's main table so at the very least I could write my latex with the correct citekey before exporting.

    Ideally, I would like to be able to drag and drop a Zotero entry into a text window and have it plot out \cite{articlename}.
  • I'm a LaTeX user, but I'd rather see more facilities for combining zotero with external tools than have zotero try and do everything.

    BibTool, for example, does a better job than zotero is ever likely to do of cleaning up bibtex files, auto-generating citekeys, etc. I'd like to be able to automatically invoke it (or any other tool of my choice) every time I do a bibtex export.
  • I just wrote a hack that answers my earlier request. This will allow you to copy-and-paste or drag and drop the \cite{key} from zotero into a waiting text editor.

    This may not solve noahwf's original problem, but it should help anyone who uses a text editor to write Latex.

    It is available here:
    http://www.people.fas.harvard.edu/~leifer/zotero/BibTexCiteKeyOnly.js
    And it is just a crudely modified version of Simon Kornblith's "BibTex" translator version 1.0.0b4.r1.

    To install, simply save the .js file to your Zotero translator's directory and restart Zotero.

    If you don't know where your translator's directory is do the following:Go to Zotero Preferences. Open the Advanced pane. Click on "Show Data Directory." This will take you to a "zotero" folder. The "zotero" folder will contain a "translators" folder. Save the.BibtexCiteKeyOnly.js file here.

    To Use:
    After you restart Zotero, set "BibTex CiteKey-Only Exporter" as the Default Output Format in the Export preferences pane. Now, you can select a reference and drag it off the screen into a waiting text editor. Alternatively you can use Cmd+Shift+C to copy the \Cite{key} to your clipboard.

    I hope someone will find this useful.
  • Great Kramer, this is exactly what I was looking for! Works (almost) perfectly :)
    Just a few notes though

    1) the translator folder doesn't exist in the version 1.0.9, only in the beta version. not sure how to adapt this for the old version, I just upgraded to beta
    2) when I drag and drop a citation, it goes into TexShop great, but it always goes to a new line, ie drops [Enter] \cite{citekey}

    Otherwise, great!!
  • edited May 3, 2009
    Great albot! Glad it was helpful.

    I uploaded a new version that got rid of the carriage return. Don't know where the folder is for 1.09 (I use 1.5beta) so I can't help you there.

    Good luck!
  • There isn't a translator folder in 1.0.x. Instead all translators are stored in a single sql file, and a tool is available to insert and modify translators in that file:
    http://www.zotero.org/support/dev/scaffold_tutorial
    Upgrading to 1.5 is probably easier though.
  • Kramer, if I were heterosexual and/or maternal, I'd offer to have your babies. Instead, please accept my eternal gratitude for this add-on!
  • Awesome.

    Well since people are finding this useful, maybe the powers-that-be would consider adding this as a default translator that ships with Zotero. Does anyone know how that works?
  • Well, Zotero should probably just generate the cite key automatically when using the copy-as-citation shortcut key or Shift-drag. There's currently no mechanism to do this with export translators (as opposed to bibliographic styles), so it would take a little work, but it'd be better than having a separate BibTeX translator just for Quick Copy.
  • I am using this setup:

    1. Zotero to retrieve references from the web
    2. Mendeley on my computer for cataloging and extracting information from locally stored pdfs
    3. Zotero syncs with Mendeley
    4. Mendeley is able to create and keep-in-sync a bibtex file for a) the entire mendely library, b) a collection (user defined collection).
    5. Jabref to manage the bibtex-file and direct import into latex editor.

    works great (..or as great as your skills are at keeping a clean collection in Mendeley...)

    Cheers,
    Tormod
  • Hi

    Has anyone had any problems recently after the last Zotero update with Kramer's (excellent) drag and drop \cite tool. It now seems to be generating the wrong author_first word_year line for the citation when dragged across? The Bibtex name is now not the same as that dragged across...If so (or even if not), does anyone know how to get round it?

    Thanks
  • I read this thread with interest as I'm trying to setup a Zotero -> Latex solution on my mac. I came across Zot2Bib for Macs, which works great and allows me to update my .bib file using the same click-throughs that Zotero uses:

    http://mackerron.com/zot2bib/

    Best
    Steve
  • I have just spent a long time understanding the interplay between Zotero bibtex export using bibtex.js and using the resulting .bib file in a LaTex document bilbliography with \bibliographystyle{plain-annote} so as to be able to export an annotated bibliography directly into LaTeX using Zotero notes records for annotations.

    The main issue I am encountering is the output contains sort of html formatting like {\textless}p{\textmore} paragraph text {\textless}/p{\textmore} for each paragraph, obviously to add html paragraph notation such as <p> and </p> to the output.

    I cannot find how to conveniently use this in LaTeX. My current solution is to edit the .bib to remove all such entries, but surely this is not uncommon, so is there some new feature in 2.1 to address this, or some other solutions?
  • We or you could modify the BibTeX.js translator to handle the paragraphing in a more BibTeX-friendly way. You'll want to modify the writeField(..) function, line 1823 in the translator, and add special treatment for the field "annote".
  • I was mentally prepared for your response, ajlyon, so is there a dev guide I can look at? Basically what I need to do is strip html before writing I think
  • It's just plain JavaScript, plus you have some extra Zotero utility functions at your disposal. You should be able to use Zotero.Utilities.cleanTags(..), which will just remove all HTML tags. Or you could write a series of regular expressions to replace the tags with BibTeX/LaTeX-friendly replacements.

    Just special case field == "nnote" with an extra if clause and put your replacements there.
Sign In or Register to comment.