simfish:

Emacs/Notes

This workflow enables org-roam based note taking.

cover image

Customizations

Notes directory,

(defcustom notes:dir
 (expand-file-name "~/Documents/research/notes")
 "Research directory path.
The directory is storage location for org-roam based notes.")

File Associations

(eval-after-load "org"
  '(progn
     (if (assoc "\\.xopp\\'" org-file-apps)
         (setcdr (assoc "\\.xopp\\'" org-file-apps) "xournalpp %s")
         (add-to-list 'org-file-apps '("\\.xopp\\'" . "xournalpp %s") t))
         (setcdr (assoc "\\.xopp\\'" org-file-apps) "xournalpp %s")))

Key Bindings

Adding a note,

;; note launcher
(kb::def :states  'normal
  "n"    '(:ignore t                           :which-key "notes")
  "ni"   '(org-roam-node-insert                :which-key "insert")
  "nn"   '(org-roam-capture                    :which-key "open/create"))

Searching,

(kb::def :states  'normal
  "n/"  '(deft  :which-key "title search"))

Editing,

;; Tags
(kb::def :states  'normal
  :keymaps 'org-mode-map
  "nt"    '(:ignore t                           :which-key "roam tags")
  "ntt"   '(org-roam-tag-add                    :which-key "add")
  "ntd"   '(org-roam-tag-delete                 :which-key "delete"))

Annotating, The org-noter package can be used to create document outline. This is only useful after creating an org-roam note.

(kb::def :states  'normal
  :keymaps 'pdf-view-mode-map
  "n"    '(:ignore t                           :which-key "notes")
  "no"   '(org-noter-create-skeleton           :which-key "outline")
  "nq"   '(org-noter-kill-session              :which-key "quit sessions"))

Listing backlinks,

(kb::def :states  'normal
  :keymaps 'org-mode-map
  "n"    '(:ignore t                           :which-key "notes")
  "nb"   '(org-roam-buffer-toggle              :which-key "show backlinks"))

Notes can be visualized using org-roam-ui:

(kb::def :states  'normal
  :keymaps 'org-mode-map
  "n"    '(:ignore t                           :which-key "notes")
  "nv"   '(org-roam-ui-open                    :which-key "visualize notes"))

Packages

Package: xournalpp

(specifications->manifest  '("xournalpp"))

Package: org-roam

;; //////////////////////////////////////////////////////////////////////////////
;; Note Taking
;; //////////////////////////////////////////////////////////////////////////////

(defun notes::get-dir ( )
  "Returns the root directory where annotated papers are stored"
  notes:dir)

(use-package org-roam
  :guix (:name emacs-org-roam)
  :demand t
  :hook
  ((after-init . org-roam-mode)
   (org-roam-backlinks-mode . visual-line-mode))
  :init
  (setq org-roam-v2-ack t)
  :general
  <<org-roam-kb>>
  :custom
  (org-roam-db-location (file-truename  "~/.config/distro-config/notes/org-roamd.db"))
  (org-roam-directory   (notes::get-dir))
  (org-roam-completion-system 'helm))

Package: org-roam-bibtex

(use-package org-roam-bibtex
  :guix (:name emacs-org-roam-bibtex)
  :demand t)

Package: org-noter

(use-package org-noter
  :guix (:name emacs-org-noter)
  :demand t
  :config
  ;;orb settings
  (require 'org-roam-bibtex)
  (setq orb-preformat-keywords
        '(("citekey" . "=key=")
          "title"
          "url"
          "file"
          "author-or-editor"
          "keywords"))
  (setq orb-templates
        '(("r" "ref" plain (function org-roam-capture--get-point)
           ""
           :file-name "${citekey}"
           :head "#+TITLE: ${citekey}: ${title}\n#+ROAM_KEY: ${ref}
           - tags ::
           - keywords :: ${keywords}
           ,* ${title}
           :PROPERTIES:
           :Custom_ID: ${citekey}
           :URL: ${url}
           :AUTHOR: ${author-or-editor}
           :NOTER_DOCUMENT: ${file}
           :NOTER_PAGE:
           :END:"))))

Package: deft

(use-package deft
  :guix (:using channel :name emacs-deft)
  :after org
  :general
  <<deft-kb>>
  :custom
  (deft-recursive t)
  (deft-use-filter-string-for-filename nil)
  (deft-use-file-name-as-title nil)
  (deft-strip-summary-regexp
   (concat "\\("
		   "[\n\t]" ;; blank
		   "\\|^#\\+[[:alpha:]_]+:.*$" ;; org-mode metadata
		   "\\|^:PROPERTIES:\n\\(.+\n\\)+:END:\n"
		   "\\)"))
  (deft-default-extension "org")
  (deft-directory ( notes::get-dir)))