Thomas Becker's Free Software Utilities

super-tex-dollar: A Smart TeX Dollar for Emacs

Copyright (C) 1993 Thomas Becker


  1. Overview
  2. Usage
  3. Download and Installation
  4. Feedback and Bug Repors
  5. Future Work


One of the most common errors when running Tex or LaTex is the mismatched $ or $$ delimiter. It is of course desirable to have the text editor assist with avoiding these mistakes. super-tex-dollar provides such assistance for Emacs.


There is no need to study any documentation concerning super-tex-dollar. Just install it according to the instructions below and start writing TeX or LaTeX source. You will notice that inserting the $ character will result in behavior and messages that are sensitive to the context.

Note about paragraphs: Both TeX and LaTeX require that dollars and double dollars be matched properly within each paragraph. Therefore, you get the full benefit of super-tex-dollar only if you make it possible for super-tex-dollar to recognize the beginning of each new paragraph. You do that by always having at least one blank line between paragraphs.

If you are interested in the exact logic that governs the behavior of super-tex-dollar, please read the TUGboat article.

Download and Installation

To download super-tex-dollar, click here. To install it, place the file super-tex-dollar.elc in some directory DIR. Add the lines

(add-hook 'tex-mode-hook
          '(lambda ()
             (define-key tex-mode-map [?$] 'super-tex-dollar)))

(autoload 'super-tex-dollar "DIR/super-tex-dollar.elc")

to your Emacs initialization file, where you have replaced the string "DIR" in the autoload call with the actual directory where super-tex-dollar.elc resides. "DIR" may of course be omitted if super-tex-dollar.elc is in a directory where Emacs looks for lisp files. Be sure to load super-tex-dollar.elc and not super-tex-dollar.el. It is customary but not necessary to put the .el file in the same directory as the .elc file.

Feedback and Bug Reports

Click to send feedback and bug reports concerning super-tex-dollar.

Future Work

When show-paren-mode is on, then matching dollars and double dollars should be highlighted in the same way as matching opening and closing parentheses.
Back to top