Samuel W. Flint

A tech and academic blog

Reading and Keeping Notes

As I start my PhD, reading literature and retaining the information is even more important that it had been. Finding a way to organize these notes (and the relevant literature) can help to make re-discovery possible, especially from something small that I may remember. I'm going to take a look at the tools I use for managing these notes, and how I use them. I'll consider two kinds of literature (generally): articles & books.

Articles

I've seen that a lot of people, as they manage collections of papers they've read, use tools like Zotero or Mendeley, which allow them to keep track of them, as files and bibliographic data. These tools are pretty cool, and work well for a lot of people, but have a problem: they don't integrate well with Emacs. To most, that last bit doesn't matter, but to me, it does, because Emacs allows me to have quite a bit of information integrated with many other things, which inevitably can help to make discovery easier. What does work with Emacs is ebib. Ebib stores its data in standard BibTeX files, even notes, which means that I can produce neat, clean annotated bibliographies from my notes with ease.

In using Ebib, I separate my paper collection by general category, with each category being a separate directory in a git annex powered repository. In each directory, there's also a bibliography.bib file, which contains all relevant bibliographic data and notes on each article. I do things slightly differently for conferences, where each year is a folder with associated bibliography. Since ebib supports editing the annotation field of an entry in a separate buffer with whatever major mode is desired, I use LaTeX-mode (from AUCTeX) and a simple template.

  \begin{description}
  \item[Motivation] 
  \item[Methods]
  \item[Results]
  \item[Major Papers Cited]
    \begin{itemize}
    \item
    \end{itemize}
  \item[Miscellaneous Notes]
  \item[TL;DR]
  \end{description}

Because I keep my collection of papers in a git annex repository, I don't have to keep them all on my computer, I just need a couple of copies floating around on other machines or drives. Because I try to save space, I often don't keep articles on my computer at all times. This means that if I try to open one in Emacs there will be an error, but it's nice to be able to automatically handle that. I wrote a bit of code, which does, in fact, handle this issue:

  (defun my/in-annex-repo-p ()
    (= 0 (call-process "git" nil nil nil "annex" "status")))

  (defun my/dired-try-git-annex-get (filename)
    (if (not (my/in-annex-repo-p))
        (signal 'error "File is a symlink to a nonexistent target")
      (with-help-window "*git-annex-get status*"
        (call-process "git" nil (get-buffer "*git-annex-get status*") t "annex" "get" filename)
        (with-current-buffer (get-buffer "*git-annex-get status*")
          (beginning-of-buffer)
          (while (re-search-forward "\C-M" nil t)
            (replace-match ""))))))

  (defun my/dired-around-dired-find-file (original-function &rest args)
    (condition-case err
        (apply original-function args)
      (error
       (if (string= (cadr err) "File is a symlink to a nonexistent target")
           (progn
             (my/dired-try-git-annex-get (dired-get-filename nil t))
             (call-interactively #'dired-open-file))
         (signal (car err) (cdr err))))))

  (advice-add 'dired-find-file :around #'my/dired-around-dired-find-file)

And, since everything is kept in BibTeX files, it's easily searched from within Ebib as well as using standard tools and utilities, which in the end makes finding old notes, and things that are important easier. And because of how ebib works, as I need a paper from my collection, I can quickly copy the relevant entries to a project-specific bibliography and manage easily from there.

Books

In comparison to articles, keeping track of notes for books is much simpler. Because books tend to be longer, I use a single org-mode file structured according to the book (that is, essentially according to the table of contents), with a BibTeX entry in a source block at the start of the file. These files are kept with the rest of my org files library, which again, being plain text, makes review easy, especially since it's close to where a bunch of my other notes of more general kinds are located.