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

File linking somehow broke #78

Open Tomagori opened 3 years ago

Tomagori commented 3 years ago

I'm not sure if this is due to an update of Citations or of Obsidian, but my old method of linking to the PDF file no longer works.

Citations is currently set to insert a link to the PDF file when creating the literature note using [File](<file:///{{entry.files}}>). This worked for a couple of weeks just fine. However, when using the same method today, the output of {{entry.files}} has become ..\\..\\..\\the\\actual\\path\\file.pdf

I have no idea where the initial ..\\..\\.. came from all of a sudden, this is where usually the path starting from C: should be, but they completely broke file linking. If not down to Citations, it could possibly be related to Obsidian handling relative file links differently, as the file link is only broken until the start of the Obsidian vault's location, but I'm not aware of that changing.

Any help would be appreciated.

hans commented 3 years ago

Hi @Tomagori , sorry for the late response. Is this still an issue?

I'd first want to make sure this is not an upstream issue. Can you confirm that your JSON/Biblatex export file still has the correct path -- that they are not given as relative paths in this file?

Tomagori commented 3 years ago

Hi @hans , no issue, thank you very much for your time and this plugin.

My JSON export file does use relative paths, but this wasn't an issue before. Did something change? I'd prefer staying with relative paths, as this is how I keep my Zotero library synced across devices. And the Obsidian vault is within the folder structure that's part of the relative paths, so it shouldn't have to go outside that domain.

rhaynes74 commented 3 years ago

Tomagori - I am a new obsidian user (but an old bibtex guy!). Is there some documentation to providing a file link in the literature note? I have absolute paths for all my pdf files and am on a Mac.

Tomagori commented 3 years ago

I have the following snippet in my literature note settings: {{#if entry.files}}[File](<file:///{{entry.files}}>){{/if}} This generates a file link if such a link is present in the Zotero entry. I think absolute paths should work just fine. Not sure if there's any other documentation to this, as {{entry.files}} is the only Zotero variable that relates to the Zotero item's file path. Feel free to ask any questions though.

rhaynes74 commented 3 years ago

That works like a charm (once I figured out I should put it in the frontmatter!)

Sincerely,

Dr. Ronald D. Haynes Professor, Department of Mathematics and Statistics Chair, MSc and Phd Scientific Computing Programs Memorial University of Newfoundland

We acknowledge that the lands on which Memorial University’s campuses are situated are in the traditional territories of diverse Indigenous groups, and we acknowledge with respect the diverse histories and cultures of the Beothuk, Mi’kmaq, Innu, and Inuit of this province. On Jun 24, 2021, 5:30 AM -0230, Tomagori @.***>, wrote:

I have the following snippet in my literature note settings: {{#if entry.files}}File{{/if}} This generates a file link if such a link is present in the Zotero entry. I think absolute paths should work just fine. Not sure if there's any other documentation to this, as {{entry.files}} is the only Zotero variable that relates to the Zotero item's file path. Feel free to ask any questions though. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.