### Adding custom math environments to ultra-tex mode

You've defined a new math environment. You'd like to include it in ultra-tex' incredibly handy ring of math environments which are invoked by repeated banging on the \$ key. How is this done?

Three things need to be changed to add the custom math environments. Suppose, for the sake of this example, that the new environment is named foo.

1. Hit M-x customize-group, followed by ultra-tex-environments. (Remember that you can save typing using the tab key. Most likely, typing ult[TAB]-env[TAB] will get the proper environment to alter.
2. Alter the regular expressions (regexps) which tell ultra-tex about the beginnings and ends of math environments.
1. Find the Ultex Math Start variable, and click the Show Value button.
2. Insert the regexp choice \|foo*? in a Good Spot, for instance, right before \|gather*?.
3. Find the Ultex Math End variable, and click the Show Value button.
4. Insert the same rexexp choice as above in the same location.
3. Put your environment into the dollar ring.
1. Find the Ultex Dollar Array variable, and click the Show Value button.
2. Look for where you'd like the foo environment to come in the ring.
3. Click the Ins button.
4. Insert  \begin{foo} | \end{foo}
4. Go back to the top of the page, and click the Set for Current Session and Save for Future Sessions buttons.

If you forget to insert the proper regexps, ultra-tex will get quite confused. It will change the math environment until it hits foo, and then starts all over again, nesting new math environments inside foo.