[Prev][Next][Index][Thread]
subscripts on operators (etc)

To: w3cmatherb@w3.org

Subject: subscripts on operators (etc)

From: Neil Soiffer <soiffer@wolfram.com>

Date: Sun, 28 Apr 1996 00:27:50 0500 (CDT)

From soiffer@wolfram.com Sun Apr 28 01: 27:53 1996

MessageId: <199604280527.AAA09410@morrison.wolfram.com>
Bruce claimed that it was not possible in an operator precedence parser
to (cleanly) have subscripted operators, or more generally, embellished
operators. This is not true, and I can offer the typesetting system
in Mathematica as a counterexample. I talked to Bruce over the phone to
explain how this is done (it requires extra work), and he agrees that it is
possible. The one piece of information that you need is whether an operator
is a 2d structure creating operator or not.
For example, in Mathematica's typesetting syntax,
a + b
n
is represented as "a + \_ n b", where \_ is the subscript operator.
2d structure creating operators do their 'error correction' operations
differently than regular "linear" syntax.
Mathematica's typesetting syntax has the following 2d operators:
a \/ b fraction
a \^ b superscript
a \_ b subscript
a \_ b \% c sup and superscript
a \+ b underscript (lower limit)
a \& b overscript (upper limit)
a \+ b \% c underscript (lower and upper limit)
\@ a square root
\@ a \% b 'b'th root of 'a'
The 2d operators are escaped so that the characters '/', '^', etc.,
all simply represent themselves.
"a \_ b \% c" is used instead of "a \_ b \^ c" because the later would
mean (a \_ b) \^ c (the superscript would be to the right of the subscript
instead of over it).
An embellished operator has the same precedence as an unembellished operator
(as Ron Whitney pointed out in his mail).
Since human readability and writeable seems to be of high importance to this
group, and since '^' and '_' will be much less frequently used in HTML than
in Mathematica, I think switching the '^' and '\^' (etc) makes sense for HTML
math. Ie, let '^' be the superscript operator and let '\^' stand for the
character '^'. Given this, expressions such as
y = ∫ _ 0 % 1 sin^2(x) ⅆ x
are parseable. To me, this notation is fairly clean and has, I think all of
the properties that we are looking for in HTML math's notation. Opinions?
Neil
FollowUps: