jump to navigation

Chromatic Homotopy II or how I learned to stop worrying and love LaTeXing in Real Time February 25, 2010

Posted by Chris Schommer-Pries in blog triumphalism, Latex, liveblogging.
Tags:
trackback

I am currently taking course notes for Jacob Lurie’s class on Chromatic Stable Homotopy in real time in Latex. This is not the first time I have taken course notes live and in tex, and when people see it happening they often ask me about it.

I wanted to write an update about Jacob Lurie’s class on Chromatic Stable Homotopy and mention some of exciting and beautiful things happening in that course, but as I started writing this post I found that it was morphing into a sort advice post on how to LaTeX in real time. Since there is obvious appeal, I’ve decided to run with it and collect all the advice, tips, and tricks on how to LaTeX in real time that I’ve gathered from the wild.

Before I started live-TeXing, I was very skeptical. I thought there was no way that I would be able to latex a document in real time. Totally Impossible. Fortunately I was wrong. And even more fortunately I had the pleasure of taking a couple of courses alongside Anton Geraschenko. I saw him take his notes in latex. In Real Time. And I benefited from having his notes available just days after the lecture finished (and more often just a few minutes after). I saw that it was possible and that it was useful.

One of the things that Anton said that got me to try taking notes in LaTeX was that you actually have more time when you latex than when you take notes on paper. What!!?? More time? That can’t possibly be true.

Yes. It’s true. You have more time. It is simple really. Think about how much time it takes you to write out letters with a pen on a piece of paper. Now think about the same thing on a keyboard. You just push a key. It’s much faster to push a key. You gain a couple milliseconds. After writing a few words or sentences, you gain actual seconds. I often find while LaTeXing that I can write down what the speaker is saying (jokes and whatnot), even when the speaker doesn’t write it down themselves. I’ve never been able to do this taking notes with pen and paper.

Another big advantage is the finished product. First it looks great. There is no denying that. This shouldn’t be underestimated. It means my notes are something that I am proud of that I am happy to share with people (this is not always the case for sloppy partial hand written notes). I also find it great to have my notes of talks and lectures on my computer in an electronic form. This means that I can share my notes without the risk of loss or destruction. This also means they are searchable. “Wait. This sounds familiar. Wasn’t there a talk by so-and-so, whose name I forgot, about this subject a couple years back :: searches computer :: why yes, and here are my notes!”. Need I say more?

There are some disadvantages, of course. The biggest being the lack of ability to draw pictures. One solution that I’ve used and liked was to bring a digital camera to lecture and take snap shots. Then I can later include them into my latex file. That’s my favorite solution, but I’d like to hear what others have tried. Anyway, here are some things I’ve learned that have made my live-TeXing a happy reality.

Tips and Tricks:

The golden rule of LaTeXing in Real Time is: Plan Ahead.

Basically all the tips I have are different manifestations of this same basic principle.

Skip the Scenic Route, Take a Shortcut

For me the most important thing I need to LaTeX in real time (besides a computer) is a good collection of latex macros. One of the beautiful things about latex, as opposed to any old word processor, is that you can pre-program your own commands. With sufficient planning ahead, this can really speed up real time note taking.

There are several kinds of macros that I find myself using frequently.

Alphabets. It is very helpful to have shortcuts for useful fonts. Most people probably do this already, at least to some extent. Why waste time time typing out \mathbb{R} over and over when a short command like \R is so much faster? But which letters will you need? You can try to guess in advance, but what if the speaker uses a different letter? Also which fonts? What if out of the blue the speaker starts talking about moduli stacks and you need to write: \mathcal{M}
(this happened yesterday). You could write out the whole thing out: \mathcal{M}
But you can save your self a lot of time by having a shortcut for this too ( I like \cM).

What I do is I go through the entire alphabet and pre-load shortcuts for all of these fonts for every letter. That way whenever I want to write

\mathfrak{g} \to \mathsf{A} \to \mathbb{R} \to \mathcal{M}

I just need to write “\g \to \sA \to \R \to \cM”. I include these alphabet shortcuts in all documents that I am planing to live-TeX. That way I consistently have these shortcuts at my fingertips and I get used to using them.

