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.
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
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}
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 -).
http://www.refman.com/support/risformat_tags_07.asp
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?
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
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!
https://www.zotero.org/trac/ticket/1694
We also need to modify the importer to work with relative links.
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
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.
http://forums.zotero.org/discussion/17847/improving-bibtex-export/
I hope some devs can push it into the next release of zotero.