interleave icon indicating copy to clipboard operation
interleave copied to clipboard

Emacs minor mode to interleave notes and text books

[[http://melpa.org/#/interleave][file:http://melpa.org/packages/interleave-badge.svg]] [[https://travis-ci.org/rudolfochrist/interleave][file:https://travis-ci.org/rudolfochrist/interleave.svg?branch=master]]

  • IMPORTANT

This package is not maintained anymore. User should go and checkout [[https://github.com/weirdNox/org-noter][weirdNox/org-noter]] as an alternative.

  • Interleaved Textbooks?

Some history, what this is all about...

In the past, textbooks were sometimes published as /interleaved/ editions. That meant, each page was followed by a blank page and ambitious students/scholars had the ability to take their notes directly in their copy of the textbook. Newton and Kant were prominent representatives of this technique [fn:blumbach].

Nowadays textbooks (or lecture material) come in PDF format. Although almost every PDF Reader has the ability to add some notes to the PDF itself, it is not as powerful as it could be. This is what this [[https://www.gnu.org/software/emacs/][Emacs]] minor mode tries to accomplish. It presents your PDF side by side to an [[http://orgmode.org][Org Mode]] buffer with you notes. Narrowing down to just those passages that are relevant to this particular page in the document viewer.

In a later step it should be possible to create truly /interleaved/ PDFs of your notes.

  • Installation

Add MELPA to your package archives in your init file

#+BEGIN_SRC emacs-lisp (package-initialize) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) #+END_SRC

Then install interleave-mode with

#+BEGIN_EXAMPLE M-x package-install RET interleave RET #+END_EXAMPLE

  • Usage

Create a Org file that will keep your notes. In the Org header section (=#+TITLE=, =#+AUTHOR=, etc.) add

#+BEGIN_SRC #+INTERLEAVE_PDF: /the/path/to/pdf.pdf #+END_SRC

Then you can start interleave by typing

#+BEGIN_SRC M-x interleave-mode #+END_SRC

This will display the PDF side by side to the org buffer for your notes. You can navigate the PDF as usual with @@html:@@n@@html:@@ and @@html:@@p@@html:@@. Changing the page of the PDF will also narrow to the notes that are meant for this particular PDF page.

The split direction is determined by the customizable variable =interleave-split-direction=. When =interleave-mode= is invoked with a prefix argument the inverse split direction is used e.g. if =interleave-split-direction= is set to =vertical= the buffer is split horizontally.

If you want to add some notes to the current page you can type @@html:@@i@@html:@@. This will create a new headline for your notes. If some notes are already present, @@html:@@i@@html:@@ will switch over to the other buffer.

Typing @@html:@@q@@html:@@ in the /DocView/ will quit interleave-mode.

To customize Interleave you can use the customization interface with

: M-x customize-group RET interleave

** Multi-PDF Notes

Normally the notes/PDF relation is bidirectional. This means for every PDF there is one notes file. But it is also possible to keep a single notes file for multiple PDFs.

To keep a multi-PDF notes file create a headline for each PDF and set the =INTERLEAVE_PDF= property on it.

: * Notes for CS103 : :PROPERTIES: : :INTERLEAVE_PDF: cs103.pdf : :END:

To use =interleave-mode= on this headline, simply place your point onto the headline an type

: M-x interleave-mode RET

to start =interleave-mode= for this subtree.

Notice that you have to decide. It is not possible to keep multi-PDF and normal notes in the same file.

** Idiosyncrasies

Interleave does some automated buffer switching for you, especially at start up. This may affect some hooks (see [[https://github.com/rudolfochrist/interleave/issues/40][Issue #40]]). This means that even when you start =interleave-mode= in an Org buffer the hooks may be run in the newly established =DocView=/=PdfView= buffer.

Interleave provides the variables =interleave-org-buffer= and =interleave-pdf-buffer= to access either the Org buffer (the buffer with your notes) or the PDF buffer respectively. Please specify the buffer you'd like to use explicitly, like this:

#+BEGIN_SRC emacs-lisp (defun my-interleave-hook () (with-current-buffer interleave-org-buffer ;; Do something meaningful here (message "Hi there. I'm in the org buffer!")))

(add-hook 'interleave-mode-hook #'my-interleave-hook) #+END_SRC

  • Key-bindings

| Key | Description | Availability | |------------------------------------+---------------------------------------------+--------------------| | @@html:@@n@@html:@@ | Go to next page | PDF Buffer | | @@html:@@p@@html:@@ | Go to previous page | PDF Buffer | | @@html:@@SPC@@html:@@ | Scroll up | PDF Buffer | | @@html:@@S-SPC@@html:@@ | Scroll down | PDF Buffer | | @@html:@@DEL@@html:@@ | Scroll down | PDF Buffer | | @@html:@@i@@html:@@ | Insert new notes/go to notes | PDF Buffer | | @@html:@@q@@html:@@ | Quit =interleave-mode= | PDF Buffer | | @@html:@@M-.@@html:@@ | Go to page of currently visible notes | PDF and Org Buffer | | @@html:@@M-p@@html:@@ | Go to the page of the previous set of notes | PDF and Org Buffer | | @@html:@@M-n@@html:@@ | Go to the page of the next set of notes | PDF and Org Buffer |

  • Footnotes

[fn:blumbach] For some more information see: [[http://takingnotenow.blogspot.de/2008/07/note-keeping-in-1786-blumenbachs-system.html]]