foambubble / foam

A personal knowledge management and sharing system for VSCode
https://foambubble.github.io/
Other
15.23k stars 650 forks source link

integration with bibliography / refering to pdf of papers, datasheets etc... #582

Closed jerabaul29 closed 1 year ago

jerabaul29 commented 3 years ago

I often need to comment, refer to, etc, to papers, datasheets, and technical documentation. Any way to interface with a bibliography tool? Either something "a la zotero" (though I am not too fan of it), or another bibliography tool?

(Btw, do you know if there is some bibliography tool that holds the pdfs and plaintext metadata in a "normal" folder structure in addition to or rather than a database or something like this, so that it is more portable and easier to interface to? A feeling there may be some foam users who have thought about this before :) )

jerabaul29 commented 3 years ago

I see there may be 2 different questions here actually:

Let me know if I should split in 2 issues.

riccardoferretti commented 3 years ago

I know some users integrate Zotero with Foam, but I have personally never done it so I wouldn't know

As an alternative, from recommended-extensions.md:

  • Markdown Footnotes (Adds [^footnote] syntax support to VS Code's built-in markdown preview)
julianprester commented 3 years ago

Take a look at the VS Code extension Pandoc Citer. It provides an auto-complete feature for references saved in a BibTeX bibliography. If you're using Zotero as your reference manager, you can use the popular Better BibTeX extension for Zotero to create .bib exports of your bibliography, but most other reference managers should also be able to export to .bib.

winni2k commented 3 years ago

I don't know if my use case warrants a separate issue:

Pandoc Citer does not really do much for me other than tell me if a bib reference is stored in a .bib file. I suppose what I would like instead is a way to create a hyperlink that opens the corresponding record in Zotero if I cmd+click on it. Is there an easy way to do that?

StoltHD commented 3 years ago

I don't know if my use case warrants a separate issue:

Pandoc Citer does not really do much for me other than tell me if a bib reference is stored in a .bib file. I suppose what I would like instead is a way to create a hyperlink that opens the corresponding record in Zotero if I cmd+click on it. Is there an easy way to do that?

There is also a VS Code plugin for Zotero: https://marketplace.visualstudio.com/items?itemName=mblode.zotero

Or you can use the markdown addon for Zotero to create MD files of your Zotero items, notes and annotations,: https://github.com/argenos/zotero-mdnotes

mihaiconstantin commented 2 years ago

Today I discovered Foam, and the topic mentioned in this issue is the last box I want to tick before fully committing to it.

The way I currently do things, Zotero serves only one purpose, i.e., managing references. For example:

Now, with Foam, I want to create atomic notes based on what I read. And what I read falls into two categories:

  1. things that exist as a .pdf file in my Library
  2. things outside of my Library (e.g., blogs, presentations, videos, etc.)

For the second category, things are easy because I can add markdown links, which suffices to know where the idea originated. I could also do the same for the first category and just include the document's unique identifier (i.e., the DOI or ISBN) as a reference. But, since I already have a Library.bib file with unique keys for everything that lives in my Library, I think it would be nice to be able to:

I apologize for the lengthy comment, but I wanted to isolate the Zotero part (i.e., which I do not think is necessary to add to Foam) from the BibTeX citations part (i.e., which I think would be an excellent addition to Foam).

StoltHD commented 2 years ago

I apologize for the lengthy comment, but I wanted to isolate the Zotero part (i.e., which I do not think is necessary to add to Foam) from the BibTeX citations part (i.e., which I think would be an excellent addition to Foam).

Take a look at the addons I linked to, I think this one will do what you want... https://github.com/mblode/vscode-zotero

mihaiconstantin commented 2 years ago

@StoltHD this is definitely a good extension to know about, however, that is not exactly what I am looking for. Perhaps it is not clear from my comment above, but I would like to leave Zotero out of it.

For example, assuming that I have a .bib file, then what I am interested in is:

  1. to reference entries from the .bib file with autocomplete
  2. to see a pop-up with the citation information on-hover (e.g., author, title, year etc.)
  3. to see the citations rendered in the markdown preview window

For (3), let's say I have a note like the following:

---
bibliography: /Users/mihai/OneDrive/Library/Literature/Library.bib
---

# Note

This is a test note with some citations, e.g., @hastieElementsStatisticalLearning2009.
The references will be generated below under the *References* heading.

## References

Then, I would like in the markdown preview window to see:

image

The preview I show above was generated using the extension vscode-R, by running a pandoc command like this:

pandoc \
    +RTS -K512m -RTS note.md \
    --to html4 \
    --from markdown+autolink_bare_uris+tex_math_single_backslash \
    --output note.html \
    --self-contained \
    --standalone \
    --section-divs \
    --no-highlight \
    --citeproc

But I am really wondering whether this should belong to Foam or maybe vscode-markdown (i.e., one of the recommended extensions).

StoltHD commented 2 years ago

https://github.com/notZaki/PandocCiter

Dominic-DallOsto commented 2 years ago

@mihaiconstantin I just sent a PR for Pandoc Citer here that allows hover support for citation keys. And the extension already supports intellisense for citation keys. I think this resolves the first 2 of your 3 points. Point 3 might be possible using the Markdown Preview Enhanced extension, but I haven't tried that.

serranomorante commented 1 year ago

Markdown Preview Enhanced actually works pretty well [^*].

image

Export to PDF

You can also export that markdown file to PDF by:

  1. Right click on the markdown preview
  2. Click on "Open in browser"
  3. Ctrl+P from the browser to print as PDF

image

[^*]: But you need to use pandoc to render the preview instead of the default markdown-it. On vscode settings: "markdown-preview-enhanced.usePandocParser": true (please also install Pandoc on your operating system). With this option enabled, you will also need to change the math rendering from katex to mathjax for it to work properly. On vscode settings: "markdown-preview-enhanced.mathRenderingOption": "MathJax"

serranomorante commented 1 year ago

Btw, I still haven't found any Jekyll plugin capable of translating that citation syntax into a publishing format (on Vercel, for example).

I'll appreciate if you have any suggestions.