How I Use Emacs for Outlining

Most of the world has never used or even seen Emacs. That’s a shame. Emacs does a lot of things - it’s a powerful text editor, an IDE, a web browser, an email client, …. Probably the most popular use is org-mode, which is itself many things. I use it as an outliner.

I never realized the power of outlining until I started using Emacs. Sure, I’ve always outlined my papers and presentations, just like I learned in school, and that’s something I recommend. That is not the same as using outliner software. You could write up that kind of outline on a piece of paper or in MS Word.

An outline is nothing more than a list. When I’m feeling stressed out from all the things I have to do - something that happens with unfortunate regularity these days, due to all the things I have to do in my day job - I’ll do a brain dump to get everything out of my head. When I think I’m done, I leave the file open so I can record anything else that shows up.

Simply making a list is something I could do in any text editor, word processor, or paper notebook. The power of an outliner is the way it helps you to modify the list, hide and unhide elements, and add metadata.

Modifying the list. When I create my list, I’m trying to get everything out of my head. I don’t want to worry about where to put things. org-mode provides support for modifying the list later. Suppose I have a short list like this:

* Prepare tomorrow's lecture
* Read and summarize the paper by Smith (2016)
* Complete the literature review
* Talk about cointegration
* Read the paper by Jones (2019) and see if it's relevant
* Update coauthors on the literature review
* Go over the homework

This is how stuff comes out of my brain. Maybe for others everything falls out nicely organized in a useful format, but that never happens for me. The list is a lot of scattered thoughts with no underlying structure. The lack of structure is not uncorrelated with my level of stress.

The most obvious structure to this list is that all items are related to either teaching or research. I could cut and paste the items into a more helpful ordering with a mouse. The nice thing about org-mode is that it knows where list items start and end. Rather than cutting and pasting (a painful experience that I find very distracting with a large list), I can position the cursor on one of the items and hit M-up (the Alt key and up arrow at the same time) or M-down to move the items where they should be. The list now looks like this:

* Prepare tomorrow's lecture
* Talk about cointegration
* Go over the homework
* Read and summarize the paper by Smith (2016)
* Complete the literature review
* Read the paper by Jones (2019) and see if it's relevant
* Update coauthors on the literature review

It would be useful to insert a header to highlight the two groups:

* Teaching
* Prepare tomorrow's lecture
* Talk about cointegration
* Go over the homework
* Research
* Read and summarize the paper by Smith (2016)
* Complete the literature review
* Read the paper by Jones (2019) and see if it's relevant
* Update coauthors on the literature review

That helps, but it would be better if it was clear that “Teaching” and “Research” are headers, and the other items are items in that group. You can “demote” an item by positioning the cursor over it and hitting M-Right (Alt and the right arrow). Doing that for each of them, I have

* Teaching
** Prepare tomorrow's lecture
** Talk about cointegration
** Go over the homework
* Research
** Read and summarize the paper by Smith (2016)
** Complete the literature review
** Read the paper by Jones (2019) and see if it's relevant
** Update coauthors on the literature review

Actually, two of the teaching items are really subtasks for the other, and the order is not consistent with how I’ll present to the class, so with a couple keystrokes I have this:

* Teaching
** Prepare tomorrow's lecture
*** Go over the homework
*** Talk about cointegration
* Research
** Read and summarize the paper by Smith (2016)
** Complete the literature review
** Read the paper by Jones (2019) and see if it's relevant
** Update coauthors on the literature review

The research section is similarly disorganized. With a few more keystrokes, I have this much clearer list:

* Teaching
** Prepare tomorrow's lecture
*** Go over the homework
*** Talk about cointegration
* Research
** Complete the literature review
*** Read and summarize the paper by Smith (2016)
*** Read the paper by Jones (2019) and see if it's relevant
*** Update coauthors on the literature review

Rarely do I work with such a short list, but even with a small list like this, good support for modifications is really important. Trust me, you won’t be making many lists if you have to do that much cut and paste and that much indenting by hand.

Finally, it occurs to me that I’d rather have the research section on top, because that’s what I’m going to work on while I’m in the office, and I’m going to be working on my lecture while I’m sitting outside with my dog this evening. If I position the cursor on the * Research line and hit M-up once, it moves the entire subtree to the top:

* Research
** Complete the literature review
*** Read and summarize the paper by Smith (2016)
*** Read the paper by Jones (2019) and see if it's relevant
*** Update coauthors on the literature review
* Teaching
** Prepare tomorrow's lecture
*** Go over the homework
*** Talk about cointegration