Context Specific Macros In addition to alphabets I also keep a variety of other command shortcuts that I think I might need. This varies from subject to subject, and since I don’t always know what I will need I like to keep a pretty long list just in case. These range over all sorts of things. Many of them are math operator commands. I might include something like
\DeclareMathOperator{\colim}{colim}
so that I have a “\colim” math operator to match “\lim” (btw, does anyone know how to get it to place math text under it correctly in an enquation environment? I want it to behave exactly like \lim). I try to do this for all the commands I think I might use. So for example in a topology course I will try to include commands like \holim, \hocolim, \map, \tot, etc. and in a class on algebraic geometry I will include things like \spec, \proj, \spf, and \hom.

I also add to this list as I go along. I found in the begining of Jacob’s class that I was constantly writing “\C \P^n” for projective space, so I added a command to my preamble so that now I just have to write “\CP^n”. This is a minor improvement, but if later I decide that I don’t like how the projective spaces look I can change them uniformly.

Another thing which falls under this category are the names of categories. These come up so often I keep a separate list in my preamble just for categories. This way I can also make sure that they consistently look the same. I like to use the \mathsf font for category names.

Complicated Commands/Formatting These are things that I would put in the preamble of an ordinary Latex document, and fall into two camps. The first includes all the environments that I think I will want. Things like theorems, lemmas, corollaries, proofs, claims, remarks, etc.. These are the usual sort of fare for a latex document. Other things that I include are more complicated commands. Some of which I’ve written which take a certain numbers of arguments (I don’t seem to have an example handy), and some which are just plain useful. For example whenever I need to draw a simplicial complex I always get stuck with the triple and quadruple arrows. So I wrote the following command,
\DeclareMathOperator{\righttriplearrows} {{\; \tikz{ \foreach \y in {0, 0.1, 0.2} { \draw [-stealth] (0, \y) -- +(0.5, 0);}} \; }}

which allows my to just write “\righttriplearrows” in a math equation. I also include a few more permutations of this, since I might want four arrows or I might want left arrows.

Usually what happens is that I’m taking notes and then BAM! I need a command that I don’t have. I loose. But later I go write it and add it to my preamble so that next time I have it ready. I win. This way I amass a pretty nice collection of commands. Another win. It also means that it is important to comment well about what your commands are doing and how they are supposed to work.

Hot, Hot, Hot, Hot Keys!

Having a good collection of macros at your disposal is probably the most important thing you can do to prepare for live-TeXing, but it is not the only thing. There are an number of other time savers which I find myself using all the time.

One of them, which I learned from Anton, is that it is important to learn how latex parses things. This can save you a lot of time. One of the easiest is the fractions command. Suppose that I want to write out the expression:

\frac 1 2 \sin x

I could do this by hand using curly-braces “\frac{1}{2} \sin x”. But it is four-characters faster to write
\frac 1 2 \sin x
Not only that, but the four characters are curly braces and so by not writing them you avoid some elaborate (i.e. slow) shift-key keyboard gymnastics.

