V1 of Zotero Org Roam integration finished

This commit is contained in:
paul-loedige
2024-01-07 20:32:47 +01:00
parent 922e571dc4
commit 659dd5ad60
+41 -3
View File
@@ -525,7 +525,7 @@ Adding the "#+category: " tag improves the Org Agenda View for tasks captured in
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+category: ${title}\n") :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+category: ${title}\n")
:unnarrowed t) :unnarrowed t)
("m" "Meeting Templates") ("m" "Meeting Templates")
("mm" "Besprechung Masterarbeit" plain ("mm" "Meeting Masterarbeit" plain
"* Aktueller Stand\n\n* Offene Fragen\n\n* TODOs\n" "* Aktueller Stand\n\n* Offene Fragen\n\n* TODOs\n"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: Masterarbeitsbesprechung ${title}\n#+category: Masterarbeit\n") :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: Masterarbeitsbesprechung ${title}\n#+category: Masterarbeit\n")
:unnarrowed t)))) :unnarrowed t))))
@@ -543,7 +543,45 @@ Because the normal shortcut for `org-open-at-point` is quite cumbersome I want i
(package! org-transclusion) (package! org-transclusion)
#+end_src #+end_src
** Bibliography ** Bibliography
as per [[https://github.com/doomemacs/doomemacs/tree/master/modules/tools/biblio][Doom Emacs documentation]] the path to the .bib file needs to be defined *** Enabling Zotero Links
Following [[https://www.riccardopinosio.com/blog/posts/zotero_notes_article.html#opening-zotero-pdf-from-org-roam][this guide]] we enable using zotero links with the following code
#+begin_src emacs-lisp :tangle config.el #+begin_src emacs-lisp :tangle config.el
(setq! citar-bibliography '("~/org/biblio.bib")) (after! org
:custom
(org-link-set-parameters "zotero" :follow
(lambda (zpath)
(browse-url
(format "zotero:%s" zpath)))))
#+end_src
*** Citar Config
**** Setting the Citar Bibliography
Following the [[https://github.com/doomemacs/doomemacs/tree/master/modules/tools/biblio][Doom Emacs documentation ]]we set the citar bibliography and notes paths
#+begin_src emacs-lisp :tangle config.el
(after! oc
(setq citar-bibliography '("~/org/biblio.bib"))
(setq citar-notes-paths '("~/org/org-roam/")))
#+end_src
**** Citar Templates
Following the [[https://github.com/emacs-citar/citar#configuration][citar package documentation]] we modify the note template to contain the pdf link to Zotero
*NOTE:* This requires the a [[https://www.riccardopinosio.com/blog/posts/zotero_notes_article.html#opening-zotero-pdf-from-org-roam][specific Zotero Export Configuration]]
#+begin_src emacs-lisp :tangle config.el
(after! oc
(setq citar-templates
'((main . "${author editor:30%sn} ${date year issued:4} ${title:48}")
(suffix . " ${=key= id:15} ${=type=:12} ${tags keywords:*}")
(preview . "${author editor:%etal} (${year issued date}) ${title}, ${journal journaltitle publisher container-title collection-title}.\n")
(note . "Notes on ${author editor:%etal}, ${title}\npdf: ${file}"))))
#+end_src
**** Enable Zotero Link Support
In [[https://www.riccardopinosio.com/blog/posts/zotero_notes_article.html#citar][this tutorial]] I found the config for enabling Zotero Link Support through Citar
#+begin_src emacs-lisp :tangle config.el
(defadvice! riccardo/citar-file-trust-zotero (oldfun &rest r)
"Leave Zotero-generated file paths alone, especially zotero://..."
:around '(citar-file-open citar-file--find-files-in-dirs)
(cl-letf (((symbol-function 'file-exists-p) #'always)
((symbol-function 'expand-file-name) (lambda (first &rest _) first)))
(apply oldfun r)))
(after! citar
(add-to-list 'citar-file-open-functions '("pdf" . citar-file-open-external)))
#+end_src #+end_src