refactor(biblio): reformat module
- Defer citar-org, since citar autoloads it. - Add introducing PR to #+SINCE and use new calver scheme. - Move <localleader> @ keybind to :lang org Ref: #5810
This commit is contained in:
parent
2489637bc1
commit
45ee0ecf21
3 changed files with 43 additions and 48 deletions
|
@ -798,6 +798,7 @@ between the two."
|
||||||
"+" #'org-ctrl-c-minus
|
"+" #'org-ctrl-c-minus
|
||||||
"," #'org-switchb
|
"," #'org-switchb
|
||||||
"." #'org-goto
|
"." #'org-goto
|
||||||
|
"@" #'org-cite-insert
|
||||||
(:when (featurep! :completion ivy)
|
(:when (featurep! :completion ivy)
|
||||||
"." #'counsel-org-goto
|
"." #'counsel-org-goto
|
||||||
"/" #'counsel-org-goto-all)
|
"/" #'counsel-org-goto-all)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#+TITLE: tools/biblio
|
#+TITLE: tools/biblio
|
||||||
#+DATE: April 11, 2020
|
#+DATE: April 11, 2020
|
||||||
#+SINCE: 3.0
|
#+SINCE: 21.12.0 (#5290)
|
||||||
#+STARTUP: inlineimages
|
#+STARTUP: inlineimages
|
||||||
|
|
||||||
* Table of Contents :TOC_3:noexport:
|
* Table of Contents :TOC_3:noexport:
|
||||||
|
|
|
@ -1,61 +1,55 @@
|
||||||
;;; tools/biblio/config.el -*- lexical-binding: t; -*-
|
;;; 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
|
(use-package! bibtex-completion
|
||||||
:when (or (featurep! :completion ivy)
|
:when (or (featurep! :completion ivy)
|
||||||
(featurep! :completion helm))
|
(featurep! :completion helm))
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(setq bibtex-completion-additional-search-fields '(keywords)
|
(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
|
(use-package! ivy-bibtex
|
||||||
:when (featurep! :completion ivy)
|
:when (featurep! :completion ivy)
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(add-to-list 'ivy-re-builders-alist '(ivy-bibtex . ivy--regex-plus)))
|
(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)))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue