jalvesaq / zotcite

Neovim plugin for integration with Zotero
GNU General Public License v3.0
174 stars 15 forks source link

Use @citekey to cite document #75

Closed anandkumar89 closed 8 months ago

anandkumar89 commented 8 months ago

I mostly use @citekey to cite references (in latex, markdown, obsidian). I am not sure how to achieve this using zotcite.

Since zotero database is being read, would it not be possible to use @zoteroKey#citekey from betterbibtex to create a citation format just for the sake of maintaining uniformity across all notes. citekeys are available in better-bibtex.sqlite (table citationkey)

Screenshot 2024-03-16 at 5 50 59 PM


An alternative implementation using bib file: (could ignore this section) Automatically exported and updated zotero .bib file could be used for autocompletion/citing and using zotero database only when it is required to extract notes (stored in database). Benefit is ability to use zotcite for citations (just want to cite, but not extract notes) even when zotero is not available. When zotero is installed, bibfile could allow faster processing (not sure).

setup from zotero side would require using zotero + better_bibtex.

Implementation: to recover notes all we need is zoterokey and file_path. zoterokey could be either retrieved from file in exported bib

Screenshot 2024-03-16 at 5 51 25 PM

for people who use zotfile or linked file - zoterokey could be found from citekey in better-bibtex.sqlite (table citationkey)

jalvesaq commented 8 months ago

Since zotero database is being read, would it not be possible to use @zoteroKey#citekey from betterbibtex to create a citation format just for the sake of maintaining uniformity across all notes. citekeys are available in better-bibtex.sqlite (table citationkey)

The #citekey part is deleted before running the citeproc filter. It might be anything, and there would be no problem if it were a betterbibtex citation key, but I can't see any benefit of using betterbibtex to write something that will be deleted. You should get about the same result with:

let $ZCitationTemplate = '{Authors}{Year}

Benefit is ability to use zotcite for citations (just want to cite, but not extract notes) even when zotero is not available.

Please, see the documentation on :Zrefs. You can use it to include the references in the YAML header. Please, also search for "zotcite.bib" in the documentation. If you put bibliography: "anyname_zotcite.bib" in the YAML header, zotcite will update the bibfile.