A similar thing is to learn about standard keyboard shortcuts. You want to use your mouse as little as possible because it is slow and wastes time. There are keyboard short cuts for switching between apps ( command-tab on a Mac) and between windows in an open app (command-` on a Mac). Memorize these.

There are also often some built in commands which allow you to highlight things quickly. This is useful in conjunction with what I am about to describe below, and is important because you might be tempted to use a mouse to highlight things. Resist the temptation. I use a Mac so I know Mac keyboard commands. The ones I use the most are the shift-arrow commands and the shift-command-arrow commands. These let me highlight text at the cursor and highlight an entire line of text, respectively. (If you have a Mac, try ‘em out!)

Why would I want to highlight text? The answer it that I might want to write my own Hot-key Macros. This is the second most useful thing to have for Live-TeXing, after having a good collection of LaTeX macros. Many Latex editors allow you to write your own program macros and to link these up to keyboard short cuts/hot keys.

I use TeXShop, so let me explain what I mean for that program. One of the great things about this program is that it has the “macro editor” (in the Macro menu). This allows you to write macros which you can use to manipulate text. It also has a bunch of built in macros. Even better, it lets you assign these to certain hot-key combinations. So for example suppose that I want to start a new equation. This is one of the standard Marcos, so I just assign it a hot key (ctrl-command-K, in this case). Now when I am LaTeXing in real time and I want to start an equation I just type this hot-key sequence and this text automatically appears:

\begin{equation*}

\end{equation*}

As you see, I decide to link the hot key to the unnumbered equation, but could have done whatever I want. The default Macro in TexShop just adds this text, but I like to do something more fancy. Sometimes I start writing math text inline before I know that I want it to be a nicely formated equation. So I’ve altered the default Macro so that if there is some highlighted text then this gets put inside the equation environment.

For example I could type

\spf R[[t]] \to S

Then type command-shift-leftarrow to highlight it and then ctrl-command-K and I get

\begin{equation*}
\spf R[[t]] \to S
\end{equation*}

This helps speed up the Live-TeXing process. There is a similar default command that takes some highlighted text and puts it into a begin/end environment. I set this to a hot-key. That way I just type out “lemma” highlight it with a key-board short cut (shift-command-arrow), press another hot-key sequence (ctrl-command-B) and I get the code,
\begin{lemma}
\end{lemma}

with the cursor conveniently placed inside. I just continue writing.

The real power of this comes from the fact that you can write your own commands. For example I wrote a macro which is similar to the previous ones but it spits out the text:
\begin{center}
\begin{tikzpicture}
\node (LT) at (0, 1.5) {$ $};
\node (LB) at (0, 0) {$$};
\node (RT) at (2, 1.5) {$$};
\node (RB) at (2, 0) {$$};
\draw [->] (LT) -- node [left] {$$} (LB);
\draw [right hook->] (LT) -- node [above] {$$} (RT);
\draw [->] (RT) -- node [right] {$$} (RB);
\draw [->] (LB) -- node [below] {$$} (RB);
%\node at (0.5, 1) {$\ulcorner$};
%\node at (1.5, 0.5) {$\lrcorner$};
\end{tikzpicture}
\end{center}

What does this do? It uses TikZ to make a square-shaped commutative diagram and puts my cursor right at the correct spot. I just go down the line, adding the text for the four corners of the diagram. I make a couple of quick tweaks and presto! I have a commutative diagram that I have made in latex in Real Time. I’m sure you can imagine countless other possibilities.

Keep your room clean

Finally, I want to mention something that helps me but is not essential: organize your files. This is more important in a large document like the lecture notes for an entire semester’s worth of classes (or a thesis for those unfortunate souls who are graduating this Spring). Each time you compile a large document it takes time. As the document gets longer, the compilation gets slower. If you organize your document well you can “turn off” parts of you document while you take notes to speed up the compiling process.

I usually have a single master document which then includes separate files where I have the notes. Then I just comment out the part which includes the old notes and un-comment them back after I’m done Live-TeXing. I also keep a large separate preamble file which has all of the commands I mentioned above.

So that’s it. These are my best tips and tricks. I’d love to hear about anyone else’s experiences and tips or suggestions, problems they’ve run into and solutions. Also to get people started, I’ve decided to make my LaTeX files public. They are available at my lecture note website.

About these ads

Comments

1. Sam Lichtenstein - February 25, 2010

Regarding text under colim, I think the right thing to do is (in your macro definition) wrap the operator in a \mathop{ } environment. (So you might have a two-stage macro definition; first define the operator, say, as \DeclareMathOperator{\mycolim}{colim} and then
make a macro \newcommand{\colim}{\mathop{\mycolim}}

In fact, I think one can iterate mathop’s to get multiple lines of text underneath displayed sums, limits, etc., which can look nicer when summing over complicated index sets, or example. But I sort of doubt this is the “right” way to do that; does anyone know if there’s a better way?

2. Maia - February 25, 2010

Some nice tips… one tiny thing I noticed, for \frac, (and others), you don’t even need the spaces, ie. \frac12 gets you the same as \frac 1 2.

3. Yossi Farjoun - February 25, 2010

“btw, does anyone know how to get it to place math text under it correctly in an enquation environment? I want it to behave exactly like \lim”

see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=newfunction

use the stared version of DeclareMathOperator.

Yossi

4. Theo - February 25, 2010

This is a great post.

A few comments. First, I think that to get \colim to behave just like \lim, you use \DeclareMathOperator* instead of \DeclareMathOperator

Second, if you’re really trying to save keystrokes, \frac12 gives the same result as \frac 1 2. I often write things like \frac1{a+b}, or whatever, if that’s what I need. Similarly, \C \P^n is the same as \C\P^n. I agree that \CP^n is better, though: you don’t have to keep going up and down on the shift key as much.

Third, hot key macros sound awesome. Somehow I never knew about them, but now I’m going to implement all of them.

As for keeping documents organized, I like to have individual TeX documents for each day of the class, and each one just imports my preamble for the class. I generally always have the preamble in the recent-files menu, and so if I ever need a new math operator, I can add it pretty quickly (I keep my DeclareMathOperator list alphabetized so that I can see whether I’ve declared the operator before). Actually, what I do is I have a document called “today.tex”, which lives in my recent-files menu. As I sit down to start to type, before ever clicking “LaTeX” I command-shift-s and type today’s date in the file name. today.tex then stays as it is: minimal, with the preamble, etc., pre-loaded.

Finally, I like to post my notes essentially immediately (it’s not like I’m going to take any time to edit them soon anyway). So then the trick is to write a simple script that I can issue form the command line. My script does the following. I have a master TeX document that inputs the preamble and each day’s notes and has the instructions for the title, table of contents, etc. The script pdfLaTeXs this document, runs BibTeX and makeindex, pdfLaTeXs a few more times, uploads the pdf to math.berkeley.edu, tars the entire folder, and uploads that too. Now that Evans has reliable internet in the ground floor, this whole process takes under 60 seconds, and so the files post before I’ve even left the room.

5. Robin Houston - February 25, 2010

Since you’re using a Mac, it’s worth mentioning that the TextMate text editor has both excellent LaTeX support and a really nice “snippets” system that’s perfect for defining the sort of shortcuts you’re talking about here.

Snippets can be activated by hot key combinations, but the really cool thing is the “tab trigger”. For example, I’ve got it so that typing pf and then pressing tab will insert

\begin{proof}

\end{proof}

leaving the cursor between the tags. You can have multiple hot-spots within a snippet, and press tab to jump between them, which would work really well for your square-shaped commutative diagram example.

It would work really well for what you’re doing, I think.

6. Daniel - February 25, 2010

Hi Chris,

Just a couple of comments.

(1) To compile just some parts of the document you can use the command \includeonly; you make a master file and call individual files from within — works like a charm: http://en.wikibooks.org/wiki/TeX/includeonly

(2) I know you said you use TeXshop… but, IMHO (and YMMV in this case), i think that the combination of Emacs + AucTeX is much more robust. To do this in the Mac you’ll need the following,

(2a) Aquamacs (it already comes bundled with AucTeX), http://aquamacs.org/

(2b) AucTeX, http://www.gnu.org/software/auctex/

(2c) TeXLive: the MacTeX distribution of TeXlive is the recommended one: http://www.tug.org/mactex/2009/

And, once we’re at it…

(3) LaTeX-make: http://www.ctan.org/tex-archive/support/latex-make/

I’m sure this has the potential to really speed up your current setup. ;-)

7. Chris Schommer-Pries - February 25, 2010

Thanks for the advice on DeclareMathOperator* and on the \mathop. Both seem to do the trick nicely. The first seems like the right thing to put in my preamble, but the \mathop command is going to be useful for those complicated limits and sums. Somehow I never learned that command.

8. skewline - February 25, 2010

I think it helps if you have an idea what letters/symbols are going to come up. I haven’t heard a talk with \CP in the last decade and maybe longer, but I see \mathfrak with capital letters all the time (e.g., the M comes in handy for the stack of prestable curves)..
I learned some live-TeXing from Stefano (here and here) but I never got fast at it.

I am also not motivated enough: I usually can (hand)write down what the speaker says but doesn’t write, and most people find the output readable.

9. Chris Schommer-Pries - February 25, 2010

@ Robin Houston: This TextMate seems very intriguing. I like how the website for it says it is the perfect union of scriptable flexibility and elegant minimalist GUI. I think I agree with the general philosophy and could learn to like it a lot. However it has a $50 price tag. Is it really worth the mula? (Anyone have an opinion?)

While looking it up I found the following links which seemed to have some info on how to set it up and discuss some of the issues:

http://akastrin.wordpress.com/2009/06/26/latex-textmate-and-skim/

http://www.tug.org/pipermail/macostex-archives/2007-January/028104.html

I also found some good tutorial videos on the TextMate website

http://macromates.com/

10. Robin Houston - February 25, 2010

It’s free for the first 30 days, which should be long enough to decide whether or not it’s worth the money to you.

Even silly things like being able to edit multiple lines at once using column selections (http://manual.macromates.com/en/working_with_text#column_selections) are quite frustrating to live without, once you get used to them — at least that was my experience.

11. David P. Sanders - February 25, 2010

Hi, this is a great post!

I have a comment about compiling only part of your document.

If you are include your files with \include, then you can compile only the desired one with \includeonly{desired} in the preamble of your document (i.e. before \begin{document}). This even keeps the correct page numbers for the other (previous) parts of the document.

12. Mike Hall - February 25, 2010

As in many arenas of life, the winner is emacs. I use the setup described here:

http://sites.google.com/site/olegalexandrov/xemacs/latex

It requires knowing and using emacs (or xemacs), and a bit of setup to figure out, but once you can jump that hurdle, there’s a very powerful built-in system for defining auto-expanding abbreviations of the type mentioned above (for free).

Even better, I favor the strategy where you make your TeX code more usable by others by never defining your own LaTeX macros, and just streamlining the typing of the actual raw code with lots and lots of macros. I haven’t quite gotten rid of all my own macros, but I’m getting close.

One annoyance I’ve run into: GNU emacs doesn’t allow abbreviations to begin wtih ‘\’, whereas xemacs does, so I’ve found myself wedded to xemacs for the time being.

13. Chris Schommer-Pries - February 25, 2010

Okay, here is a question for all of you that use other editors, like emacs (or xemacs) or TextMate. In TexShop I have the following feature which I really like when I’m editing/cleaning up my notes. I have open both my LaTeX source file and the compiled (pdf) file which looks pretty. If I’m reading the pretty pdf and I see a typo or something I want to change I just push the command key and click on it. Then the window switches and places my cursor at the correct spot in the LaTeX source file. Conversely if I command-click on the source file it switches to the output pdf and circles the area that the code effects.

This feature isn’t 100% perfect, but when it works it is really useful for editing. Is there anything like this in other LaTeX editor setups?

14. Mike Shulman - February 25, 2010

Chris, that works in Emacs/AucTeX and xdvi, it’s called “source specials.” I didn’t know it was possible to include source specials in a pdf file, but I guess it is.

15. Scott Morrison - February 25, 2010

@#12 On Windows (this is only a distant memory :-) WinEdt supports this too, at least with dvi output and YAP dvi viewer, pretty much out of the box.

16. Lior - February 25, 2010

I take real-time notes using LyX. This eliminates the need to type curly braces etc and gives me programmable keyboard shortcuts for everything.

My standard macro file includes fraktur, blackboard, and curly versions of all letters. It has “DeclareMathOpreator” for everything I’ve encountered so far so it keeps growing. If you care about typesetting details you also need declarations like:

\newcommand\GL{\mathrm{GL}}

Actually, the macros that really save you time are those of the following type:

\newcommand\norm[1]{\left\Vert {#1} \right\Vert}

Finally, don’t forget that you can amend the preamble after the talk is over. There is no rule that requires your LaTeX file to always compile.

17. Lior - February 25, 2010
18. Sam Lichtenstein - February 25, 2010

@Mike Hall: This looks really cool! However when I tried it I ran into the problem that my abbreviations auto-expand with an incorrect capitalization of the first letter.
For example (“\\Gal” “\\operatorname{Gal}” nil 0) in my table of abbreviations expands “\Gal” to “\Operatorname{Gal}” instead
of “\operatorname{Gal}”, which is obviously bad, because it doesn’t compile.

Any suggestions?

19. Robin Houston - February 25, 2010

@Chris You can certainly do that with TM and Skim, using PDFSync.

20. Peter LeFanu Lumsdaine - February 25, 2010

Among the Mac keyboard shortuts for text-editing, I also love option-(shift)-arrow, for moving (selecting) a word at a time — though within formulas its definition of “word” is a little odd,

21. Andrew Stacey - February 26, 2010

Couple more little ones:

1. Use the ‘\ensuremath’ macro in your macros. Then you can use ‘\R’ in running text as well as maths mode saving you four keystrokes (even with live LaTeXing you should still maintain standards and use ‘\(‘ and ‘\)’ for inline maths). Use with the xspace package to ensure that the spacing is correct. Thus:

\newcommand{\R}{\ensuremath{\mathbb{R}}\xspace}

2. Rather than defining ‘\mA’, ‘\mB’ and so forth, just define ‘\m’ with a single argument. Then you just type ‘\m A’ and so forth. If you need a new one, you type ‘\m{AB}’. You could even write the macro so that the *first* time ‘\m{something}’ is invoked then it defines a macro ‘\msomething’ for all future time, thus saving you having to remember whether or not you defined it yet or not.

3. Redefine your keyboard! It’s worth doing a count of which “letters” you use most and putting those in sensible places.

4. Regarding diagrams, I had a crazy idea of using something like xournal or jarnal as my “viewer”. Then for the most part I could type the latex into emacs and make use of that, but when needed, I could annotate the resulting PDF using a combination of graphics tablet and xournal/jarnal. I got close to getting this to work, but then the conference ended and I haven’t looked at it again.

5. If (and it’s a big if) you do keep compiling your document during the talk to see if it looks right, keep your preamble and includes to a minimum. It’s an extreme example, but I just tested compiling one of my lectures and it took 15s. To do this, structure your include file so that stuff is grouped and selectable via options.

6. If you really like having everything done automatically, you can get LaTeX to look at the filename and load in stuff accordingly. Name the file: “notes.lurie.topos.tex” and it loads in stuff that you use for notes, stuff that Lurie keeps talking about, and standard symbols for topoi!

7. Finally, I take the opposite view to Mike Hall. The reason I use lots of macros is so that my LaTeX source document is really clear for others to look at and see what’s going on. So if I write ‘\funct{F}’ then it’s obvious (I hope) that F is going to be a functor, no matter how it turns out in the final document. Plus, I can change how all the functors are displayed at a stroke, rather than having to remember that this instance of mathfrak was a functor and this other was a Lie algebra. Object-oriented TeX is the way to go!

22. David Speyer - February 26, 2010

This is a great post. I’ve been live TeXing talks for the last two years, also using TeXshop, and this gives me a lot of good tricks to try out.

One thing I disagree with: I wouldn’t write \frac 1 2. What happens when I need to copy the equation onto the next line and edit it to turn a 2 into a 1+q? I need to think through the TeX parsing algorithm to figure out how much to copy. I think the extra four keystrokes are worth it to be able to edit and reuse my formulas easily.

Which brings me to the trick which I’ll mention. Speakers often have several successive equations where only one part changes. This is where you get the lead on them! Copy-paste-edit is much faster than chalk.

23. Yuhao Huang - February 27, 2010

I do think live LaTeXer should customize their keyboard…

e.g. put {} at the center of the key board, and replace the numbers 1-9 and 0 by !@#$%^&*() respectively, in this way we can type much faster…

I found one software that allow you to redefine this, and if you bought it (which I didn’t, it is about 10 bucks) you can safe it as a Language/Keyboard layout type “latex”, and you can switch from the “English(US)” layout to “latex” when you type, and everything is customized, — just as when you switch to a french keyboard in your system, “QWERTY” on your keyboard becomes “AZERTY”.

24. Sam Lichtenstein - February 28, 2010

I’m really curious what people think about Andrew Stacey’s and Mike Hall’s differing philosophies about .tex files. Recently I substituted as the live-tex’er for one lecture of a seminar (the person who usually live-tex’ed was away), and I had a lot of trouble even getting the universal notes file to compile on my machine. (I think this was more a font/packages issue than a macro issue, though.) So I just made a new file with the notes for that day, using my standard header file and macros. Later I had to re-integrate those notes into the main file, which meant removing or changing all the macros, which was a real pain! (Surely someone capable of writing a shell script could have done this with one magical line of perl or something, but that sort of thing is beyond me.)

Anyhow, this experience made me buy into the idea that macros should be used sparingly if there is any chance that another human being will have to read your latex “code” at some point. On the other hand, Andrew Stacey’s point about doing things to the opposite extreme, in a fully “object oriented” way, has a certain ring of philosophical truth about it. It just strikes me as impractical. Does anyone have an opinion one way or the other as to which philosophy is superior. (What about for collaborating with 1 or 2 coauthors on an actual paper, versus for rapidly live-texing lecture notes? Are the considerations different in this case?)

25. Chris Schommer-Pries - February 28, 2010

I’m torn on the issue. On the one hand I think that the object oriented approach is a better philosophical approach to document production. It makes the document more consistent and easier to update and maintain. I also think that if it is done well, it can make the source file much more readable to outsiders.

On the other hand, I once had a similar experience to comment #23. My job was to gather and collect abstracts for an Olberwolfach report. I was fairly inexperienced at the time, and if I did it over again I would have provided people with a template and required that they don’t define any new macros. Instead I just got the files with each persons random macros in it. I had a long and difficult experience trying to merge these into something that would actually compile. So I am sympathetic to Mike Hall’s point of view.

I think for live-TeXing it is justifiable to do whatever makes it easier for the author. For me that means lots of macros and hot-key commands.

26. Mike Hall - March 2, 2010

@Sam Lichenstein

There’s an option for abbreviation expansion that makes the case of the expansion “match” the case of the abbreviation, which I think is what you’re running into. Unfortunately I don’t remember what the variable is that you would need to change. In this case it seems like the easiest workaround would be to make the abbreviation “\gal” (lowercase ‘g’).

27. Andrew Stacey - March 2, 2010

Curiously, I’ve just read a section of the Camel book which touches on this. I quote: “We’ve all fallen into the trap of using cut-and-paste when we should have chosen to define a higher-level abstraction, if only just a loop or subroutine.” and onwards.

The point is that hacking something together is fine if you only need to do it once. As soon as you start needing to use it again, it’s best to abstract it.

I think that Chris has got it about right except for the final sentence in his second paragraph: to me, the experience described there supports my view, not Mike’s!

I’m not a raving OO hardliner. I tend to go with whatever makes my life easiest. I tend to make my tex files OO-like now because I find that that works best. But I can see that for live-tex’ing, speed is of the essence and other considerations come into play. But when you have the time, it’s worth doing it elegantly because, in the end, that will save you time.

Incidentally, TeX is quite happy with scoping so all those redefinitions of macros can be avoided quite simply. Consider two files, master.tex and slave.tex.

master.tex is:

\documentclass{article}

\def\hello{hello}

\begin{document}

\hello
\input{slave}
\hello

\end{document}

slave.tex is:

\def\hello{greetings}
\hello

Result:

hello greetings greetings

Now put braces around the input line. Result:

hello greetings hello

Simple!

(Okay, so long as no-one used \gdef …)

28. Chris Aldrich - March 16, 2010

Here’s one to throw everyone for a nice curve… and to potentially add some additional richness and speed things up considerably for the TeX newbies.

For the last year and a half, I’ve been using the Pulse pen from Livescribe.com. It’s a brilliant product, particularly for advanced level mathematics lectures and discussions. It simultaneously records everything written down using an infrared “camera” and special (inexpensive) paper as well as everything that was said with an audio recorder! It links the two together in real-time so that one can go back and “rewatch” past lectures for review or to add in additional written notes after the fact. You can actually watch the notes being “rewritten” out in real time as you hear exactly what was being said as they were originally being written. A relatively inexpensive $175 gets you a 4GB pen, a few ink refills, a starter notebook, a sync cradle, a pair of stereo headphones/microphones, and the continuously improving software to go with it.

In the last couple of months, it’s been so popular in my Galois Theory class, that now at least 4 others have purchased them. The accompanying software and online site allows sharing lecture notes with others (via email, blog, facebook, etc.), as well as exporting the handwritten file almost immediately as a .pdf file or exporting the audio of the lecture as .ACC, .MP4, and other popular audio files.

More relevant to the thread above, there’s a $29 plug-in for this software that does handwriting to type conversion, so that after a quick processing, I’ve got a typewritten version of my notes which I can cut and paste into my TeX editor (I prefer WinEdt) tweak for a few minutes and voila… perfectly typeset lecture notes, and often without the need for as many/any custom macros or definitions.

It also solves the issues of drawing diagrams into notes and gives the added benefit of having an audio recording of the lecture for later consultation. Even with poor handwriting, the software has a search function built into it as well so one can quickly find things even in 100’s of pages of notes and then immediately both see/hear what was originally said.

The livescribe.com website has some excellent short videos showing the features of the pen in action. I couldn’t recommend it more highly, particularly for math students.

Incidentally the pen also has an open SDK for developers to dig into the guts for their own further customization. It’s also not too difficult to strip out the flash movie files their website creates natively and convert them into videopodcasting format for later viewing/sharing as well.

29. Chris Schommer-Pries - March 17, 2010

Do you have to get the speaker to wear a microphone? I’m skeptical about how well it could record audio, but I don’t really have much experience with these things…

30. Chris Aldrich - March 17, 2010

@Chris, No the lecturer doesn’t even have to know you’re taping it. There’s a great microphone built into the pen itself that does really well in most all lecture settings from small rooms to large lecture halls. If you’re sitting in the back of a 400 person lecture hall, I’d recommend plugging the headphones into the pen and using the two mics built into the earbuds (you don’t need to have the headphones in your ears while recording) and set the recording quality to the highest setting (of three). I’ve yet to meet a lecture situation that I haven’t been able to get great results with. They’re even good with getting quietly asked questions by the audience.

Additionally the pen has some fairly advanced signal processing built into it as during playback, you can listen to the audio at 2x, 4x, 8x + speeds and the audio is resampled so the speaker talks faster but doesn’t sound like Mickey Mouse.

31. My adventure in live TeXing and some notes « Climbing Mount Bourbaki - July 7, 2010

[...] is pretty and computer files don’t (usually) vanish.  I recommend it to others, as well as this post of Chris [...]

32. Recovery of a technical post | M and D blog - July 29, 2010

[...] have not used LaTeX in this way, but someone else has. The linked article has a treasure trove of good advice on how to make your creation of LaTeX [...]

33. Stuart Ambler - October 15, 2011

Chris, Mike, Andrew, thanks. I used to write software before coming to math grad school. Having one’s own private language, “o-o” or not, seems like something to be avoided if possible, though I’m impressed with people who are able to TeX live. Even without that, when I first saw how people used LaTex, it struck me as a write-only language. At one point I thought I’d use my adviser’s include file(s) for my thesis, which I thought could help with compatibility, but it was easier to write my own, though I’ve tried to keep it small. The problem, I think, is that LaTeX doesn’t understand math; it’s all about typesetting. I’ve been tempted to help remedy that, but it surely would be another career. Perhaps if Andrew’s specific idea of a more meaningful language for mathematicians to use gained adherents, or if people got together to define something we could all agree on? … Now back to my thesis.


Sorry comments are closed for this entry

Follow

Get every new post delivered to your Inbox.

Join 655 other followers

%d bloggers like this: