Speed TeX

by Willie Wong

I generally prefer not to take notes in lectures/seminars/colloquia, and instead let my brain do the learning thing. When I do take notes, I usually prefer the ink-on-paper technology. On occasions, however, I’ve been known to live-TeX a presentation. (As my former and current officemates can attest, I am a LaTeX-ninja.) In fact, I generally TeX faster than I can write (I can even TeX faster than I can read; but that comes by short-circuiting my brain so that I just transcribe verbatim what I see without trying to understand what it is that I am seeing), and so my notes when I do TeX are usually more detailed and complete. Unfortunately, I’ve found that this detail comes at the price that I don’t absorb the material as well during the lecture, which is why I still prefer to take notes the old fashioned way. (The other difficulty is that I am not yet fluent enough with TikZ to draw figures on the fly.)

In any case, I can type, in LaTeX, very, very fast. And you know what? You can too!

Step 1: Learn LaTeX really well
I cannot emphasize the importance of this. If you want to type up a storm, you cannot afford to stop every sentence or two to look up the command for a LaTeX symbol. And the best way to learn all the symbols is to TeX lots. My own fluency in LaTeX comes from years of practice: throughout college, I wrote all my papers (including ones in religion or in English literature) in LaTeX. I also took a part-time job type-setting a textbook (believe me, after typing five chapters of a graduate-level probability theory text, you too will be a TeX-ninja). In graduate school, whenever I have some computations that I feel is worth keeping, I type it up in LaTeX. The best way to learn the language is to use it often.

Step 2: Learn your text editor
A good editor cuts your work in half–if you know how to use it right. There are plenty of good text editors out there, and there are even editors designed especially for LaTeX. But the first important thing you need to keep in mind is

The keyboard is faster than the mouse.

If you have to take your hand away from Home Row in order to use the touchpad or the nib or a mouse, you are going to lose speed. So regardless of how pretty the graphical user interface your editor has, learn the keyboard short cuts!

The second important thing is to

Reduce wasteful keystrokes.

This can be accomplished by several means. The first is to define, using the \newcommand and \renewcommand actions in your LaTeX file, short-cuts for frequently occurring, cumbersome expressions. It is much faster to type \Real then \mathbb{R}. Or \HCurrent{X} instead of {}^{(X)}J. The second example also has the benefit of

Using human-readable command names.

This has several advantages. By using human-readable names instead of a big mess of brackets and braces, you make it easier to spot and prevent typographical mistakes. Furthermore, by defining all symbols up-top, a last minute notation change is a lot easier to deal with.

A second way to reduce wasteful keystrokes is to use keyboard short-cuts and macros that are either built-in to your text editor or user-defined. For example, I dislike having to reach for the backslash (\) and braces ({}) all the time when typing maths. In fact, on my keyboard I can reach the shift key, the tab key, and the F5 – F8 quicker. So I wrote a few key remappings for my preferred text editor, ViM, so that the F5 key allows me to quickly set-up a \begin{stuff} … \end{stuff} block, saving me at least 12 keystrokes each time with the bonus that I don’t have to bend my wrist far from the natural home row position; I also set Shift-Tab to be a catch-all command for decorating math-mode texts (via \mathcal, \mathrm, … and \dot, \hat, \tilde, …) for similar benefits.

Step 3: Use a suitable template / document-class / environment
A simple example: for taking notes in class, generally we do not need long prose-like sections, preferring bullet-points. So it is somewhat of a good idea to use an itemize block or other list-like environments for taking notes.

Another good idea is to use the list/description environments, and take advantage of the \tag command in equation environments, for notes which frequently cross reference itself. If the lecturer uses (*) and (**) etc to label his equations and important points, I find it easier to follow suit and type it as such during the lectures (hence the need to label the list items and tag the equations manually), and only to fix the references using \label and \ref after the lecture.

Step 4: Keep a piece of paper handy
If you make a habit of live-TeX’ing, you will run into situations where something is too complicated to TeX on the fly: a big, messy formula with many symbols unfamiliar to you, or a non-trivial figure (as in, something other than commutative diagrams). The simplest thing to do is to copy it down on paper, mark it in your TeX file, and try to figure it out at home.

Advertisements