@Section
   @Title { Features from Standard Lout }
@Begin
@PP
In this section we summarize those features of standard Lout of most
relevance to equation formatting.  All are freely available within
equations.  Full details may be found in the Lout reference manual
[{@Ref kingston92}].
@PP
Standard Lout uses the symbols {@Code "#"}, {@Code "{"}, {@Code "}"},
{@Code "&"}, {@Code "|"}, and @Code "/" for special purposes (the braces
are used for grouping, for example).  To get these characters into
equations without using their full names, enclose them in double quotes:
{@Code "\"{\""}, {@Code "\"}\""}, etc.  Any sequence of characters
including spaces but not newlines may be so enclosed, and the effect is
to turn off any special meaning that the symbols within it might have.
@PP
Eq sets letters in Slope (Lout's name for Italic), digits in Base (i.e.
Roman), and other symbols in various fonts, mostly the Symbol font.  To
change fonts, use the @Code "@Font" symbol:
@ID {
@Code "Slope @Font \"2\""
|7ct
@Eq { Slope @Font "2" }
}
In Eq it will often be necessary to enclose the right parameter in
double quotes, because the symbol 2 includes a built-in change back to
Base font.  Changing fonts makes white space between objects in the
right parameter appear in the result.  The @Code "@Font" operator also
does size changes:
@IL
@LI {
@Code "sum"
|7ct
@Eq { sum }
}
@LI {
@Code "\"+2p\" @Font sum"
|7ct
@Eq { "+2p" @Font sum }
}
@LI {
@Code "2.0f @Font sum"
|7ct
@Eq { 2.0f @Font sum }
}
@EL
Here @Code "\"+2p\" @Font" sets its right parameter in a font two points
larger than it would otherwise have been; @Code "2.0f @Font" sets its
right parameter in a font twice the original size.  Sizes should always
be specified relative to the enclosing size as we have done here, since
then they don't need to be changed if a decision is made to set the entire
document in a different size.  It is necessary to enclose @Code "+2p" in
double quotes within Eq, because otherwise the @Code "+" will be taken as
the Eq symbol for {@Eq { + }}.  The right parameter may be any object.
@PP
Whenever similar equations or parts of equations are being typed
repeatedly, @I definitions should be used to save time.  Suppose for
example that @OneCol @Eq { p sub i ` log sub 2 ` p sub i } occurs
frequently.  Then
@ID @Code "def epi { p sub i ` log sub 2 ` p sub i }"
makes the symbol @Code "epi" stand for the object between the braces:
@ID {
@Code "big sum from i=1 to n ` epi"
|7ct
@Eq { big sum from i=1 to n ` epi }
}
Symbols may be given parameters:
@ID @Code {
"def ep"
"   right x"
"{ p sub x ` log sub 2 ` p sub x"
"}"
}
The parameter @Code x will be replaced by the object just to the right
of {@Code "ep"}:
@ID {
@Code {
"big sum from j=1 to k ` ep i +"
"big sum from j=k+1 to n ep j"
}
||7ct
@Eq {
big sum from j=1 to k ` ep i +
big sum from j=k+1 to n ep j
}
}
The precedence of such symbols will be 100 by default.
@PP
To make the symbols of Eq available within such definitions, each must be
preceded by {@Code "import @Eq"}.  The best place to keep them is in the
setup file, which might then look like this:
@ID @Code {
"@SysInclude { ft  }"
"@SysInclude { dl  }"
"@SysInclude { eq  }"
""
"import @Eq"
"def epi { p sub i ` log sub 2 ` p sub i }"
""
"import @Eq"
"def ep right x { p sub x ` log sub 2 ` p sub x }"
""
"@Use { @DocumentLayout }"
}
Use of @Code "epi" and @Code "ep" outside equations will cause an error.
@PP
Equations can appear within a paragraph of text, or they can be
displayed.  Eq's job is to produce a Lout object containing the
equation; it neither knows nor cares where this equation goes.  To get
an equation within a paragraph, simply place @Code "@Eq { ... }" at the
desired point.  To prevent it spreading over two lines, use
{@Code "@OneCol @Eq { ... }"}.  To display an equation, use a display
symbol from some other Lout package.  For example, the DocumentLayout package
[{@Ref kingston92begin}] has @Code "@IndentedDisplay" or @Code "@ID" for an
indented display, and @Code "@CentredDisplay" or @Code "@CD" for a centred
display, so
@ID @Code "@CD @Eq { int supp pi on 0 sin ` x = 0 }"
produces
@CD @Eq { int supp pi on 0 sin ` x = 0 }
DocumentLayout also provides display symbols that make it easy to
produce aligned and numbered equations.
@End @Section
