diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 506930fbd..24280177c 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -798,6 +798,7 @@ between the two." "+" #'org-ctrl-c-minus "," #'org-switchb "." #'org-goto + "@" #'org-cite-insert (:when (featurep! :completion ivy) "." #'counsel-org-goto "/" #'counsel-org-goto-all) diff --git a/modules/tools/biblio/README.org b/modules/tools/biblio/README.org index 838319bc8..4a79a26c6 100644 --- a/modules/tools/biblio/README.org +++ b/modules/tools/biblio/README.org @@ -1,6 +1,6 @@ #+TITLE: tools/biblio #+DATE: April 11, 2020 -#+SINCE: 3.0 +#+SINCE: 21.12.0 (#5290) #+STARTUP: inlineimages * Table of Contents :TOC_3:noexport: diff --git a/modules/tools/biblio/config.el b/modules/tools/biblio/config.el index a0dbc8ba8..57cf700ca 100644 --- a/modules/tools/biblio/config.el +++ b/modules/tools/biblio/config.el @@ -1,61 +1,55 @@ ;;; tools/biblio/config.el -*- lexical-binding: t; -*- +;; +;;; `org-cite' + +(use-package! oc + :defer t + :config + (setq org-cite-global-bibliography + (doom-enlist + (or (bound-and-true-p citar-bibliography) + (bound-and-true-p bibtex-completion-bibliography))) + ;; 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! :completion vertico) + :when (featurep! :lang org +roam2) + :defer t + :config + ;; Include property drawer metadata for 'org-roam' v2. + (setq citar-org-note-include '(org-id org-roam-ref))) + + (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 tells bibtex-completion to look at the File field of the bibtex to figure out which pdf to open + ;; Tell bibtex-completion to look at the File field of the bibtex to + ;; figure out which pdf to open: + bibtex-completion-pdf-field "file")) + (use-package! ivy-bibtex :when (featurep! :completion ivy) :defer t :config (add-to-list 'ivy-re-builders-alist '(ivy-bibtex . ivy--regex-plus))) - - -;;; 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 - :no-require - :when (featurep! :lang org +roam2) - :config - ;; Include property drawer metadata for 'org-roam' v2. - (setq citar-org-note-include '(org-id org-roam-ref)))