Import bibtex with file attachments from Mendeley

The 0.6.4 version of Mendeley desktop exports bibtex files with links to the pdf file using this bibtex code.

file = {:home/Storage/Documents/article.pdf:pdf},

This wasn't recognized by zotero and the file wasn't linked to the imported reference.

I was able to get it to work by searching for all instances of "file = {:" and replacing with "pdf = {"

Although it only took a few moments to do this search/replace, it would be nice if zotero were able to import this without hassle - feature request :) - especially since those without much computer savy (most of my academic colleagues :P) would likely give up and not try to figure this out.

Note: the weird little ":pdf" at the end of the mendeley bibtext entry does not seem to effect whether or not the file imports correctly into zotero. Thus to save seconds, I left it in the bibtex file and everything worked fine.

Pat
  • It looks like they use the same (or at least similar, depending on whether the case of the ":pdf" suffix matters to one or both programs) scheme as JabRef. Here is the ticket for this:

    https://www.zotero.org/trac/ticket/1180
  • Thanks noksagt for replying and updating the trac ticket.

    I just found out that the ":pdf" suffix does interfer. Zotero will seemingly import the attached files, but they don't exist (though it doesn't give any error until you try to open one of the pdfs).

    This is simply solved by searching through the bibtext file for all instances of ":pdf" and replacing them with nothing/deleting them. After doing this zotero will properly import and attach the pdf files and will allow one to open them from within zotero :)

    Yay

    Pat
  • In addition to Zotero and Mendeley I've also tried Papers (Mac). It creates a bibtex with the following structure for the pdf link:
    local-url = {file://localhost/home/Storage/Documents/article.pdf},

    Each app has some strong and weak points which I'm not going to discuss here, but I want to stress how sorry I am that I cannot get the best out of each just because they fail to communicate (lack of standards? bad implementations?)
    Namely the import of Papers' bibtexs into zotero looses the pdf link (I'm aware of https://www.zotero.org/trac/ticket/1180 but I still dream of a friendlier and more versatile import function)

    Another issue is that a linked file in zotero is not exported within the bibtex. I mean the path, not the actual file. I suppose it is because of the structure: a link is an addition to the original record, but is not seen as part of it. In the end the zotero bibtex is poorer than that of other programs and is less useful for either communicating the some data among them or simply doing a backup.
  • local-url = {file://localhost/home/Storage/Documents/article.pdf}
    this scheme wasn't in the (now closed) ticket, but it should be easy to add.
    but I want to stress how sorry I am that I cannot get the best out of each just because they fail to communicate (lack of standards? bad implementations?)
    Both. But in this case it is because BibTeX wasn't designed with storing PDF links in mind & so there is no standard way to do it.
    but I still dream of a friendlier and more versatile import function
    What do you mean by this? I suspect all we can do is try to adapt to eccentric output of these programs on a case-by-case basis.
    Another issue is that a linked file in zotero is not exported within the bibtex. I mean the path, not the actual file.
    There is no standard way to do this in BibTeX. If you have examples of the output of other programs distinguishing links & stored copies of files), they'd be appreciated.
    In the end the zotero bibtex is poorer than that of other programs and is less useful for either communicating the some data among them or simply doing a backup.
    I disagree: I am aware of no program that will import more file uri schemes than Zotero does now. How do you find the BibTeX export of the other programs to be better? Also: BibTeX is a very limited format. Zotero does the best it can, but the RDF/XML based formats are richer and better.
  • By a "more versatile import function" I mean automatic recognition of the bibtex contents, including the line pointing to files. Maybe it shouldn't be hard coded but instead based on upgradable translators. Just for the record, Papers identifies itself on the bibtex header with:

    %% This BibTeX bibliography file in UTF-8 format was created using Papers.
    %% http://mekentosj.com/papers/

    I'd be pretty happy even if I had to click on a list saying which program made the bibtex I'm about to import. Better yet, add also the opposite, a list of the possible "not so standard" outputs to make zotero export a bibtex matching some target program!
    So if there is no standard, we adapt to all, one at a time, on request basis perhaps...

    I also think this discussion only makes sense for linked files, where the local repository can be easily browsed or shared with other programs. But anyway all references to a pdf are an "external" link, it just happens that some of those files are local copies of others. So if such distinction between links and stored copies is important a comparison of the file path and the zotero base path should distiguish both.

    Finally when I said zotero bibtex was poorer I was referring to the output, because it simply does not list the links to attachments. Standard or not, at least one can edit the output of mendeley to allow zotero importing the link. Another use for exporting the links to bibtex is mass correcting paths: suppose I've just relocated my pdf library, then all I have to do is an export to bibtex and do a find-replace of the old-new path. This of course assumes all the fields are dumped to the bibtex, even if some standards have to be bent or created.

    I can provide examples of output bibtex from mendeley, papers and bibdesk. Of these I think the 3rd is the trickier to tame because the bdsk-file-1 format for the link is criptic to my eyes, yet this is supposedly open source, so maybe not all is lost.
  • By a "more versatile import function" I mean automatic recognition of the bibtex contents, including the line pointing to files.
    But effort has to be made to tell zotero how to "automate" things, right? And that's exactly what adding import support for newly found BibTeX extensions accomplishes. Unfortunately, this must be done on a case-by-case basis.
    I'd be pretty happy even if I had to click on a list saying which program made the bibtex I'm about to import.
    Is there a need for this? It isn't as if other programs are using 'local-url' to mean something else. And BibTeX should ideally be passable between multiple programs.
    Better yet, add also the opposite, a list of the possible "not so standard" outputs to make zotero export a bibtex matching some target program!
    I disagree. We should try to make the output BibTeX as standard as possible & leave it to others to import it correctly (the robustness principle).
    I can provide examples of output bibtex from mendeley, papers and bibdesk.
    Examples of what is not imported correctly are always welcome.
Sign In or Register to comment.