2020-04-09 16:47:48 -04:00
|
|
|
;;; tools/biblio/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2021-11-22 14:21:19 +01:00
|
|
|
;;
|
|
|
|
;;; `org-cite'
|
2021-10-27 17:33:04 -04:00
|
|
|
|
|
|
|
(use-package! oc
|
2021-11-22 14:21:19 +01:00
|
|
|
:defer t
|
2021-10-27 17:33:04 -04:00
|
|
|
:config
|
|
|
|
(setq org-cite-global-bibliography
|
2022-08-07 12:24:14 +02:00
|
|
|
(ensure-list
|
2021-11-22 14:21:19 +01:00
|
|
|
(or (bound-and-true-p citar-bibliography)
|
|
|
|
(bound-and-true-p bibtex-completion-bibliography)))
|
|
|
|
;; Setup export processor; default csl/citeproc-el, with biblatex for
|
2021-10-27 17:33:04 -04:00
|
|
|
;; latex
|
2021-11-22 14:21:19 +01:00
|
|
|
org-cite-export-processors '((latex biblatex) (t csl))
|
2021-10-27 17:33:04 -04:00
|
|
|
org-support-shift-select t))
|
|
|
|
|
|
|
|
|
2021-11-23 13:14:38 +01:00
|
|
|
(use-package! citar
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! :completion vertico)
|
2021-11-23 13:14:38 +01:00
|
|
|
:no-require
|
|
|
|
:config
|
|
|
|
(setq org-cite-insert-processor 'citar
|
|
|
|
org-cite-follow-processor 'citar
|
2023-03-23 19:51:55 -04:00
|
|
|
org-cite-activate-processor 'citar)
|
|
|
|
(when (modulep! :completion vertico +icons)
|
|
|
|
(defvar citar-indicator-files-icons
|
|
|
|
(citar-indicator-create
|
2023-09-14 00:03:55 +01:00
|
|
|
:symbol (nerd-icons-faicon
|
|
|
|
"nf-fa-file_o"
|
|
|
|
:face 'nerd-icons-green
|
2023-03-23 19:51:55 -04:00
|
|
|
:v-adjust -0.1)
|
|
|
|
:function #'citar-has-files
|
|
|
|
:padding " " ; need this because the default padding is too low for these icons
|
|
|
|
:tag "has:files"))
|
|
|
|
(defvar citar-indicator-links-icons
|
|
|
|
(citar-indicator-create
|
2023-09-14 00:03:55 +01:00
|
|
|
:symbol (nerd-icons-faicon
|
|
|
|
"nf-fa-link"
|
|
|
|
:face 'nerd-icons-orange
|
2023-03-23 19:51:55 -04:00
|
|
|
:v-adjust 0.01)
|
|
|
|
:function #'citar-has-links
|
|
|
|
:padding " "
|
|
|
|
:tag "has:links"))
|
|
|
|
(defvar citar-indicator-notes-icons
|
|
|
|
(citar-indicator-create
|
2023-09-14 00:03:55 +01:00
|
|
|
:symbol (nerd-icons-codicon
|
|
|
|
"nf-cod-note"
|
|
|
|
:face 'nerd-icons-blue
|
2023-03-23 19:51:55 -04:00
|
|
|
:v-adjust -0.3)
|
|
|
|
:function #'citar-has-notes
|
|
|
|
:padding " "
|
|
|
|
:tag "has:notes"))
|
|
|
|
(defvar citar-indicator-cited-icons
|
|
|
|
(citar-indicator-create
|
2023-09-14 00:03:55 +01:00
|
|
|
:symbol (nerd-icons-faicon
|
|
|
|
"nf-fa-circle_o"
|
|
|
|
:face 'nerd-icon-green)
|
2023-03-23 19:51:55 -04:00
|
|
|
:function #'citar-is-cited
|
|
|
|
:padding " "
|
|
|
|
:tag "is:cited"))
|
|
|
|
(setq citar-indicators
|
|
|
|
(list citar-indicator-files-icons
|
|
|
|
citar-indicator-links-icons
|
|
|
|
citar-indicator-notes-icons
|
|
|
|
citar-indicator-cited-icons))))
|
2021-11-23 13:14:38 +01:00
|
|
|
|
2022-08-02 20:06:17 -04:00
|
|
|
(use-package! citar-embark
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! :completion vertico)
|
2022-08-02 20:06:17 -04:00
|
|
|
:after citar embark
|
|
|
|
:config (citar-embark-mode))
|
|
|
|
|
2022-08-21 07:26:08 -04:00
|
|
|
(use-package! citar-org-roam
|
2023-03-23 19:47:56 -04:00
|
|
|
:when (and (modulep! +roam2)
|
|
|
|
(modulep! :completion vertico))
|
2022-08-21 07:26:08 -04:00
|
|
|
:after citar org-roam
|
|
|
|
:config (citar-org-roam-mode))
|
|
|
|
|
2021-11-22 14:21:19 +01:00
|
|
|
;; `org-cite' processors
|
|
|
|
(use-package! oc-biblatex :after oc)
|
|
|
|
(use-package! oc-csl :after oc)
|
|
|
|
(use-package! oc-natbib :after oc)
|
2021-10-27 17:33:04 -04:00
|
|
|
|
|
|
|
|
2021-11-22 14:21:19 +01:00
|
|
|
;;
|
|
|
|
;;; Third-party
|
2021-10-27 17:33:04 -04:00
|
|
|
|
2021-11-22 14:21:19 +01:00
|
|
|
(use-package! bibtex-completion
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (or (modulep! :completion ivy)
|
|
|
|
(modulep! :completion helm))
|
2021-11-22 14:21:19 +01:00
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
(setq bibtex-completion-additional-search-fields '(keywords)
|
|
|
|
;; 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
|
2022-08-12 20:29:19 +02:00
|
|
|
:when (modulep! :completion ivy)
|
2021-11-22 14:21:19 +01:00
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
(add-to-list 'ivy-re-builders-alist '(ivy-bibtex . ivy--regex-plus)))
|