Closed jerabaul29 closed 1 year ago
I see there may be 2 different questions here actually:
assets
folder (possibly deeper)Let me know if I should split in 2 issues.
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)
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.
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?
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
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:
My Zotero folder (i.e., with the sqlite
database) lives in the cloud (e.g., OneDrive), so I can easily share the setup across multiple machines.
I also have a folder Library
in the cloud, where I manually add all .pdf
files that I want to keep for long-term storage (e.g., books, academic articles, slides, etc.).
When I want to add a new academic article, I place it in the Library
folder and then link the file at the current location in Zotero. By linking the file instead of attaching it, it stays in Library,
and it is not moved around by Zotero to a random folder. When linking a file, Zotero also extracts the metadata and creates a bibliography entry. When the extraction fails, I create one manually or automatically via an identifier (e.g., the DOI or ISBN).
By ensuring that I have an entry for each .pdf
file linked to Zotero, all my .pdf
files in the Library
folder are named consistently (i.e., "Author - year - Title"). This makes it convenient when searching for a file (e.g., via Spotlight).
Still, Zotero doesn't help me much when writing a paper because I use LaTeX
, and I need a .bib
file. So, I use the Zotero Better Bibtex addon that generates a big .bib
file from all the entries in Zotero. For convenience, I store this file in Library\Library.bib
. Then, for each new document I write, I can reference Library\Library.bib
. The handy thing about the Better Bibtex addon is that you can specify how (e.g., the format of the keys in the .bib
file) and when the .bib
file is generated (e.g., every time something changes in the Zotero library).
Finally, it may be disadvantageous when submitting a paper to attach the entire Library.bib
file since I only used a few references. But there are LaTeX
commands to create a smaller .bib
file with only the references cited. The same also holds for .md
files, since with pandoc
I can convert easily to .tex
files.
Now, with Foam, I want to create atomic notes based on what I read. And what I read falls into two categories:
.pdf
file in my Library
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:
tell Foam where to find the master Library.bib
file
be able to reference entries from Library.bib
with autocomplete (e.g., as Pandoc Citer
or Markdown Notes
VSCode extensions do. Markdown Notes
calls this feature Intellisense Completion for BibTeX Citations.
see the title, year, and author of a BibTeX
citation on hover (e.g., similar to what we get now when hovering over a wiki link). Again, Markdown Notes
calls this Peek Definition for BibTeX Citations, but this is a peek definition, which, in my opinion, is not as pretty as a pop-up.
It would also be handy to see the rendered reference in the markdown preview panne (e.g., as generated by pandoc --citeproc
). But it is, in my opinion, not a necessity because we can simply take the atomic note and run it manually through pandoc
, or even automate this with a shell script. What I think matters the most is to have intellisense for linked .bib
files and preview citations on hover.
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).
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
@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:
.bib
file with autocompleteFor (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:
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).
@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.
Markdown Preview Enhanced actually works pretty well [^*].
You can also export that markdown file to PDF by:
Ctrl+P
from the browser to print as PDF[^*]: 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"
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.
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 :) )