We will not try to describe the language precisely here;
interested readers may refer to the appendix for more details.
Throughout this section, we will write expressions
as they are handed to the typesetting program (hereinafter called
except that we won't show the delimiters
that the user types to mark the beginning and end of the expression.
is described at the end of this section.
As we said, typing x=y+z+1 should produce $x=y+z+1$,
Variables are made italic, operators and digits become roman,
and normal spacings between letters and operators are altered slightly
to give a more pleasing appearance.
Spaces and new lines in the input are used by
to separate pieces of the input;
they are not used to create space in the output.
Free-form input is easier to type initially;
subsequent editing is also easier,
for an expression may be typed as many short lines.
Extra white space can be forced into the output by several
characters of various sizes.
A tilde ``\|~\|'' gives a space equal
to the normal word spacing in text;
a circumflex gives half this much,
and a tab charcter spaces to the next tab stop.
also serve to delimit pieces of the input.
f(t) = 2 pi int sin ( omega t )dt
f(t) = 2 pi int sin ( omega t )dt
are special, and potentially worth special treatment.
looks up each such string of characters
in a table, and if appropriate gives it a translation.
become their greek equivalents,
becomes the integral sign
(which must be moved down and enlarged so it looks ``right''),
is made roman, following conventional mathematical practice.
Parentheses, digits and operators are automatically made roman
Fractions are specified with the keyword
Similarly, subscripts and superscripts are introduced by the keywords
x sup 2 + y sup 2 = z sup 2
x sup 2 + y sup 2 = z sup 2
The spaces after the 2's are necessary to mark the end of
has to be marked off by spaces or
some equivalent delimiter.
The return to the proper baseline is automatic.
Multiple levels of subscripts or superscripts
``x\|\|sup\|\|y\|\|sup\|\|z'' is
is recognized as a special case,
$x sub i sup 2$ instead of ${x sub i} sup 2$.
More complicated expressions can now be formed with these
{partial sup 2 f} over {partial x sup 2} =
x sup 2 over a sup 2 + y sup 2 over b sup 2
{partial sup 2 f} over {partial x sup 2} =
x sup 2 over a sup 2 + y sup 2 over b sup 2
Braces {} are used to group objects together;
in this case they indicate unambiguously what goes over what
on the left-hand side of the expression.
The language defines the precedence of
to be higher than that of
no braces are needed to get the correct association on the right side.
Braces can always be used when in doubt
The braces convention is an example of the power
of using a recursive grammar
It is part of the language that if a construct can appear
can also occur in that context.
operator for making square roots of the appropriate size:
``sqrt a+b'' produces $sqrt a+b$,
x = {-b +- sqrt{b sup 2 -4ac}} over 2a
x={-b +- sqrt{b sup 2 -4ac}} over 2a
Since large radicals look poor on our typesetter,
is not useful for tall expressions.
Limits on summations, integrals and similar
constructions are specified with
sum from i=0 to inf x sub i -> 0
sum from i=0 to inf x sub i -> 0
Centering and making the $SIGMA$ big enough and the limits smaller
and the central part (e.g., the $SIGMA$)
lim from {x -> pi /2} ( tan~x) = inf
lim from {x -> pi /2} ( tan~x) = inf
the braces indicate just what goes into the
There is a facility for making braces, brackets, parentheses, and vertical bars
of the right height, using the keywords
left [ x+y over 2a right ]~=~1
left [ x+y over 2a right ]~=~1
need not have a corresponding
as we shall see in the next example.
Any characters may follow
but generally only various parentheses and bars are meaningful.
are often used with another facility,
which make vertical piles of objects.
rpile {1 above 0 above -1}
~~lpile {if above if above if}
~~lpile {x>0 above x=0 above x<0}
rpile {1 above 0 above -1}
~~lpile {if above if above if}
~~lpile {x>0 above x=0 above x<0}
The construction ``left {''
makes a left brace big enough
which is a right-justified pile of
``lpile'' makes a left-justified pile.
There are also centered piles.
Because of the recursive language definition,
can contain any number of elements;
any element of a pile can of course
to use the right sizes and fonts,
there are times when the default assumptions
are simply not what is wanted.
in the previous example would conventionally
Slides and transparencies often require larger characters than normal text.
Thus we also provide size and font
``size 12 bold {A~x~=~y}''
$size 12 bold{ A~x~=~y}$.
is followed by a number representing a character size in points.
this paper is set in 9 point type.)
If necessary, an input string can be quoted in "...",
which turns off grammatical significance, and any font or spacing changes that might otherwise be done on it.
lim~ roman "sup" ~x sub n = 0
to ensure that the supremum doesn't become a superscript:
lim~ roman "sup" ~x sub n = 0
Diacritical marks, long a problem in traditional typesetting,
x dot under + x hat + y tilde + X hat + Y dotdot = z+Z bar
x dot under + x hat + y tilde
+ X hat + Y dotdot = z+Z bar
There are also facilities for globally changing default
sizes and fonts, for example for making viewgraphs
or for setting chemical equations.
The language allows for matrices, and for lining up equations
at the same horizontal position.
Finally, there is a definition facility,
at any time in the document;
henceforth, any occurrence of the token ``name''
will be expanded into whatever was inside
the double quotes in its definition.
the language to their own specifications,
for it is quite possible to redefine
Section 6 shows an example of definitions.
preprocessor reads intermixed text and equations,
uses lines beginning with a period as control words
(e.g., ``.ce'' means ``center the next output line''),
uses the sequence ``.EQ'' to mark the beginning of an equation and
The ``.EQ'' and ``.EN'' are passed through to
so they can also be used by a knowledgeable user to
center equations, number them automatically, etc.
``.EQ'' and ``.EN'' are simply ignored by
so by default equations are printed in-line.
``.EQ'' and ``.EN'' can be supplemented by
for example, a centered display equation
can be produced with the input:
Since it is tedious to type
``.EQ'' and ``.EN'' around very short expressions
(single letters, for instance),
the user can also define two characters to serve
as the left and right delimiters of expressions.
These characters are recognized anywhere in subsequent text.
For example if the left and right delimiters have both been set to ``#'',
Let #x sub i#, #y# and #alpha# be positive
Let $x sub i$, $y$ and $alpha$ be positive
Running a preprocessor is strikingly easy on
The vertical bar connects the output