Thomas Becker's Free Software Utilities

Super TeX Dollar: Smart $ and $$ for Emacs TeX Mode

One of the things that is unusual about TeX and LaTeX is that there is a single character, namely the dollar sign, that is used as an opening delimiter as well as its own closing delimiter. Moreover, to make things more complicated, two dollar signs in succession are also viewed as an opening delimiter, with the same succession of two dollar signs as the closing delimiter. If it hadn't been my ueber-hero Donald Knuth who came up with this, I would have said it's crazy.

Anyway, when using an editor such as Emacs, you have of course high expectations concerning delimiter matching. But Emacs, by default, is not prepared to handle the kind of thing that TeX does with the dollar sign. Even in TeX mode, there isn't a lot of intelligence to the $ key. Therefore, I wrote super-tex-dollar, a function which, when bound to the dollar key, will give you pretty amazingly smart behavior concerning TeX's dollar and double-dollar delimiters.

For more information, see the documentation of super-tex-dollar. If you use TeX or LaTeX a lot for mathematical typesetting, you should give it a try. I can assure you that I have eaten my own dog food: I wrote a 574 page math book and many mathematical research papers using this thing.

super-tex-dollar comes with Emacs Lisp source code, byte-compiled code, and the documentation in HTML format.

Download super-tex-dollar