@Section
   @Title { Commonly used symbols }
   @Tag { mat_comm }
@Begin
@PP
@Code "@Math" prints characters in the fonts appropriate for mathematics:
@ID {
@Code "x - 2"
|7ct
@Math { x-2 }
}
Here @Math { x } is in Italic, @Math { 2 } is in Roman, and @Math { minus }
is from the Symbol font.  The character @Code "-" is a @I symbol which
stands for @Math {minus}, and @Code "2" is also a symbol, standing for
@Math { 2 }.  @Code "@Math" offers a vast array of symbols:
@ID {
@Code "Omega delta integral partial club"
|7ct
@Math { Omega delta integral partial club }
}
This section introduces the most commonly used ones;
Section {@NumberOf mat_summ} has the full list.
@PP
Symbols whose names are made from letters should be separated from each
other by at least one space or end of line, as was done above, or else
@Code "@Math" will become confused:
@ID {
@Code "Omegadelta"
|7ct
@Math { Omegadelta }
}
Symbols whose names are made from digits and punctuation characters can,
however, be run together with each other and with symbols made from
letters:
@ID {
@Code "Omega-delta<=2"
|7ct
@Math { Omega-delta<=2 }
}
This rule applies throughout Lout (Section {@NumberOf spaces}).
@PP
Some symbols join objects together in mathematical ways:
@ID {
@Code "x sub 2"
|7ct
@Math { x sub 2 }
}
Here the @Code "sub" symbol has taken the object just to its left, and
mathematics.sub. @SubIndex { @Code "sub" symbol }
sub. @Index { @Code "sub" symbol (mathematics) }
the object just to its right, and joined them into one object in the
form of a subscript.  The two objects are called the left and right
parameters of {@Code "sub"}, and they may be arbitrary Lout objects.
@PP
Similar symbols include {@Code "sup"} for
mathematics.sup. @SubIndex { @Code "sup" symbol }
sup. @Index { @Code "sup" symbol (mathematics) }
superscripting, @Code "over" for built-up fractions,
mathematics.over. @SubIndex { @Code "over" symbol }
over. @Index { @Code "over" symbol (mathematics) }
and @Code sqrt for square roots.
mathematics.sqrt. @SubIndex { @Code "sqrt" symbol }
sqrt. @Index { @Code "sqrt" symbol (mathematics) }
The @Code "-" symbol used earlier is an example of a
@I { binary operator } symbol, and @Code "<=" is
mathematics.binary.operators. @SubIndex { binary operators }
binary.operators. @Index { binary operators (mathematics) }
a @I { relation } symbol.  These take the objects
mathematics.relation. @SubIndex { relation symbols }
relation.symbols. @Index { relation symbols (mathematics) }
to their left and right and display them as shown; it's hard
to see, but there is slightly more space around relations
than around binary operators.  There are also @I { large operator }
mathematics.large.operators. @SubIndex { large operators }
large.operators. @Index { large operators (mathematics) }
symbols which take @Code { from } and @Code { to } options and
set them as limits:
@ID {
@Code @Verbatim { sum from { i=0 } to { n } i }
|7ct
@Math { sum from { i=0 } to { n } i }
}
As usual in Lout, options are optional, but when given, their values
must be enclosed in braces as shown.  Section {@NumberOf mat_summ}
has the full list of large operator symbols.
@PP
All these symbols may be used together to produce complicated
mathematics very easily:
@ID {
@Code @Verbatim { sqrt { x sup 2 + y sup 2 } over 2 }
|7ct
@Math { sqrt { x sup 2 + y sup 2 } over 2 }
}
Braces are used in the usual way for grouping.  Leaving them out
creates ambiguities:
@ID @Code "a  sup  b  over  c"
There are two possible interpretations for this:
@IndentedList
@LI {
@Code "{a  sup  b}  over  c"
|7ct
@ZeroHeight @Math {  {a  sup  b}  over  c }
}
@LI {
@Code "a  sup  {b  over  c}"
|7ct
@Math {  a  sup  {b  over  c} }
}
@EndList
@Code "@Math" chooses between them in the following way.  Every symbol
that takes a parameter also has a {@I precedence}, which is a number
defined in Section {@NumberOf mat_summ}.
mathematics.precedence @SubIndex { precedence of symbols }
precedence.mathematics @Index { precedence of symbols (mathematics) }
The symbol with the higher precedence wins the object lying between
them.  White space between two objects is considered to be a symbol
whose precedence is lower than that of any @Code "@Math" symbol.  If
two symbols of equal precedence compete for an object, the association
is towards the left.
@PP
In the above case the first interpretation is chosen, because
@Code "sup" has higher precedence than {@Code "over"}.  When
in doubt, use braces to make the grouping clear.
@End @Section
