The plugin will have to do some caching of the cite keys as the .bib/CSL JSON updates. Hopefully the Plugin API will have hooks to the completion UI/logic for the current link completion, then the cache can be used there. That would satisfy the idea of the cite key as being a node as well.
I have to mention though that pandoc-style markdown citations are [@key] as opposed to [[@key]]. So any export functionality should provide an option to keep the one pair of brackets I guess (there is a thread over at Feature requests asking for a way that automatically removes both the pairs of brackets on export).
I went onto the Zotero forums and asked, What do app developers need to do to ākeep the door openā for full Zotero integration? I wanted to know if there was anything that Obsidian developers might wish theyād known early on if theyāre interested in eventually having the kind of awesome, polished, āfirst-classā Zotero integration that is currently enjoyed only by MS Word, LibreOffice, and Google Docs.
(Zettlr, Sublime Text, and some other apps have integration too, but the UX isnāt on the same level as the type of integration in MS Word, LibreOffice, and Google Docs. If you donāt care about the difference between first- and second-class Zotero integration, then thatās fine. Iām not going to tell you what you should care about. More broadly, Iām not going debate the value of UX here. Sorry if this comes off as defensive, Iām just very tired of this particular conversation.)
The first responses I got were from a couple Zotero devs who are regulars on their forums. They said that Zotero has tons of extension points, and that theyāre more than willing to help anybody who comes and asks questions ā which is obviously great!
I tried coming at the question of āWhat can be done to make it as easy as possible?ā from a few different directions. This briefly frustrated them because they felt like there was little more to add than to reassure me that nothing special needs to be done, no deal with Zotero needs to be struck, and that thereās no general advice to be given. Basically, it just takes a little time and work, and they didnāt have anything else to say. They agreed to this summary:
Anybody who wants Zotero integration for their project can have it. It can work like it does in MS Word, or it can work like it does in Zettlr. Thereās no need to do anything weird or special to get it working. There are ample extension points in Zotero, and the devs are happy to answer questions.
I was about ready to settle for that, but then one of the devs who actually works on the kind integration I was talking about showed up. His insight was much more specific:
To chime in from an actual dev of the āfirst-classā integrations. Firstly, we have the docs which, while maybe not the best formatted and crystal clear, should at least give a good idea for doc editor developers on what they need to prepare for to be able to provide a Zotero plugin, and if that fails, we answer questions on zotero-dev. In fact, I know TextMaker is planning to release (or perhaps has already released) a fully functional āfirst-classā Zotero integration in their editor, to my knowledge without ever getting any support from Zotero devs.
Secondly, most of the work in providing Zotero integration plugin is not in talking to Zotero, but in implementing the actual logic. Zotero requires 2 specific functionalities from the document format:
- You must be able to associate metadata with parts of the text that are Zotero citations . Zotero needs to know which parts of the document are its citations and be able to store metadata required to update them. In Word itās Fields, in LibreOffice itās ReferenceMarks and in Google Docs itās madness-fueled NamedRanges and links.
- You must be able to store text location non-specific, i.e. global metadata in the document. This is where Zotero stores things like the citation style used by the document and other prefs.
Depending on how close to the metal of the original doc editor a plugin developer works, accessing these 2 functionalities of a doc editor can be super easy and convenient, which makes implementing the plugin also relatively easy, or enragingly frustrating and difficult. We would love to provide first-class integration for other popular document editing options, but we simply donāt have enough time to do that given how complicated it is and how much work it takes to simply maintain the 3 (actually 4, since mac word and win word do not share code) existing integrations.
So, I hope that the Obsidian devs see this so that they can at least keep it in the back of their minds. Iām crossing my fingers for āfirst-classā Zotero integration, and early considerations thatāll make that easy later will significantly increase the chances of getting it.
Going by what the MS Word integration provides, would first-class integration also involve generating a bibliography section in the markdown file itself?
Because Iām assuming all other functionality it provides, including auto-completion can be accomplished via the .bib/CSL file alone. This makes it agnostic of reference manager as well.
But then as in some of the replies in the Zotero thread, plain-text notetaking and Document preparation are 2 separate steps, pandoc being the converter between them, handling citation styles and the like. I do understand your idea of a (graphical) UX but do you see it feasible in Obsidian given that we canāt have block level access (it is but a .md file), hence canāt give access to specific areas of text to the plugin, like the other integrations? I see both the points mentioned by the dev are fundamentally violated by the plaintext philosophy of Obsidian. Zettlrās UX in that sense is reasonable, though also plaintext, it has graphical export options which call pandoc and other command-line utilities in the background.
For Obsidian the best path would be something like Zettlr or Rmarkdown went
- Citation picker which could be reference manager independent:
- Examples would be be used in Zelltr Citr or VSC Zotero Citation Picker
- It would be great if the citation could link to pdf in the Zotero library (Zettlr could do that when using JSON )
- Full citation and bibliography could be rendered within preview (with some settings using Pandoc how they are rendered) the example would be preview within Rstudio, Zettlr is doing that differently by using a different pane
- In the distant future when Obsidian WISIWYG will exist it could be maybe combined in one view (but itās will depends how the WISIWYG will be implemented)
As with most UX matters, I think taking a second to formulate a couple personas might be beneficial here.
Persona 1: Taylor
- Age: 26
- Profession: Software engineer.
- Main goal: A place to record interesting thoughts to help explore curiosities and remember ideas for apps.
- Likes: Using things in the way they are intended to be used.
- Dislikes: Breaking our going outside of established standards.
- Confused by: Why anybody would want any WYSIWYG functionality in apps that arenāt built to be WYSIWYG from top to bottom.
- Quote: āPlaintext files are elegant because theyāre strictly plaintext. If someone wants to do more than record and display plaintext, then they shouldnāt use a plaintext editor.ā
Persona 2: Alex
- Age: 37
- Profession: Anthropology PhD candidate.
- Main goal: A better way of organizing his knowledge to help write research papers.
- Likes: Feeling like his tools are serving him instead of the other way around
- Dislikes: When software gets in the way ā especially when heās told that the obstacle is a feature instead of a bug.
- Confused by: Any code more complicated than the most basic parts of markdown formatting (italic, bold, headers, lists, and quotes).
- Quote: āWhen the code helps me think, show the code. When it just makes things more opaque, hide the code. I just want to get across the finish line easily and efficiently.ā
These are incredibly basic personas, but I think theyāre enough to let us begin reasoning about what different kinds of users might want. Instead of saying vague things like āusers will want to do Xā (which makes the user into an elastic entity that stretches and bends to fit any ideas whatsoever), forcing ourselves to instead ask āWhat would Terry/Alex want?ā will keep us focused on making sure that the way we are imagining features actually serves the goals of the users.
Anyway, I imagine that Terry and Alex would want different things here. Terry would probably want Obsidian to implement Zotero integration the same way that itās done with Zettlr and Sublime Text. Meanwhile, Alex would probably rather it be done in the kind of live preview way that Typora renders everything, looking to the way that Zotero designed the plugins for MS Word, LibreOffice, and Google Docs for ideas about what a GUI control panel might look like.
I donāt think Terry is better than Alex or vice versa. They just have different goals and values. So, they want different things from Obsidian.
Perhaps thereās a way of approaching this thatāll let Terry and Alex both be happy. Maybe itās as simple as having a preference toggle to switch between āShow the code in the editorā and āRender the output in the editor.ā As an interaction designer, this is the solution that Iād recommend, but of course it depends on whether or not the programmers can figure out how to implement the idea.
Edit: If one of the Obsidian devs would like me to produce mockups of the solution Iām proposing (no, not just what the toggle would look like in the preferences; I mean mocking up what the functionality would actually look in both modes), then let me know. I care enough about this functionality that Iād be willing to put the time into doing this.
-
These goals are not incompatible. The important points you are discussing @ SquareBottle are more general questions about how WYSIWYG from UX-point-view should be implemented, not specific to Zotero.
-
I think Zotero plugin is quite low now on priority list of developers, the highest chance for getting it when someone will implement it after the API will be exposed.
-
From the design objectives āObsidian as Markdown editorā is quite unlikely we get something like Google Docs of MS Words. I want to have Obsidian with live markdown preview, but Google docs or MS Word Zotero implementation goes against plaintext philosophy - so clean LateX style citation with \cite{} or more markdown style @ (together with implemented citation picker) which could be rendered to actual citations/bibliography in WYSIWYG mode
-
I agree that the most probable is a currently implemented solution about which @ SquareBottle write: >>having a preference toggle to switch between āShow the code in the editorā and āRender the output in the editor.ā<<
So, is there any smooth way to cite using Zotero? Or now it is just better to use Zettlr for such purposes
Could someone please navigate me, since its seems pretty complicated for me as Mac user
I thought it was relatively easy to copy+paste citations from Zotero already into ant text app - from their manual:
āZotero can also insert citations and bibliographies into any text field or program. Simply drag-and-drop items, use Quick Copy to send citations to the clipboard, or export them directly to a file.ā
Is that not the case?
+1 to this, would love to be able to autofill citekeys from a .bib file like you can in Zettlr. Hit @ and be able to auto complete your reference library
I also discovered the zotero-roam-export
plugin a few weeks back and opened an issue about the markdown export. It didnāt look very promising, so Iāve since then spent some time writing a plugin for Zotero that works for my own workflow.
I only briefly used Zettlr, and so far I donāt see myself using Obsidian to write papers directly, so I donāt need the full citation powers that Zettlr offers (at least so far!). In my case, even pandoc has its limitations, which is why I end up writing the paper using LaTeX anyways. For me, Obsidian is useful to keep my (often private) notes, and relating ideas from what Iāve read or highlighted to some other idea that Iām working on, which is why I keep two different files for the same paper: one with my notes linking to the one with the information for Zotero (that way, if needed, I can fully rewrite the latter with a (newer) export, without losing my notes in the former).
The plugin I wrote is based on the zotero-roam-export
plugin and in short, my plugin does the following:
- Extracts metadata from the item and highlights from the PDF using Zotfile (similar to
zotero-roam-export
) and saves it in a markdown file. I get one file for each item selected. I can save directly in my vault, and I can (optionally) choose to use cite keys (using Better Bibtex) as file names e.g.doe2020aaaa-zotero.md
- Creates a file for my own notes based on the naming above (minus the suffix)
doe2020aaaa.md
, and transcludes the metadata, links to the highlights/annotations, and adds a header for my notes. This is the one I use to link when I refer to the whole paper and as a sort of table of contents around specific ideas of that paper, i.e. I can āciteā the paper as[[doe2020aaaa]]
. - Adds all those files as linked attachments to the Zotero item, so that if I double click the markdown note is opened with the default markdown app from Zotero (if eventually the URL protocol is implemented, then the link can easily be switched to include
obsidian://
). This basically lets me go from one app to the other. In Obsidian, in thedoe2020aaaa
file I can write my own notes, and in preview mode I can also click on a link in that opens Zotero and selects the right item. In Zotero I can double click to edit my notes, or open it in Obsidian.
If this sounds like it might be useful to someone here, I can share the Zotero extension.
Disclaimer: This is my first time coding anything Javascript or Zotero-related and I canāt really guarantee that it will work well or efficiently. I learned a lot and reused some parts of the zotero-roam-export
in order to get the plugin working for myself (so far so good).
Finally, I have a question for those that use Zettlr or want a Zettlr-like way to cite within Obsidian. What does your (expected) workflow look like? Do you use Zettlr/Obsidian to create PDFs and render citations? How would the citation in Obsidian look like? Do/Would you also create a note for the paper itself? And if so, when do you āciteā and when do you link to the note, i.e. [See @doe2020aaaa]
vs See [[doe2020aaaa]]
?
Edit: Hereās the plugin https://github.com/argenos/zotero-mdnotes
The standalone post with my workflow (slightly updated since) is here: Zotero plugin to export metadata and notes to markdown
Wonderful job! Thanks a lot!
Zettlr has integration with auto-exported library file from Zotero. Basically, it offers suggestions once you start typing [@
in the editor. Itās convenient as a substitution for MS Word plugin, but the functionality is quite basic.
Hi, thanks for your sharing. I have downloaded your plugin and it works well.
How can you import these files into the Obsidian? I can drag the file into a new note in Obsidian and make it as an attachment. Is this the right way?
If you go to Tools > Mdnotes preferences
you can set the path to your vault (or a folder within it) so that itās the starting folder whenever you export anything. Thatās just to set the starting path, so you donāt have to choose it manually each time, but in the end the notes will be exported on whichever path you choose.
Great! It helps a lot.
Thanks for your prompt reply.
Wow ! really appreciate your work on hours of working for this zotero integration , ,i have installed them on Zotero and ,i have set the path folder where the obsidian vault folder for ZOTFILE ,BETTERBIBTEX and MDPREFRENCES.
I couldnāt comprehend beyond this ,for my capacity .
well i guess i am a bit thick skulled lol ,could there be any gif or some demonstration after this as an example file or folder ?(apologies if i am wasting your time ).
Do you mean something like this? Here is a small gif showing batch export as well.
After youāve set your path, right click on the item you want to export (I added a small cheat sheet of what to select here). If you choose a path inside your vault during the export, you just need to go back to Obsidian and open the files there.
Is it possible to adapt/reuse one of the plugins for Zettlr, Atom, Sublime? Adding bibliographical references is the only serious thing tha is currently missing.
Unfortunately, I have no idea. I think these are all different pieces of software so weāll need to wait either until the guys at Obsidian implement it or they create an API / plugin interface so that other people can help with certain featuresā implementation.
Meanwhile, thereās a universal Zotero picker for Windows, give it a go.
I am on Mac , but thanks. I will keep copy/pasting bibtex codes.
Have you tried this method with Automator?