obsidian-citation-plugin icon indicating copy to clipboard operation
obsidian-citation-plugin copied to clipboard

Failure to open PDF with Mendeley BibTex

Open GeAaSe opened this issue 2 years ago • 4 comments

Mendeley .bib files are similar to zotero files, so most of the functionality does work for them, too. But somehow Mendeley stores the file paths in a way that is not digested by this plugin, so using SHIFT+TAB does not open the PDF

Instead of a neat file path like this file = {C:\Project\Literature\MyPDF.pdf:PDF}

Mendeley stores the paths like this: file = {:C\:\Project/Literature/MyPDF.pdf:PDF}

This means the link leads into nowhere.

A solution would be to change the file path the following way, given the file path is not valid:

  • replace all forward slashes with backslashes
  • remove the first colon
  • remove the first backslash
  • remove the :pdf or :PDF

It would be great if you could implement this!

Platform: Windows 10

GeAaSe avatar Jun 14 '22 02:06 GeAaSe

I wrote a snippet to solve this in Python, maybe it helps :) https://github.com/GeAaSe/MendeleyBibTexPDFFilePathChanger

GeAaSe avatar Jun 14 '22 05:06 GeAaSe

Awesome question, how do you open pdf from the citation note? SHIFT+Tab? I don't understand, also I'm on a Mac machine.

Also, +1 for Mendeley. I'm not a huge fan of Elsevier but Mendeley has the option to watch a folder so I can automatically update. Zotero seems adamant on not adding this feature since it isn't how "they use it". A lot of people are asking for the feature and their response is super toxic. This thread is pretty funny https://forums.zotero.org/discussion/85923/zotero-does-not-link-local-pdfs.

craldaz avatar Jun 14 '22 06:06 craldaz

Ohhh, you're talking about when you enter the citations plugin pop up box and it says SHIT+Tab there. I see, I'll try to get your script working for Mac machines.

craldaz avatar Jun 14 '22 06:06 craldaz

Yes that is what I was refering to. I let the obsidian citation plugin watch the library.bib file of Mendeley. So if I have new literature in my Mendeley database, the .bib file gets updated by Mendeley but the file path to the literature PDF Mendeley defines does not work for the obsidian plugin. So I run the Python script (created an executable out of it) and afterwards the obsidian citation plugin "knows how to open the PDF" using the SHIFT+TAB method (windows).

GeAaSe avatar Jun 16 '22 01:06 GeAaSe