# Rambling Thoughts

## A Live-TeXing Experiment

In the past two weeks, I’ve taken a mini-course taught by Yakov Pesin at the Penn State REU. The topic is “Fractal Geometry and Dynamics”. Instead of handwriting my notes, I tried to live-TeX notes during the lectures. This was inspired by Akhil Mathew; his thoughts on live-TeXing exist here.

The live-TeX experiment turned out much better that I thought it would. My first reaction to the idea of live-TeXing was that it would be infeasible and horribly inefficient. It seemed indisputable that I could write faster than I could type. Magically, however, I realized that my live-TeXed notes were more comprehensive and more legible than my typical handwritten notes. I thought that I would regularly fall behind while live-TeXing, but this did not happen; I rarely fell behind — certainly no more often than when I used paper and pencil. By this point, I think I’m going to live-TeX most if not all of my classes from now on.

It takes some effort to get used to Live-TeXing. The first few lectures were difficult; I struggled to keep up with all of the formulas. As the class continued, I became faster at typing and learned to think less about trivial matters such as formatting. I also used a number of LaTeX shortcuts for lazy people that sped up the typing process significantly. By the end of the class, I could keep up with even the most complicated formulae.

There are a number of benefits to live-TeXing. For example, having all of my notes on my computer means that it is less likely for me to lose my notes and (hopefully) less likely for me to spill water on them. Furthermore, they’re easier to use (because pdfs are searchable) and they save trees. With respect to content, my live-TeXed notes include all of the historical notes and heuristic remarks that I would have missed while writing manually. Furthermore, they can be read without a magnifying glass.

The main problem with live-TeXing is that it is difficult to copy down pictures during lectures; this was a particularly big problem in the fractal geometry class. I tried to describe each picture in words, though I’m sure that this was not an optimal solution. In the future, I might try to draw pictures by hand and scan them, or draw pictures in Paint. In addition, live-TeXing ended up taking up a bit more time; I spent a few minutes every evening cleaning up the day’s notes (fixing typos, dealing with formulae that run off the page, adding subsection headings). That’s probably a good thing, however; it’s good that I was forced to look back and think about the lecture.

Here are the results on my two weeks of live-TeXing. At two hours per day, this constitutes approximately 20 hours of lectures. If anyone took good handwritten notes with pictures from the class, I’d be happy to scan them and insert them into my file.

Here are the technical details of what I did to make live-TeXing happen.

This is written mainly as a note to myself in case my computer ever dies; however, new recruits to the cult of live-TeXing might find them helpful.

I used LaTeX on Mac OSX using the MacVim text editor. I was going to use TeXShop (as is standard on the mac), but I decided that I would be able to set up more shortcuts and type faster in vim. This turned out to be a good decision.

I set up vim so that it accepted all standard mac commands (command-c/v/s/w/q, selecting with shift, etc). I thought about using the VIM-LaTeX plugin but decided not to; it seemed too big and I liked my own LaTeX shortcuts more than the pages of shortcuts defined by VIM-LaTeX; I also thought that VIM-LaTeX would be too hard to learn to use. The package did inspire some ideas, though. I set up a long .vimrc file with a bunch of shortcuts. Here is a small sample of the most useful commands; the file is still evolving and is available upon request.
 imap ^^ ^{}<ESC>i imap __ _{}<ESC>i imap \abs \left\lvert \right\rvert <ESC>13hi imap \Abs \left\lVert \right\rVert <ESC>13hi imap DEF \begin{definition} \end{definition} <ESC>ki imap THM \begin{theorem} \end{theorem} <ESC>ki imap TAB \begin{tabular}{} \end{tabular} <ESC>2k3li 
These commands save a lot of keystrokes. For example, typing ^^ automatically gives me ^{} with the cursor in between the braces, and typing DEF automatically gives me
 \begin{definition} \end{definition} 
with the cursor in the middle.

In addition to the .vimrc shortcuts for laziness, I also put a number of definitions in my LaTeX preamble. In particular, I defined commands for the Greek letters, the mathbb fonts, and the mathcal fonts. For example, I defined \a, \RR, \cC to be \alpha, \mathbb{R}, and \mathcal{C} respectively. I thought about putting these shortcuts in my .vimrc, but I feel that doing so would make my LaTeX code less readable. I might still do that eventually.

Another wonderful tool is latexmk. Running this in the background (in Terminal) freed me from manually typesetting my file every few minutes. Instead, latexmk watches my LaTeX file for changes and automatically typesets and previews my document every type I save. I set up latexmk using these instructions, and I am using Skim to preview the compiled pdf because it automatically updates when the file is changed while Preview requires closing and reopening the pdf before changes can be seen.

I’m sure that there are other tools in existence to further optimize the live-TeXing process, and I’d love to hear about them.

### 4 responses to “A Live-TeXing Experiment”

1. Elliott December 20, 2010 at 5:25 pm

This is awesome!

VI lets you do so much, it’s pretty ridiculous. Are you familiar with ‘f’ (search for a character in a ilne) or ‘q’ (define a macro)?

Have you considered supplementing your live TeXing with a digital camera? Would it be possible to take pictures of the diagrams in a non-intrusive way?

• Moor Xu December 20, 2010 at 5:36 pm

I don’t think I’ve ever used ‘f’ or ‘q’ before, but they look really useful. It still amazes me that I’m able to do so much with vi; at my typing speed, I’d never be able to keep up with lectures without having vi to speed me up.

I haven’t tried live-TeXing with a camera, though I know people who have. I live-TeXed number theory last quarter (http://stanford.edu/~moorxu/notes/152/152main.pdf) and in one of the last lectures, I tried drawing a diagram in LaTeX using the tikz package. I’m not sure if I could do this sufficiently efficiently diagram-heavy lecture, however, and I still don’t know how to draw anything fancy in tikz.

2. Tim August 16, 2012 at 6:36 pm

Do you mean imap \begin … rem} ki?
without the escape, it just types ki