2020-04-09 16:47:48 -04:00
|
|
|
;;; tools/biblio/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2020-04-16 13:53:39 +04:00
|
|
|
(use-package! bibtex-completion
|
2021-10-27 17:33:04 -04:00
|
|
|
:when (or (featurep! :completion ivy)
|
|
|
|
(featurep! :completion helm))
|
2020-04-16 13:53:39 +04:00
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
(setq bibtex-completion-additional-search-fields '(keywords)
|
2021-10-27 17:33:04 -04:00
|
|
|
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
|
2020-04-16 13:53:39 +04:00
|
|
|
|
2020-04-09 16:47:48 -04:00
|
|
|
(use-package! ivy-bibtex
|
|
|
|
:when (featurep! :completion ivy)
|
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
(add-to-list 'ivy-re-builders-alist '(ivy-bibtex . ivy--regex-plus)))
|
2021-04-28 23:07:22 +03:00
|
|
|
|
|
|
|
|
2021-10-27 17:33:04 -04:00
|
|
|
;;; 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
|
2021-11-22 12:07:29 +09:00
|
|
|
:no-require
|
2021-10-27 17:33:04 -04:00
|
|
|
:when (featurep! :lang org +roam2)
|
|
|
|
:config
|
|
|
|
;; Include property drawer metadata for 'org-roam' v2.
|
|
|
|
(setq citar-org-note-include '(org-id org-roam-ref)))
|