feat(biblio): add org-cite, citeproc

This commit is contained in:
Bruce D'Arcus 2021-10-27 17:33:04 -04:00
parent b66aaf9e9f
commit 3047430739
3 changed files with 49 additions and 6 deletions

View file

@ -85,6 +85,7 @@
:tools
;;ansible
;;biblio ; Writes a PhD for you (citation needed)
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
;;docker

View file

@ -1,11 +1,12 @@
;;; tools/biblio/config.el -*- lexical-binding: t; -*-
(use-package! bibtex-completion
:when (or (featurep! :completion ivy)
(featurep! :completion helm))
:defer t
:config
(setq bibtex-completion-additional-search-fields '(keywords)
bibtex-completion-pdf-field "file"));; This tell bibtex-completion to look at the File field of the bibtex to figure out which pdf to open
bibtex-completion-pdf-field "file"));; This tells bibtex-completion to look at the File field of the bibtex to figure out which pdf to open
(use-package! ivy-bibtex
:when (featurep! :completion ivy)
@ -14,7 +15,46 @@
(add-to-list 'ivy-re-builders-alist '(ivy-bibtex . ivy--regex-plus)))
(use-package! citar
:when (featurep! :completion vertico)
:after embark
:defer t)
;;; Org-Cite configuration
(use-package! oc
:after org
:config
(map! :map org-mode-map
:localleader
:desc "Insert citation" "@" #'org-cite-insert)
(setq org-cite-global-bibliography
(let ((paths
(cond
((boundp 'citar-bibliography) citar-bibliography)
((boundp 'bibtex-completion-bibliography) bibtex-completion-bibliography))))
;; Always return bibliography paths as list for org-cite.
(if (stringp paths) (list paths) paths))
;; setup export processor; default csl/citeproc-el, with biblatex for
;; latex
org-cite-export-processors
'((latex biblatex)
(t csl))
org-cite-insert-processor 'citar
org-cite-follow-processor 'citar
org-cite-activate-processor 'citar
org-support-shift-select t))
;;; Org-cite processors
(use-package! oc-biblatex
:after oc)
(use-package! oc-csl
:after oc)
(use-package! oc-natbib
:after oc)
;;;; Third-party
(use-package! citar-org
:when (featurep! :lang org +roam2)
:config
;; Include property drawer metadata for 'org-roam' v2.
(setq citar-org-note-include '(org-id org-roam-ref)))

View file

@ -8,3 +8,5 @@
(package! helm-bibtex :pin "b85662081de98077f13f1a9fac03764702325d28"))
(when (featurep! :completion vertico)
(package! citar :pin "fd33f5c4f7981036a969b5ca8aaf42380848ab32"))
(package! citeproc :pin "0857973409e3ef2ef0238714f2ef7ff724230d1c")