Hiding and unhiding elements. The first thing I’m going to do after finishing the above list is read and summarize Smith (2016). While I’m doing that, I’m going to add a bunch of notes. I can start typing below that item and it will be properly indented:

* Research
** Complete the literature review
*** Read and summarize the paper by Smith (2016)
    Methodology: OLS
    Data: US only 1983-2014
    Summary: This is a stupid paper.
*** Read the paper by Jones (2019) and see if it's relevant
*** Update coauthors on the literature review
* Teaching
** Prepare tomorrow's lecture
*** Go over the homework
*** Talk about cointegration

When I’m working through the Smith (2016) paper, this is a nice list. When I’m not, however, it’s going to make the list very cluttered. As I work on each item, particularly the lecture material, I’ll have many lines of notes. I don’t want that. I want to cycle through the visibility of the document structure. One way to do that for the above list is to put the cursor on the third line and hit the Tab key, which will hide all the related text, but add notation to show that there is hidden text:

* Research
** Complete the literature review
*** Read and summarize the paper by Smith (2016)...
*** Read the paper by Jones (2019) and see if it's relevant
*** Update coauthors on the literature review
* Teaching
** Prepare tomorrow's lecture
*** Go over the homework
*** Talk about cointegration

This is very important, because you want to be able to add arbitrary notes to an outline, but you don’t want those notes making it hard to use the rest of the document. In fact, once I start working on teaching, I don’t want to see anything about research, so I hit Tab on the first line to hide that entire subtree:

* Research...
* Teaching
** Prepare tomorrow's lecture
*** Go over the homework
*** Talk about cointegration

When I’m ready to go back to research, all I have to do is hit Tab to expand that item. Even with several dozen groups of items (a very large list) it is still easy to navigate.

A less direct form of changing item visibility is to make a link to a new file holding all that information. Maybe I want to type my lecture notes into markdown and then convert directly to PDF. All I have to do is create a link to the document:

* Research...
* Teaching
** Prepare tomorrow's lecture
*** Go over the homework
    [[Homework comments][./homework-comments.md]]
*** Talk about cointegration

Once I’ve created the link, it will convert to a hyperlink, and I’ll see the following (links appear underlined):

* Research...
* Teaching
** Prepare tomorrow's lecture
*** Go over the homework
    Homework comments
*** Talk about cointegration

I can open the link with a mouse or a keyboard shortcut, and it will open a new Emacs buffer to type into. If the file doesn’t exist, it will be created. I can switch between the buffer holding the outline and the buffer holding my comments on the homework. I can export it to PDF for printing once it’s done.

Adding Metadata. It can be helpful to add metadata to long lists. If something is a task that needs to be done, I will hit C-c C-t to turn it into a todo item. Once I’m done, I hit C-c C-t again, and it’s marked to show that it’s been completed.

* Research
** Complete the literature review
*** DONE Read and summarize the paper by Smith (2016)
*** DONE Read the paper by Jones (2019) and see if it's relevant
*** TODO Update coauthors on the literature review
* Teaching
** Prepare tomorrow's lecture
*** DONE Go over the homework
*** DONE Talk about cointegration

I can use org-mode’s agenda feature to show my list of incomplete tasks. I promised my coauthors that I would finish the literature review by next Wednesday, so I put the cursor on that list item, hit C-c ., and a calendar pops up. I scroll to the due date and it’s inserted into the file. I can then have org-mode compile my calendar of upcoming due dates for all my items, ordered from earliest to latest, as well as any overdue items.

Sometimes tags are useful. If there is something I have to do while I’m in my office, like a literature review, I can add that tag:

* Research
** Complete the literature review
*** DONE Read and summarize the paper by Smith (2016) :office:
*** DONE Read the paper by Jones (2019) and see if it's relevant :office:
*** TODO Update coauthors on the literature review
* Teaching
** Prepare tomorrow's lecture
*** DONE Go over the homework
*** DONE Talk about cointegration

When I get to my office in the morning, I can query all items with the :office: tag. That way I know what will have to be done before I go home for the day. I don’t use tags much, but they are nice to have when I do use them.

While I could do all of these things using other software, outliner software is speicifically designed to reduce as much friction as possible from the outlining process. I would not be able to make it through one week without having access to some form of outliner software.

I recommend Emacs. It’s free, stable, full of features, and easy to customize. If you’re not an Emacs person, you can check out Workflowy and Dynalist. They’re both cloud apps, neither is open source, and you’ll have to pay for them (the free version of both is too limited if you want to use it seriously).