Scientific writers turn away from MS Word more and more, opting for solutions either more minimalistic1 or more suited to the nonlinear fashion of drafting ideas and writing research papers2. However, if you already live in Emacs, the extensible, customizable display editor, there is no need to shell out money for special software to help you with writing scientific papers, it’s all
there. The very excellent org-mode is the place to start, and you will need only minor modifications to the standard org setup get you up and running. If you don’t know about org-mode, now is the time to head over to the compact guide or to the tutorials on worg.
The obvious additions to org that make for an integrated scientific writing environment are Babel and RefTeX. Babel was integrated into org with version 7.0, so it’s right there with every current org installation. RefTeX handles citations and labels in LaTeX and comes bundled with Emacs, so no additional installation is required.
As a good starting point, Mario shares some nice ideas on how to integrate RefTeX and org-mode in order to create a scientific word processor. One comment to that post points out that loading RefTeX in every org buffer creates some computational overhead and overwriting org-specific keybinding by RefTeX might be problematic in some cases (it was for me, too). A nice solution is to load RefTeX only in org buffers with certain TODO keywords. I chose “WRITE”, and have the following lines in my .emacs to load RefTeX in those buffers:
;;; use reftex and other article helper modes in org-mode ;;; (but only in files with a WRITE todo keyword) (defun org-mode-article-modes () (reftex-mode t) (bib-cite-minor-mode t) (and (buffer-file-name) (file-exists-p (buffer-file-name)) (reftex-parse-all)) (define-key org-mode-map (kbd "C-c )") 'reftex-citation)) (add-hook 'org-mode-hook (lambda () (if (member "WRITE" org-todo-keywords-1) (org-mode-article-modes))))
It comes in very handy to set a global bibliography for RefTeX, which can be accessed for all org files with the WRITE keyword (and from all TeX files also):
;;; master bibliography (setq reftex-default-bibliography '("/Users/christian/Documents/Bibliothek.bib"))
Typically, my org files related to paper writing have a file-specific TODO sequence:
#+TODO: WRITE REVISE SHORTEN | DONE #+DRAWERS: PROPERTIES SYNOPSIS COMMENTS LOGBOOK
The second line corresponds to the property drawers I set for the document. Clearly, this setup is borrowed from Scrivener, a popular Mac OSX writing app, where each snippet of text can have a synopsis and comments. The logbook drawer is set because I log changes in TODO states in this special drawer.
This way, a nice writing environment is established, where I can profit from org’s power, which is absolutely incredible and ranges from todo-list management to the evaluation of embedded code in different languages, and the power of RefTeX with all it’s niceties like mode-line citation overview and regex citation search.
For me, the reason of choosing Emacs with a custom and iteratively handcrafted setup over a commercial solution for writing papers is nicely summarized in Jaco’s saying: “It’s all in my hands”. The same goes for using Babel (or more generally, Emacs) over some shiny IDE. Stay tuned for more on Babel and scientific writing in the near future.
Footnotes:
1 Minimalism in software is becoming the common theme among many computer users, see e.g. Minimal Mac or One Thing Well, but compare also Merlin’s rant regarding “distraction free writing”.
2 Among the most popular are—on the Mac—Scrivener and Ulysses.