6097 comments
2357 subscribers
6254 on Twitter
Subscribe! Feed reader E-mail

How to use Emacs to keep track of your bibliography and notes: anatomy of an Emacs hack

Keep your records in BibTeX, which is a text-based tool for
keeping track of bibliographies. BibTeX really shines when you use it
with TeX or LaTeX because you can cite papers by typing something like
“\cite{chua07}”. It will automatically publish your bibliography in
any of the popular formats, sorting it however you want and including
only the papers you actually referenced. Major paper libraries like
the ACM Digital Library can export bibliographic records as BiBTeX.
You can also use bibtex-mode to help you create records. Assign short,
memorable keys to the BibTeX records. I usually use the first author’s
last name together with the year of publication, with a few more
characters if I need to disambiguate.

You can keep your notes about papers in whatever format you want. Just
add a line like “\cite{chua07a}” to make it easier to paste the
citation. I put my notes into a fortune file (chunks delimited by % on
a line by itself) because whenever I get writer’s block, I like
retrieving random notes using the fortune command. I usually highlight
selections from the PDFs, paste them into my Emacs buffer, and add the
\cite… note. I keep exact quotations so that I can paraphrase them
any way I want when I write the document. Sometimes I’ll add comments,
which I visually distinguish from the quote so that I don’t get
confused. You can also add keywords to your notes and use M-x
occur
or grep to find matching quotes.

When it’s time to work on your paper, keep your citation notes close
to the statements as you paraphrase them for your paper. The best way
to take advantage of the data you have is to use LaTeX, a powerful
typesetting system for scientific papers and books. It’s well worth
learning and it’s the standard in many scientific circles. Even if you
use OpenOffice.org or some other word processor, though, you can still
take advantage of your notes: just make sure you copy the citations
into your bibliography.

—-

So that’s the basic way to do it. Of course, I’ve been accumulating
various Emacs hacks for managing my bibliography, and they’re all in
../emacs/research-config.el.

The first thing I noticed was that I was typing \cite{someid} all the
time. Hmm. There must be a way I could just take that information from
my BibTeX file… So I wrote a function that allowed me to mark a
BibTeX record as the current paper I was reading.

(defvar sacha/research/quote-default ""
  "Stores the BibTeX key for the paper I'm currently reading.")
(defadvice bibtex-clean-entry (after sacha activate)
  "Set default key based on the current record."
  (setq sacha/research/quote-default (bibtex-key-in-head))
  (set-register ?a (format "\n\\cite{%s}\n%%" sacha/research/quote-default))
  (set-register ?b sacha/research/quote-default))

Okay. That meant I could just insert the register with C-x r i a. This
wasn’t really that much of an improvement, so I thought about making a
function that pasted the text, added the citation, and added the %
that separates entries in fortune files.

(defvar sacha/research/quote-file "/home/sacha/notebook/research/quotes"
  "File with my research notes.")
(defun sacha/research/quote ()
  "Paste the quote into `sacha/research/quote-file'."
  (interactive)
  (with-current-buffer (find-file-noselect sacha/research/quote-file)
     (goto-char (point-max))
     (yank)
     (unless (bolp) (insert "\n"))
     (insert "\\cite{" sacha/research/quote-default "}\n%\n")))

I have lots of other functions to keep track of read entries (moving
the papers into a separate folder!), count papers read and remaining
(good for morale when you see the numbers decreasing, and for a while
I was publishing the numbers on my blog!) and even quickly browse and
tag quotes. =) You can check out ../emacs/research-config.el for
more inspiration.

And yes, this is what I do when I want to procrastinate working on my
thesis…

Random Emacs symbol: memory-signal-data – Variable: Precomputed `signal’ argument for memory-full error.

Short URL: http://sachachua.com/blog/p/4611

On This Day...

  • 2013: Towards wonderful new normals — I’ll be doing consulting for around two days a week for the rest of the year. Before I started this [...]
  • 2012: Sketches: People-watching at High Park — I’m teaching myself how to draw by cheating. For example, while waiting for friends to come join me in seeing [...]
  • 2011: Study group update: negative numbers, exponents, and awesomeness — W- started the kids on a review of positive and negative numbers. They got the hang of those quickly, so [...]
  • 2010: Tea — One of my indulgences is hosting tea parties. I love bringing friends together for conversation. There’s something about an [...]
  • 2009: Sketches: Do these look like cats to you? =) — This was also fun to make. =)
  • 2007: Oooh! The banig is so pretty! — My mom sent me a woven mat. It’s so pretty! I’ve set it up by the side of my room. If [...]
  • 2007: Book recommendation: The Ten-Minute Trainer — Bowman. 2005. The Ten-Minute Trainer. Pfeiffer. Training shouldn’t be hour-long lectures that bore people who are more used to television’s ten-minute chunks [...]
  • 2007: Book recommendation: Light Their Fire — Drake, Gulman and Roberts. 2005. Light Their Fire. Dearborn: Chicago, IL. Light Their Fire shows the importance of internal marketing as a [...]
  • 2006: How to wear a malong — Someone came upon my webpages while looking for ways to wear a malong, one of the traditional Filipino costumes. It’s really [...]
  • 2006: Rails pub night — I had tons of fun at the Toronto Rails pub night. Met some really cool people. =) Pictures to follow. Finally [...]
  • 2006: Dips — The dips Bill brought deserve their own entry. He brought taramosalata, a Greek dip of… umm… carp egg caviar. =) [...]
  • 2006: Backlog: I’m feeling potlucky! — Sunday was a very culinary day. ;) After doing my chores and my laundry, I decided that a potluck lunch was [...]
  • 2004: Publishing absolute URLs in RSS feeds — - ../../notebook/emacs/emacs-wiki-config.el - ../../notebook/emacs/planner-config.el (defvar sacha/emacs-wiki-use-absolute-url-flag nil "Non-nil means publish absolute URLs.") (defadvice planner-rss-add-note (around sacha/absolute-urls activate) "Publish absolute URLs." [...]
  • 2004: William Yu’s draft presentation on FOSS in the curriculum — http://cng.ateneo.net/cng/wyu/works/drafts/sfd2004-foss-in-cscurricula-html/ E-Mail from William Yu
  • 2004: Gnus frontend for Dashboard — Hans de Graaff wrote Lisp code to make Gnus send clue packets to Dashboard. Fascinating… I should try that for planner [...]
  • 2004: Alternating rows — li:nth-child(5n+3) {font-weight: bold}
  • 2004: Socializing — Kathy picked me up from YMCA and said she was doing me a favor by taking me out. I didn’t have [...]
  • 2004: Aikido — I’m beginning to enjoy aikido. The moves are just so… graceful. They remind me of ballroom dancing, strangely. I think I’m [...]

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging

Free sample!