home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / lout2.lzh / LOUT2 / DOC / TR.EQ / s4 < prev    next >
Text File  |  1994-01-25  |  4KB  |  124 lines

  1. @Section
  2.    @Title { Features from Standard Lout }
  3. @Begin
  4. @PP
  5. In this section we summarize those features of standard Lout of most
  6. relevance to equation formatting.  All are freely available within
  7. equations.  Full details may be found in the Lout reference manual
  8. [{@Ref kingston92}].
  9. @PP
  10. Standard Lout uses the symbols {@Code "#"}, {@Code "{"}, {@Code "}"},
  11. {@Code "&"}, {@Code "|"}, and @Code "/" for special purposes (the braces
  12. are used for grouping, for example).  To get these characters into
  13. equations without using their full names, enclose them in double quotes:
  14. {@Code "\"{\""}, {@Code "\"}\""}, etc.  Any sequence of characters
  15. including spaces but not newlines may be so enclosed, and the effect is
  16. to turn off any special meaning that the symbols within it might have.
  17. @PP
  18. Eq sets letters in Slope (Lout's name for Italic), digits in Base (i.e.
  19. Roman), and other symbols in various fonts, mostly the Symbol font.  To
  20. change fonts, use the @Code "@Font" symbol:
  21. @ID {
  22. @Code "Slope @Font \"2\""
  23. |7ct
  24. @Eq { Slope @Font "2" }
  25. }
  26. In Eq it will often be necessary to enclose the right parameter in
  27. double quotes, because the symbol 2 includes a built-in change back to
  28. Base font.  Changing fonts makes white space between objects in the
  29. right parameter appear in the result.  The @Code "@Font" operator also
  30. does size changes:
  31. @IL
  32. @LI {
  33. @Code "sum"
  34. |7ct
  35. @Eq { sum }
  36. }
  37. @LI {
  38. @Code "\"+2p\" @Font sum"
  39. |7ct
  40. @Eq { "+2p" @Font sum }
  41. }
  42. @LI {
  43. @Code "2.0f @Font sum"
  44. |7ct
  45. @Eq { 2.0f @Font sum }
  46. }
  47. @EL
  48. Here @Code "\"+2p\" @Font" sets its right parameter in a font two points
  49. larger than it would otherwise have been; @Code "2.0f @Font" sets its
  50. right parameter in a font twice the original size.  Sizes should always
  51. be specified relative to the enclosing size as we have done here, since
  52. then they don't need to be changed if a decision is made to set the entire
  53. document in a different size.  It is necessary to enclose @Code "+2p" in
  54. double quotes within Eq, because otherwise the @Code "+" will be taken as
  55. the Eq symbol for {@Eq { + }}.  The right parameter may be any object.
  56. @PP
  57. Whenever similar equations or parts of equations are being typed
  58. repeatedly, @I definitions should be used to save time.  Suppose for
  59. example that @OneCol @Eq { p sub i ` log sub 2 ` p sub i } occurs
  60. frequently.  Then
  61. @ID @Code "def epi { p sub i ` log sub 2 ` p sub i }"
  62. makes the symbol @Code "epi" stand for the object between the braces:
  63. @ID {
  64. @Code "big sum from i=1 to n ` epi"
  65. |7ct
  66. @Eq { big sum from i=1 to n ` epi }
  67. }
  68. Symbols may be given parameters:
  69. @ID @Code {
  70. "def ep"
  71. "   right x"
  72. "{ p sub x ` log sub 2 ` p sub x"
  73. "}"
  74. }
  75. The parameter @Code x will be replaced by the object just to the right
  76. of {@Code "ep"}:
  77. @ID {
  78. @Code {
  79. "big sum from j=1 to k ` ep i +"
  80. "big sum from j=k+1 to n ep j"
  81. }
  82. ||7ct
  83. @Eq {
  84. big sum from j=1 to k ` ep i +
  85. big sum from j=k+1 to n ep j
  86. }
  87. }
  88. The precedence of such symbols will be 100 by default.
  89. @PP
  90. To make the symbols of Eq available within such definitions, each must be
  91. preceded by {@Code "import @Eq"}.  The best place to keep them is in the
  92. setup file, which might then look like this:
  93. @ID @Code {
  94. "@SysInclude { ft  }"
  95. "@SysInclude { dl  }"
  96. "@SysInclude { eq  }"
  97. ""
  98. "import @Eq"
  99. "def epi { p sub i ` log sub 2 ` p sub i }"
  100. ""
  101. "import @Eq"
  102. "def ep right x { p sub x ` log sub 2 ` p sub x }"
  103. ""
  104. "@Use { @DocumentLayout }"
  105. }
  106. Use of @Code "epi" and @Code "ep" outside equations will cause an error.
  107. @PP
  108. Equations can appear within a paragraph of text, or they can be
  109. displayed.  Eq's job is to produce a Lout object containing the
  110. equation; it neither knows nor cares where this equation goes.  To get
  111. an equation within a paragraph, simply place @Code "@Eq { ... }" at the
  112. desired point.  To prevent it spreading over two lines, use
  113. {@Code "@OneCol @Eq { ... }"}.  To display an equation, use a display
  114. symbol from some other Lout package.  For example, the DocumentLayout package
  115. [{@Ref kingston92begin}] has @Code "@IndentedDisplay" or @Code "@ID" for an
  116. indented display, and @Code "@CentredDisplay" or @Code "@CD" for a centred
  117. display, so
  118. @ID @Code "@CD @Eq { int supp pi on 0 sin ` x = 0 }"
  119. produces
  120. @CD @Eq { int supp pi on 0 sin ` x = 0 }
  121. DocumentLayout also provides display symbols that make it easy to
  122. produce aligned and numbered equations.
  123. @End @Section
  124.