Export to BibTex - INCLUDING attachment file information

Hi!

I need to be able to output attachment information in bibtex format.

Reason:

I am using a SciPlore mindmap (formerly "freemind scholar") an open source mind mapping tool based on freemind, which integrates with reference managing and are able to extract pdf bookmarks onto the mindmap via simple drag and drop.

Its a would-be killer combination with zotero: Save your pdf's in zotero storage, bookmark citations in the pdf, and in SciPlore extract those citation as nodes in the mindmap while keeping the link to the source. It works with japref and Mendeley, but not Zotero which doesn't output attachment information in BiBTeX export.

Now to the technical part:

As a dirty workaround I am trying to modify the BibTex.js file, which does the import/export work, but simply can't figure out how to read information out of the attachment object or array (or whatever it is)

from BiBTeX.js, around line 2016:

if (item.notes) {
for each (var note in item.notes) {
writeField("annote", note["note"]);
}

After this, I put this statment:

 if (item.attachments) { //abc
Zotero.write("This is an attachment:");
// This works - but I would like to retreive information about the attachments - but how?
}

Can anyone drop me few lines on how to retrieve the attachment information (eg. attachment name, path, mimetype).

Thanx :-)

Anders

p.s. I know there are probably other issues regarding relative vs. absolute file path and so on, I will try to handle this later. And all this could probably best be handled via a zotero plugin, maybe I'll get to that.

  • Hello Anders, hello Zotero Team,

    I am one of the developers of SciPlore MindMapping. If Zotero should have any interest in implementing Anders suggestion we would be more than willing to help to integrate SciPlore MindMapping with Zotero.

    Best regards,
    Jöran
  • You might either look at the Zotero RDF.js translator and/or post to the dev group.

    Ideally, the file export would follow one of the standard schemes, particularly that used by both JabRef and Mendeley, e.g.file = {Description of the file:/full/path/to/file.pdf:PDF}
  • Hello,

    it would be great if the attachments could also be exported to the RIS format. Ideally, a field that is not being used so far by RIS should be used for the export (e.g. Z1 -).
  • Note that RIS does have a standard means for linking to some attachment types & we don't need to invent a new one that would be incompatible with any other program.
  • I disagree noksagt - Endnote does export links to attachments (not sure about import) and Mendeley exports and imports links to attachments in L1 - while I realize that's nowhere in the standard, I do think Zotero should provide that option. Dan seemed willing to do that last time around, too.
  • Did you read what I wrote? Because it seems that you agree entirely with me. L1 for PDFs is in the spec. & that is why I said we shouldn't have to invent 'Z1':
    http://www.refman.com/support/risformat_tags_07.asp
  • sorry, I did read, but misread - I was sure you had written "doesn't have"
  • As far as I understand it, as of April 2010, that all that is missing from the Zotero/ Sciplore link is for Zotero to
    a) include path to attached files in the BibTex (export) file; and
    b) automatically maintain the BibTex (export) file when references are added to the Zotero collection.

    Of the two, including the path sounds straightforward but maintaining the export file automatically seems quite difficult- Zotero would have to "remember" every Bibtex file it exported and commit to updating all of them for each collection update, then there would be grief if the exported file was missing or locked by another programme. Is there instead a Zotero API that Sciplore could call to get a particular export file updated?
  • I have no idea how it works, but the LyZ addon for integration between Zotero and LyX maintains a bibtex database. You might try to see how they do it. http://www.klubko.net/?page_id=945&lang=en
  • Hi all,

    Its Jimme here from www.qiqqa.com. I see that this is a similar request to http://forums.zotero.org/discussion/13326/qiqqa-and-pdfs/#Comment_65938

    As mentioned is the other forum, I would be more than happy to augment the Zotero bibtex exporter file to include the pdf filenames. It looks very straightforward to implement in BibTeX.js and could be made unintrusive on those not wanting to use it (perhaps for compatibility reasons or they are giving the bibtex to someone else, in which case the attachments are useless).

    A checkbox on the export options screen to "Export Files" (like for the "Zotero RDF" export option) would turn on the functionality. Each attachment would then be associated with their bibtex record in a file={xxx:filename:filetype} item (same format as JabRef and Mendeley). The xxx seems to always be blank for both though, so I guess it wouldnt hurt doing the same.

    Thanks,
    Jimme

    jimme@qiqqa.com or www.qiqqa.com
  • Hi there.

    I had to do almost exactly this a little while ago for a pet project- turned out to be INSANELY simple.

    I just made a new patch file with those changes: http://pastie.org/1040704

    Its like 5 lines of actual code. all it does it emit the "file = " line in the same format as Mendeley. I used the mimetype as the last part of the file line, which makes sense I think. If there happens to be more than one attachment, that's fine as far bibtex is concerned. The checkbox is there to choose whether you want to the file output (just like RDF), and defaults to off. All works just fine for me.

    Not sure how the zotero process works...maybe someone that does actual dev work on zotero can include that patch quite easily?

    @spicedreams - that should quickly solve your a), b) would take way more effort!
  • LeanneJParry, I just committed your patch to the repository. Thanks!
  • edited July 12, 2010
    Good patch. Rather than exporting null for the first field (which defines a plain-text description of the file), perhaps it should use the attachment's name? Also, we should not process the file field for the same reasons we do not process url/doi fields. We should only export a single file field (or the BibTeX is not valid). Multiple attachments may be connected by semicolons. Patch created in ticket:

    https://www.zotero.org/trac/ticket/1694

    We also need to modify the importer to work with relative links.
  • I am interested in using Free Mind Scholar and Zotero. I have looked at other options (e.g. JabRef, VUE, Mendeley) but I like Zotero and think Free Mind Scholar is the final piece of the puzzle I need before embarking on my PhD.

    I mananged to follow the thread but I am unsure if the patch is a complete solution. Could someone elaborate on...

    1) Does the patch now eliminate the need for Mendeley as advised here:

    http://sciplore.org/software/sciplore_mindmapping/zotero_options.php

    2) Can I implement it without having to wait for a Zotero Update? If so how?

    3) If I want to use Free Mind Scholar will I need to export a new bibtex file with all the references I want to include in the mind map (as Zotero will not auto update at this stage) and link that bib tex file into Free Mind Scholar?

    Regards,
    Nick
  • I would also be interested to know these things. Anyone?
  • 1) Does the patch now eliminate the need for Mendeley as advised here:
    Probably, but you could try it.
    2) Can I implement it without having to wait for a Zotero Update? If so how?
    Download the translator from trac & replace the version in your data directory.
    3) If I want to use Free Mind Scholar will I need to export a new bibtex file with all the references I want to include in the mind map (as Zotero will not auto update at this stage) and link that bib tex file into Free Mind Scholar?
    Probably, but you could try it.
  • Can one do the same with file link attachments? Without copying the files? The row
    attachmentString += ";" + attachment.title + ":" + attachment.path + ":" + attachment.mimeType;
    in jabref.js produces something like
    {some description:undefined:application/pdf}
    in this case. So attachment.path does not work properly for file link attachments.
  • see my solution and more in the post:
    http://forums.zotero.org/discussion/17847/improving-bibtex-export/

    I hope some devs can push it into the next release of zotero.
Sign In or Register to comment.