Miskatonic University Press

Reading diary in Org

emacs

Last year I started using Org to keep track of my reading, instead of on paper, and it worked very well. I was able to see how much I was reading all through the year, which helped me read more.

I have two tables. The first is where I enter what I read. For each book I track the start date, title, author, number of pages, and type (F for fiction, N for nonfiction, A for article). If I don’t finish a book or just skim it I leave the pages field blank and put a - in T. Today I started a new book so there’s just one title, but to add a new one I would go to the dashed line at the bottom and hit S-M-<down> (that’s Alt-Shift-<down> in Emacs-talk) and it creates a new formatted line. I’m down at the bottom of the table so I tab through a few times to get to the # line, which forces a recalculation of the totals.

#+CAPTION: 2015 reading diary
#+ATTR_LATEX: :environment longtable :align l|p{8cm}|p{ccm}|l|l
#+NAME: reading_2015
|   | Date        | Title                              | Author            | Pages | T |
|   |             | <65>                               | <40>              |       |   |
|---+-------------+------------------------------------+-------------------+-------+---|
|   | 01 Jan 2015 | Stoicism and the Art of Happiness  | Donald Robertson  |   232 | N |
|---+-------------+------------------------------------+-------------------+-------+---|
| # |             | 1                                  |                   |   232 |   |
#+TBLFM: $3=@#-3::$5=vsum(@3..@-1)

(The #+CAPTION and #+ATTR_LATEX lines are for the LaTeX export I use if I want to print it.)

The second table is all generated from the first one. I tab through it to refresh all the fields. All of the formulas in the #+TBLFM field should be on one line, but I broke it out here to make it easier to read.

Books per week and predicted books per year are especially helpful in keeping me on track.

#+NAME: reading-analysis-2015
#+CAPTION: 2015 reading statistics
|---+----------------------+---------------|
|   | Statistic            |               |
|---+----------------------+---------------|
| # | Fiction books        |             0 |
| # | Nonfiction books     |             1 |
| # | Articles             |             0 |
| # | DNF or skimmed       |             0 |
| # | Total books read     |             1 |
| # | Total pages read     |           232 |
| # | Days in              |           001 |
| # | Weeks in             |            00 |
| # | Books per week       |             1 |
| # | Pages per day        |           232 |
| # | Predicted books/year |           365 |
|---+----------------------+---------------|
#+TBLFM: @2$3='(length(org-lookup-all "F" '(remote(reading_2015,@2$6..@>$6)) nil))::
@3$3='(length(org-lookup-all "N" '(remote(reading_2015,@2$6..@>$6)) nil))::
@4$3='(length(org-lookup-all "A" '(remote(reading_2015,@2$6..@>$6)) nil))::
@5$3='(length(org-lookup-all "-"  '(remote(reading_2015,@2$6..@>>$6)) nil));E::
@6$3=@2$3+@3$3::@7$3=remote(reading_2015, @>$5)::
@8$3='(format-time-string "%j")::
@9$3='(format-time-string "%U")::
@10$3=round(@6$3/@9$3, 1)::
@11$3=round(@7$3/@8$3, 0)::
@12$3=round(@6$3*365/@8$3, 0)

(Tables and the spreadsheet in Org are very, very useful. I use them every day for a variety of things.)

With all that information in tables it’s easy to embed code to pull out other statistics and make charts. I’ll cover that when I tweak something to handle co-written books, but today, after getting some of that working for the first time, I was able to see my most read authors over the last four years are Anthony Trollope, Terry Pratchett and Anthony Powell. There are 39 authors who I’ve read at least twice. Some of them I’ll never read again, some I’ll read everything new they come out with (like Sarah Waters, who I only started reading this year) and some are overdue for rereading (like Georgette Heyer).