Created
October 28, 2022 01:41
-
-
Save thriveth/f961e42dea4988f464ea67d2d6febbb1 to your computer and use it in GitHub Desktop.
minimal-ish Emacs config to work with Bibliographies and references
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "https://melpa.org/packages/") t) | |
(package-initialize) | |
(require 'use-package) | |
(setq custom-file (expand-file-name "emacs-custom.el" user-emacs-directory)) | |
(load custom-file) | |
;;;========================================================================== | |
;;; Discoverability tools, for a minimal, discoverable Emacs experience | |
;;;========================================================================== | |
;; Which-key does not alter Emacs' behavior but shows you context-aware help, | |
;; making it easier to discover Emacs' functionality. | |
(use-package which-key | |
:ensure t | |
:init | |
(which-key-mode) | |
) | |
;; Another package which helps with discoverability. | |
;; Can be customized a lot, but just using standard settings for now. | |
(use-package vertico | |
:ensure t | |
:init | |
(vertico-mode) | |
) | |
;; Consult helps with better selection functions and works nicely with Emacs | |
;; Example configuration for Consult copied | |
(use-package consult | |
:ensure t | |
;; Enable automatic preview at point in the *Completions* buffer. This is | |
;; relevant when you use the default completion UI. | |
;:hook (completion-list-mode . consult-preview-at-point-mode) | |
:init | |
(recentf-mode) | |
) | |
;; Marginalia provides helpful extra information in the Vertico suggestions area. | |
(use-package marginalia | |
:ensure t | |
:init | |
(marginalia-mode)) | |
;; Embark provides quick-access actions to stuff in the Narrowing frameworks | |
;; and normal buffers. Kind of like a right-click menu with no clicks. | |
(use-package embark | |
:ensure t | |
:bind | |
(("C-." . embark-act)) | |
) | |
(use-package embark-consult | |
:ensure t | |
:after (embark consult) | |
) | |
;; Orderless is not strictly necessary, but very nice and I do not want to live without it. | |
(use-package orderless | |
:ensure t | |
:custom | |
(completion-styles '(orderless basic)) | |
(completion-category-overrides '((file (styles basic partial-completion)))) | |
) | |
;;;========================================================================== | |
;;; Now to the bibiliography relevant stuff. | |
;;;========================================================================== | |
;; Org-roam: Zettelkasten-like note handling for Emacs/Org-mode | |
(use-package org-roam | |
:ensure t | |
:custom | |
(org-roam-directory (file-truename "/home/user/roamdir/")) | |
:config | |
(org-roam-setup) | |
) | |
(use-package org-roam-bibtex | |
:ensure t | |
:config | |
(setq orb-note-actions-interface 'hydra) | |
(setq orb-preformat-keywords | |
'("citekey" "title" "url" "author-or-editor" "keywords" "file") | |
orb-process-file-keyword t | |
orb-file-field-extensions '("pdf") | |
) | |
(org-roam-bibtex-mode) | |
) | |
;; Org-ref: More better citation and reference handling. | |
(use-package org-ref | |
:ensure t | |
:config | |
(setq bibtex-completion-bibliography "/home/user/main.bib" ) | |
(setq bibtex-completion-library-path "/home/user/pdfdir/") | |
(setq biblio-download-directory "/home/user/pdfdir/") | |
(advice-add #'completing-read-multiple :override #'consult-completing-read-multiple) | |
(require 'org-ref) | |
(require 'doi-utils) | |
) | |
;; Citar | |
(use-package citar | |
:ensure t | |
:custom | |
(citar-open-note-function 'orb-citar-edit-note) | |
(citar-select-multiple t) | |
(citar-notes-paths '("/home/user/roamdir/")) | |
(citar-library-paths '("/home/user/pdfdir/")) | |
(advice-add #'completing-read-multiple :override #'consult-completing-read-multiple) | |
(org-cite-follow-processor 'citar) | |
(citar-bibliography '("/home/user/main.bib")) | |
) | |
(use-package citar-embark | |
:ensure t | |
:after citar embark | |
:no-require | |
:config (citar-embark-mode) | |
) | |
(use-package citar-org-roam | |
:ensure t | |
:after citar org-roam | |
:no-require | |
:custom | |
(citar-org-roam-subdir nil) | |
:config (citar-org-roam-mode) | |
) | |
;; Ebib to take care of the actual bibliography | |
(use-package ebib | |
:ensure t | |
:config | |
(setq ebib-preload-bib-files '("/home/user/main.bib")) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment