Mathtext improvements (merging into trunk)

Michael Droettboom <mdroe@...31...>

In the existing mathtext implementation, font style changes affect the
following group. For example, in \\cal\{R\} x, only the R will be in
calligraphic face. In TeX, however, font style markers stay in effect
until the next font style marker or the end of the enclosing group.

To clarify a little: in Plain TeX people usually write \{\\cal R\}x,
beginning the group before the font-changing macro. The LaTeX macros
such as \mathcal take an argument: for example, both \\mathcal\{R\}x and
\\mathcal Rx cause only R to have the calligraphic font. (The latter is
because of TeX's parsing rules: \mathcal takes one argument, and since
there is no {}-group, the argument consists of the single letter R.)
The old mathtext style font-changing commands behave like the LaTeX
macros but have names like the Plain TeX macros, and the change you
are proposing to merge makes mathtext have both Plain TeX and LaTeX
style commands.

It's difficult to trap the old
case and correct for it, since both are still valid.

Is it easy to detect when a Plain TeX style command is followed by an
opening brace, and output a warning? It is typically not useful to
start a new group right after a font-changing command, so such usage is
more likely to be caused by someone relying on the old behavior.

Becoming more TeX-like is a good thing, but does breaking existing
matplotlib plots warrant some additional care here? Should this be
merged into trunk, or onto some other branch where we're going to be
breaking a lot of things. It is probably feasible to have a
"compatibility" mode for this, but is that (in this particular case)
worth the extra maintenance burden?

IMHO this should be merged into trunk, with a warning in case of "\cal{"
if that is feasible, but no other compatibility mode.


Jouni K. Sepp�nen