home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / rainbow / cpm / misc2 / profftut.prf < prev    next >
Text File  |  1994-09-07  |  15KB  |  487 lines

  1.  
  2. PROFF
  3.  
  4.      By:    Steven Tress
  5.         Feb. 1984
  6.  
  7. INTRODUCTION
  8.  
  9.      This is a tutorial for using PROFF, a word processing 
  10. program that formats documents such as letters, essays, and even 
  11. books for printing.  The structure of the tutorial is oriented 
  12. for those who have had little or no experience using text 
  13. formatters.  The sections of this tutorial start at the beginner 
  14. level and end with the most advanced features of PROFF.
  15.  
  16.  
  17. INPUT
  18.  
  19.      PROFF is a text formatter that supports functions such as 
  20. filling and justifying.  It works on a text file that you create 
  21. with a text editor.  The output file can either be 
  22. specified or can be redirected to a file or device.  If no input 
  23. file and no redirection command is given, the output goes to the 
  24. console.
  25.  
  26.      Text can be entered in any format.  Lines can be broken at 
  27. wherever is convenient, as PROFF ignores whitespace.  Spaces at
  28. the beginning of a line causes a break.  A break means that the 
  29. line will not be filled or justified.  
  30.  
  31. COMMANDS
  32.  
  33.      PROFF formats text according to request lines embedded in 
  34. the text of a document.  Request lines begin with a 
  35. distinguishing 'control character' which defaults to a period.   
  36. The 'control  character' can be changed with a PROFF request.
  37.  
  38. OUTPUT
  39.  
  40.      Output lines are automatically filled and justified.  The 
  41. default values are good enough for most applications and PROFF 
  42. can be used with no request lines but if the margins aren't 
  43. appropriate or the spacing isn't suitable, they can be changed as 
  44. needed using the requests available under PROFF.
  45.  
  46. GETTING STARTED
  47.  
  48.      This section helps you start formatting right away.  It 
  49. presents the very basic commands needed to adjust parameters such 
  50. as the margins.  In many cases, the default values are suitable; 
  51. however, if you desire a different format, these commands will 
  52. help get you started.
  53.  
  54.      Left and right margins can be controlled by the requests 
  55. 'in' and 'rm' preceded by a period, which is the default 'control 
  56. character'.  In the text, the commands would look like this:
  57.  
  58.  .in 7
  59.  .rm 72
  60.  
  61.      This tells PROFF that left margin is indented 7 spaces.  The 
  62. left margin is at column 8 and the right margin at column 72.  
  63. Line spacing is specified by the 'ls' request.  The request
  64.  
  65.  .ls 2
  66.  
  67. tells PROFF to format the document double spaced.  
  68.  
  69.  .pl 58
  70.  
  71. specifies a page length of 58 lines.
  72.  
  73.      All numeric arguments can have relative values as well.  If 
  74. a passage form a quote needs to be single spaced, the request
  75.  
  76.  .ls -1
  77.  
  78. will decrease the line spacing from double spaced to single 
  79. spaced.  Similarly, if the passage is to be indented then you 
  80. could specify
  81.  
  82.  .in +5
  83.  
  84. just before the passage and then
  85.  
  86.  .ln -5
  87.  
  88. to return to the normal left margin.
  89.  
  90.      If temporary indentation is needed, then the 'ti' request 
  91. can be used to specify the indentation of a single line of 
  92. output.
  93.  
  94.  .ti +3
  95.  
  96. would specify that the next output line be indented three spaces 
  97. more than the current left margin.
  98.  
  99.  .ti -3
  100.  
  101. would specify an indentation three spaces left of the current 
  102. left margin.
  103.  
  104.      It may be desired to centre a line or two for 
  105. presentability.  The request 'ce' takes care of this.
  106.  
  107.   .ce 4
  108.  
  109. will centre the next four lines within the left and right 
  110. margins.
  111.  
  112.      The 'sp' request is used to tell PROFF to space a number of 
  113. lines before continuing.
  114.  
  115.  .sp 5
  116.  
  117. will cause five blank lines before the next output line.
  118.  
  119.      PROFF justifies and fills text by default.  There may be 
  120. cases where you would want to turn off these features, such as in 
  121. a table or figure. Justification may be turned off by the 
  122. '.nj' request and fill by the '.nf' request.  To turn on justify 
  123. and fill again, use the '.ju' and '.fi' commands respectively.  
  124.  
  125.      These eleven commands should be enough for most purposes.  
  126. They are the basic commands for contolling the general format of 
  127. a page of output.  The next section deals with enhancing the 
  128. printed page.  It is advised that you practise with the basic 
  129. commands before preceding to the next section.
  130.  
  131. SUMMARY OF THE BASIC REQUESTS
  132.  
  133.  .in  n             set left margin to column n+1    default=0
  134.  
  135.  .rm  n             set right margin to column n     default=65
  136.  
  137.  .ls  n             set line spacing to n            default=1
  138.  
  139.  .pl  n             set page length to n lines       default=66
  140.  
  141.  .ti  n             temporarily indent next output
  142.                     line n spaces                    default=0
  143.  
  144.  .ce  n             centre the next n input lines    default=1
  145.  
  146.  .sp  n             space n lines, except at top
  147.                     of page                          default=1
  148.  
  149.  .nf                stop filling
  150.  
  151.  .nj                stop justifying
  152.  
  153.  .fi                start filling
  154.  
  155.  .ju                start justifying
  156.  
  157.  
  158. ENHANCING THE OUTPUT
  159.  
  160.  
  161.      This section deals with making the output appear more 
  162. attractive.  Certain features such as bolding and underlining are 
  163. sometimes desired to add a finishing touch to a document.
  164.  
  165.      In order to bold a line, the .bd request is used.
  166.  
  167.  .bd 2
  168.  
  169. tells PROFF to bold the next two lines.  If there is only one 
  170. word that needs to be bolded, it can be put on a separate line.  
  171. Remember, PROFF ignores whitespace except if it is at the 
  172. beginning of a line, therefore lines can be broken and will still be 
  173. formatted.
  174.  
  175.      A feature similar to bolding is underlining.  There are two 
  176. kinds of underlining: continuous underlining and word 
  177. underlining.
  178.  
  179.  .cu 5
  180.  
  181. specifies that the next 5 lines will be continuously underlined.  
  182. Similarly,
  183.  
  184.  .ul 5
  185.  
  186. specifies that the words in the next 5 lines will be underlined.
  187.  
  188.      Page formatting often enhances the output greatly.  Of the 
  189. better enhancers are headings and footings.
  190.  
  191.  .he /l/c/r
  192.  
  193. specifies that the text "l" will be left justified, the text "c" 
  194. will be centred, and the text "r" will be right justified at the 
  195. top of the page.  Footing is done similarly:
  196.  
  197.  .fo /l/c/r
  198.  
  199. The separator need not be a slash (/).  PROFF will treat the 
  200. first character it meets after the request as a separator.
  201.  
  202.      In some cases, it may be desired to have different headings 
  203. and footings depending on whether the page is evenly or oddly 
  204. numbered.
  205.  
  206.  .eh t
  207.  
  208. specifies that the text "t" will be the header on all even pages.
  209. The following commands control even and odd headers and footers.
  210.  
  211.  .eh      even header
  212.  .oh      odd header
  213.  .ef      even footer
  214.  .of      odd footer
  215.  
  216.      There are many ways to format the length of your page.  The 
  217. page length request '.pl' was already mentioned.  Spacing between 
  218. headers and footers may also be controlled.
  219.  
  220.  .m1 2
  221.  
  222. specifies that there will be 2 lines between the top of the page 
  223. and the header.
  224.  
  225.  .m2 3
  226. requests three lines between the header and the text.
  227.  
  228.  .m3 3
  229.  
  230. takes care of the spacing between the text and the footer.  In 
  231. this case, there will be a 3 line space, and
  232.  
  233.  .m4 2
  234.  
  235. means there will be a 2 line space between the footer and the 
  236. bottom of the page.  In this example, if .pl 66 specifies a 66 
  237. line text, then the number of text lines will be:
  238.  
  239.      number of text lines = pl - (m1 + m2 + m3 + m4)
  240.                           = 66 - ( 2 +  3 +  3 +  2)
  241.                           = 56
  242.  
  243.  
  244.      There is also a request that will allow spacing from the top 
  245. or bottom of a page.
  246.  
  247.  .st 5
  248.  
  249. will space 5 lines from the top of the page, and
  250.  
  251.  .st -5
  252.  
  253. will space 5 lines from the bottom of the page.
  254.  
  255.      The next section is for those who have had some experience 
  256. with PROFF.  It is recommended that you familiarize yourself with 
  257. the commands covered in the preceding two sections before 
  258. advancing to the next set of requests.
  259.  
  260.  
  261. SUMMARY OF INTERMEDIATE REQUESTS
  262.  
  263.  .bd n              boldface next n lines         default=1
  264.  
  265.  .cu n              continuously underline next
  266.                     n lines                       default=1
  267.  
  268.  .ul                underline words in the
  269.                     n lines                       defaut=1
  270.  
  271.  .he /l/c/r         head titles are left,
  272.                     centre, right
  273.  
  274.  .fo /l/c/r         foot titles are left,
  275.                     centre, right
  276.  
  277.  .eh t              head titles on even pages
  278.  
  279.  .oh t              head titles on odd pages
  280.  
  281.  .ef t              foot titles on even pages
  282.  
  283.  .of t              foot titles on odd pages
  284.  
  285.  .m1 n              space between top of
  286.                     page and head title           default=3
  287.  
  288.  .m2                space between head title
  289.                     and text                      default=2
  290.  
  291.  .m2                space between text and
  292.                     foot title                    default=2
  293.  
  294.  .m3                space between foot title
  295.                     and bottom of page            default=3
  296.  
  297.  .st n              space to line n from top
  298.                     of page, a negative          default=0
  299.                     number spaces to line n
  300.                     from bottom of page           default=0
  301.  
  302.  
  303.  
  304. FOR THE ADVANCED USER
  305.  
  306.      Now that you have some experience with PROFF, some of the 
  307. more advanced features will be covered.
  308.  
  309.      One of the better features of PROFF is the ability to store 
  310. commonly used requests in a file.  Then all one has to do is 
  311. include that file and let PROFF do the rest.  The request to include 
  312. a file is presented:
  313.  
  314.  .so common.prf
  315.  
  316. This request at the top of your text will instruct PROFF to take 
  317. more requests from commom.prf.  This is especially useful if you 
  318. are using PROFF for a continuing application.
  319.  
  320.      The application might be indicated with a comment, such as
  321.  
  322.  .# ycsformat
  323.  
  324. The '#' request indicates that the line will not be written to 
  325. the output file and will be treated as a comment.
  326.  
  327.      For other applications, it may be easier to define your own 
  328. requests made up of PROFF requests.  The following set of 
  329. requests defines a paragraph request.
  330.  
  331.  .de PG
  332.  .sp
  333.  .ti +3
  334.  .en
  335.  
  336.      The requests 'de' and 'en' delimit the definition of 'PG', 
  337. which can now be used to space one line and indent the next line 
  338. by three spaces.  Parameters can also be used in defintions.  
  339. Arguments are referenced using _$1, _$2, _$3, up to _$9.  _$0 
  340. references the command name itself, allowing for recursive 
  341. defintions.  Now we can improve our paragraph request.
  342.  
  343.  .de PG
  344.  .sp
  345.  .ti +_$1
  346.  .en
  347.  
  348. The equivalent of our original definition can now be specified as
  349.  
  350.  .PG 3
  351.  
  352.      If the period is to be used in the first column as part of a 
  353. particular application, the 'control character' can be changed.
  354.  
  355.  .cc %
  356.  
  357. changes the 'control character' to a per cent symbol.  All 
  358. requests must be preceded by this symbol instead of the period.
  359.  
  360.      If an entire document needs to be offset, the '.po' request 
  361. is the one for the job.  The request line
  362.  
  363.  .po 7
  364.  
  365. will offset the entire page, including diagrams, to be offset by 
  366. 7 spaces from the left margin.
  367.  
  368.      If a break is ever desired, the request
  369.  
  370.  .br
  371.  
  372. will cause all formatting to be stopped for the next output line.  
  373. Beginning a line with a space will have the same effect.
  374.  
  375.      Numbers can be inserted anywhere in the text using number 
  376. registers.
  377.  
  378.  .nr a 9
  379.  
  380. defines the number register 'a' and places the value 9 in it, 
  381. which can be referenced in the text with '_@na'.  (A literal '@' 
  382. may be inserted by using '___@').  There are a total of 26 number 
  383. registers named a-z.
  384.  
  385.  
  386. SUMMARY OF ADVANCED REQUESTS
  387.  
  388.  .so file           includes an input file
  389.  
  390.  .#                 start of a comment line
  391.  
  392.  .de xx             defines command xx
  393.  
  394.  .en                ends command definition
  395.  
  396.  .cc c              specifies 'c' as the
  397.                     'control character'      default='.'
  398.  
  399.  .po n              sets page offset to n spaces
  400.  
  401.  .br                causes a break
  402.  
  403.  .nr x n            defines number register
  404.                     x and places value n in it
  405.  
  406.  
  407. EXECUTING PROFF
  408.  
  409.      PROFF may be invoked with some command line instructions.  
  410. The format of the command line looks like this:
  411.  
  412.      PROFF [+n] [-n] [-s] [-pon] [file] 
  413.  
  414. If the input file is not specified, PROFF uses standard input.  
  415. Output goes to standard output.  Standard input and output can 
  416. also be redirected to a file or device.  Here is a summary of the 
  417. command line options.
  418.  
  419.      Instruction         Function
  420.  
  421.      +n                  starts printing at page number n.
  422.  
  423.      -n                  stops printing after page number n.
  424.  
  425.      -s                  stops printing after each page to allow
  426.                          for paper change - a message is given 
  427.                          before the first page and the bell 
  428.                          is rung thereafter
  429.  
  430.      -pon                moves the entire document n spaces
  431.                          from the left margin (same as the
  432.                          text request 'po')
  433.  
  434.      Combining the command line requests with the text requests 
  435. can render PROFF a very powerful text formatting tool.  Some of 
  436. the advanced features allow for easy use in special applications; 
  437. however, PROFF is easy to learn and can be used for any 
  438. application with a minimum of requests.
  439.  
  440. MISCELLANEOUS
  441.  
  442.     The folowing requests are not discussed in the tutorial, but
  443. are included for completeness.  For more details on these requests,
  444. refer to the PROFF User's Guide.
  445.  
  446.  .eb        enable bolding
  447.  
  448.  .db        disable bolding
  449.  
  450.  .bp n        causes a new page to begin with n, if present, as
  451.         the page number
  452.  
  453.  .pn type    defines page number format: type can be roman or 
  454.         arabic
  455.  
  456.  .np        turns off paging
  457.  
  458.  .pa        restores paging
  459.  
  460.  .ne n        if less than n lines are available, start new page
  461.  
  462.  .cl n        enter line in table of contents at level n
  463.  
  464.  .pc n        print table of contents with offset set to
  465.         n for each level
  466.  
  467.  .vs var def    defines a variable to be used in the text 
  468.          preceded with a "_$"
  469.  
  470.  .vg var prmpt  interactive version of .vs
  471.  
  472.  .ec c        sets c to be the escape character; defaults to "__"
  473.  
  474.  .sv        saves the PROFF environment on the stack
  475.  
  476.  .rs        restores the last saved environment
  477.  
  478.  .lx comm eq    replaces command with an equate
  479.  
  480.  .ap        turns on autoparagraphing; causes a paragraph when
  481.         a line begins with a blank or tab.
  482.  
  483.  .na        turns off autoparagraphing
  484.  
  485.  .wr string    writes an output string used in configuring
  486.         a printer of terminal
  487.