home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / PASCAL / PT01.ZIP / FMT.MAN < prev    next >
Encoding:
Text File  |  1983-09-07  |  6.3 KB  |  161 lines

  1. .im man.im
  2. .NM fmt produce formatted output
  3. .SY fmt [-p] [input-file ...]
  4. .FU
  5. .ital fmt
  6. reads its input a line at a time and writes a neatly formatted version
  7. of the input text to the output, with page headers and footers and with
  8. output lines filled to a uniform right margin.
  9. Input text lines may have interspersed among them command lines
  10. that alter this default mode of formatting.
  11. A command line consists of a leading period, followed by a two letter
  12. code, possibly with optional arguments following the first sequence of
  13. blanks and tabs.
  14. .sp
  15. If the -p argument is given,
  16. .ital fmt
  17. reads the file named 'fmt.fnt' and uses the control characters in that
  18. file to handle special fonts (specified with the .sf command).
  19. .sp
  20. Certain commands cause a "break" in the processing of input text lines,
  21. i.e., any partially filled line is output and a new line is begun.
  22. In the following command summary, the letter
  23. .bold n
  24. stands for an optional numeric argument.
  25. If a numeric argument is preceded by a
  26. .bold +
  27. or
  28. .bold -,
  29. the current value is
  30. .bold changed
  31. by this amount;
  32. otherwise the argument represents the new value.
  33. If no argument is given,
  34. the default value is used.
  35. .sp
  36. .nf
  37. .in 0
  38. .sf 6
  39.       Command      Break?  Default  Function
  40. .sf 0
  41. .sp
  42.       .*           no               comment (no effect on output)
  43.       .bp n        yes     n=+1     begin page numbered n
  44.       .br          yes              cause break
  45.       .ce n        yes     n=1      center next n lines
  46.       .cp n        yes     n=0      conditional page, starts new page
  47.                                     if less than n lines left
  48.       .dm name def no               define macro 'name' with 'defn'
  49.       .fi          yes              start filling
  50.       .fo /l/m/r/  no      empty    footer title (see .sx)
  51.       .hd n        yes              start a level n heading (n=0 to 4)
  52.       .he /l/m/r/  no      empty    header title (see .sx)
  53.       .im file     no               imbed, to read from given file
  54.       .ju          no               start right justify
  55.       .in n        no      n=0      indent n spaces
  56.       .ls n        no      n=1      line spacing is n
  57.       .nf          yes              stop filling
  58.       .nj          yes              stop right justify (but not filling)
  59.       .pl n        no      n=66     set page length to n
  60.       .rm n        no      n=60     set right margin to n
  61. .cp 8
  62.       .sf n        no      n=0      set character font type, as:
  63.                                         n=0  normal
  64.                                         n=1  double strike
  65.                                         n=2  emphasized
  66.                                         n=3  italics
  67.                                         n=4  double width
  68.                                         n=5  compressed
  69.                                         n=6  underline
  70.       .sp n        yes     n=1      space n lines or to bottom of page
  71. .cp 2
  72.       .sx /l/m/r/  yes              output line adjusted on left, middle,
  73.                                     and right (like titles)
  74.       .ti n        yes     n=0      temporary indent of n
  75.       .ul n        no      n=1      underline words from next n lines
  76. .in 4
  77. .fi
  78. .NOTES
  79. A blank input line causes a break and is passed
  80. to the output unchanged.
  81. Similarly, an input line that begins with blanks causes a break
  82. and is written to the output with the leading blanks preserved.
  83. Thus a document formatted in the conventional manner by hand will retain
  84. its original paragraph breaks and indentation.
  85.  
  86. The following characters are treated special when found on input:
  87.  
  88. .in +8
  89. .ti -4
  90. \\@-@Backslash. Cancels any special meaning of character
  91. following it.
  92. .ti -4
  93. \@@-@ATsign. Acts as a hidden blank, to keep justify padding
  94. from happening between words. For example, '1)\@example'
  95. becomes '1)@example'.  This is particularly useful with
  96. the .ti function.
  97.  
  98. .in -8
  99. A very limited macro facility is supported with the .dm command.  The macro
  100. name may be any alphanumeric name, and the definition consists of commands
  101. and text separated by a delimiter character (which is assumed to be the first
  102. non-blank following the name).  The most serious limitations are:
  103. 1) macros cannot be longer than 200 characters. 2) macros cannot invoke
  104. other macros. 3) a maximum of 9 arguments may be passed.
  105. An example macro definition is:
  106.  
  107. \.dm bold /.sf 2/%1 %2 %3 %4 %5 %6 %7 %8 %9/.sf 0/
  108.  
  109. Once defined, the macro is invoked like any command.  The %n will be replaced
  110. with the corresponding argument.  Undefined arguments become NULL.
  111. Arguments within quotes (either " or ') are taken as a whole to allow
  112. them to contain blanks.
  113. Thus, invoking the above macro as '.bold@very@bold@"of@@@@YOU'
  114. would translate to
  115. .Q1
  116. \.sf 2
  117. very bold of    YOU
  118. \.sf 0
  119. .Q2
  120. The .im command allows you to 'imbed' other files in the current file.
  121. When a .im command is found,
  122. .ital fmt
  123. begins reading input from the given file.  On ENDFILE, it returns
  124. to reading from the current file.  Imbedded files may imbed other
  125. files up to 6 levels deep.
  126.  
  127. The .hd command creates
  128. level 'n' headings.  It automatically numbers the heading, based on
  129. the level.  It also has default fonts it uses for the heading to
  130. make it stand out.  The font defaults are:
  131.  
  132. .nf
  133. Level 0  -  Emphasized    Underlined  Unnumbered
  134. Level 1  -  Emphasized    Underlined  x.x
  135. Level 2  -  Double-Strike Underlined  x.x
  136. Level 3  -  Emphasized                x.x.x
  137. Level 4  -  Double-Strike             x.x.x.x
  138. .fi
  139.  
  140. The .sx, .he, and .fo commands perform automatic left, middle, and right
  141. justification of text.  The left, middle, and right portions are
  142. separated by a delimiter character (which is assumed to be the first
  143. non-blank following the command).
  144. .FUTURE
  145. .nf
  146. Add support for other output devices
  147. A box command (.bx)
  148. An adjust (left margin) command (.ad)
  149. Conditional execution (.if)
  150. Allow .hd format options to be redefined dynamically
  151. Automatically numbered lists
  152. Extra space after a sentence
  153. Allow font definitions to be imbedded in text (like \\1 = .sf 1)
  154. Automatic generation of table of contents
  155. .fi
  156. .BUGS
  157. If the file to be formatted has TABS in it, in 'nofill' mode the
  158. tabs sometimes screw up the format if you are also indenting text.
  159. It is best to file documents in 'notabs' mode if your editor automatically
  160. replaces blanks with tabs.
  161.