hans / obsidian-citation-plugin

Obsidian plugin which integrates your academic reference manager with the Obsidian editor. Search your references from within Obsidian and automatically create and reference literature notes for papers and books.
MIT License
1.12k stars 83 forks source link

Failure to open PDF with Mendeley BibTex #175

Open GeAaSe opened 2 years ago

GeAaSe commented 2 years ago

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:

It would be great if you could implement this!

Platform: Windows 10

GeAaSe commented 2 years ago

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

craldaz commented 2 years ago

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 commented 2 years ago

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.

GeAaSe commented 2 years ago

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).