Skip to content
Jdogzz edited this page Feb 13, 2022 · 4 revisions

Package configuration

(require 'eaf-interleave)
(add-hook 'eaf-pdf-viewer-hook 'eaf-interleave-app-mode)
(add-hook 'eaf-browser-hook 'eaf-interleave-app-mode)
(add-hook 'org-mode-hook 'eaf-interleave-mode)
(setq eaf-interleave-org-notes-dir-list '("~/org/interleave/"))
(setq eaf-interleave-split-direction 'vertical)
(setq eaf-interleave-disable-narrowing t)
(setq eaf-interleave-split-lines 20)

or with use-package

(use-package eaf
  :ensure nil
  :custom
  (eaf-find-alternate-file-in-dired t)
  :diminish eaf-mode
  :bind (:map eaf-interleave-mode-map
         ("M-." . 'eaf-interleave-sync-current-note)
         ("M-p" . 'eaf-interleave-sync-previous-note)
         ("M-n" . 'eaf-interleave-sync-next-note)
         :map eaf-interleave-app-mode-map
         ("C-c M-i" . 'eaf-interleave-add-note)
         ("C-c M-o" . 'eaf-interleave-open-notes-file)
         ("C-c M-q" . 'eaf-interleave-quit))
  :config
  (add-hook 'eaf-pdf-viewer-hook 'eaf-interleave-app-mode)
  (add-hook 'eaf-browser-hook 'eaf-interleave-app-mode)
  (add-hook 'org-mode-hook 'eaf-interleave-mode)
  (setq eaf-interleave-org-notes-dir-list '("~/org/interleave/"))
  (setq eaf-interleave-split-direction 'vertical)
  (setq eaf-interleave-disable-narrowing t)
  (setq eaf-interleave-split-lines 20))

Practical notes

Simply add a property drawer such as

:PROPERTIES:
:INTERLEAVE_URL: /path/to/my.pdf
:END:

then call eaf-interleave-mode, followed by eaf-interleave-sync-current-note to produce a buffer to the left of the notes buffer with eaf-pdf-viewer open to the PDF located at /path/to/my.pdf. After that functions such as eaf-interleave-add-note can be called to add notes.