.cs begin
 
 
    *------------------------------------------------------------*
    |                                                            |
    |  This is the STAFFSET file used to create a standard       |
    |  formatting environment for all Brown Computer Center      |
    |  documentation.  It sets up the page layout and defines    |
    |  MACROs that facilitate uniform formatting.                |
    |                                                            |
    |                                          HRB               |
    |                                          06/16/77          |
    |                                                            |
    |  Revisions:                                                |
    |                                                            |
    |    01/15/86  Replaced .BS hexjoins with "&x'nn"s --ahr    |
    |                                                            |
    |    12/28/82  Changed .blt, .alp, and .seq to prevent       |
    |              justification from inserting blanks           |
    |              between the bullet and the text.              |
    |                                                            |
    |              Added error checking for end out of           |
    |              sequence.                                     |
    |                                                            |
    |              Removed use of /02 and /03 in these macros.   |
    |                                                            |
    |              Added logical line continuation with "("      |
    |                                        -jb                 |
    |                                                            |
    |    04/14/82  Box and bracket translation only if           |
    |              &SYSTERMT = TERM.  Formerly if SYSONLINE = Y  |
    |                                                            |
    |    07/26/77  ADJUST value set only if not already set by   |
    |              user;  line length set to 64;  parentheses    |
    |              are underscored;  offset in EXAM remote now   |
    |              5;  conditional page for examples.            |
    |                                                            |
    |    12/13/77  The SEQ remote has been modified so that the  |
    |              BLT remote can be used within a SEQ and yield |
    |              a properly formatted result.                  |
    |                                                            |
    |    02/28/78  Reference words for left and right brackets   |
    |              added;  "corners" translated online.          |
    |                                                            |
    |    03/20/78  Table of Contents added for decimal blocks    |
    |              (thanks to JBB);  .cp value increased in      |
    |              .topic remote;  .head remotes added.          |
    |                                                            |
    |    06/01/78  General cleanup.  Several enhancements added; |
    |              see documentation for details.                |
    |                                                            |
    |    07/01/78  Indexing capability added.                    |
    |                                                            |
    |    03/29/79  TOFC remote changed for compatibility with    |
    |              modified operation of .TC control word.       |
    |                                                            |
    |    05/05/80  Added remote to start pagenumber in bottom    |
    |              title on the second page (automatically)      |
    |              fixed various macros to work with 3.5         |
    |              replaced the footnote macros with stolen      |
    |              versions from sysezdef.  Formatted the tentry |
    |              macro, added conditional spacing to most      |
    |              macros.  Generally mucked things around.      |
    |              What would Henri say? -- jb.                  |
    |                                                            |
    |    05/08/80  Different adjust values, using command        |
    |              line option &BINDING= LEFT|CENTER .           |
    |              Formatted some other macros;                  |
    |              compromised on conditional spacing.           |
    |              Bullets, numeric points, and alphabetic       |
    |              points are now uniformly indented             |
    |              one space, with text starting in four         |
    |              spaces, and are generated using               |
    |              'undent' instead of 'output overlay'.         |
    |              Tentry defaults to indent of 10.              |
    |              Blanks are now underscored only in            |
    |              in blocks and heads.         --rn.            |
    |                                                            |
    |    05/29/80  Removed sysbot remote for starting            |
    |              pagenumbering; set '.pi 0' and removed        |
    |              .pp macro; added a check for previous         |
    |              imbed of staffset; tab char now defaults;     |
    |              'endnote' alternative to footnotes. --rn.     |
    |                                                            |
    *------------------------------------------------------------*
 
 
 
.cs end
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Make sure file hasn't already been imbedded.
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.if &$stimbed eq 'YES';.th .ef
.sr $stimbed = 'YES'
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Define and initialize our reference words.  By
.*       convention, all of our reference words are
.*       prefixed with a dollar sign.  Reference words
.*       used locally within a single macro are
.*       preceded by a "*", according to SCRIPT conventions.
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.sr $alpct = 1               ;.cm  .alp index value
.sr $alppend = 0             ;.cm  .alp pending
.sr $b1ct = 0                ;.cm  decimal block counters
.sr $b2ct = 0                ;.cm  ...
.sr $b3ct = 0                ;.cm  ...
.sr $bltpend = 0             ;.cm  .blt pending
.se $binding = &binding      ;.cm  adjust control
.sr $fnct = 0                ;.cm  footnote count
.sr $fnconv = ''             ;.cm  footnote conversion instructions
.sr $fnout = ''              ;.cm  current footnote text
.sr $fnlen = 0               ;.cm  length of symbols around footnote
.se $index = &index          ;.cm  index control
.sr $nestlevel = 0           ;.cm  nesting level of macros
.sr $pitb1 = 'Y'             ;.cm  table of contents flags
.sr $pitb2 = 'Y'             ;.cm  ...
.sr $pitb3 = 'Y'             ;.cm  ...
.sr $pith1 = 'N'             ;.cm  ...
.sr $pith2 = 'N'             ;.cm  ...
.sr $pith3 = 'N'             ;.cm  ...
.sr $seqct = 1               ;.cm  .seq counter
.sr $seqpend = 0             ;.cm  .seq pending
.sr $tenin = 99              ;.cm  .tentry indent value
.sr $tenof = 10              ;.cm  .table entry offset
.sr $trigger = 55            ;.cm  page eject trigger
.sr $spb = '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
.*
.sr $lbr = "&x'ad."          ;.cm  left bracket
.sr $rbr = "&x'bd."          ;.cm  right bracket
.sr $ulc = "&x'ac."          ;.cm  upper left-hand corner
.sr $urc = "&x'bc."          ;.cm  upper right-hand corner
.sr $llc = "&x'ab."          ;.cm  lower left-hand corner
.sr $lrc = "&x'bb."          ;.cm  lower right-hand corner
.sr $bullet = "&x'af."       ;.cm  bullet
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Modify footnote instructions if endnotes are requested.
.*       If current terminal type is regular terminal, change footnotes
.*       to be inline numerals surrounded by parentheses.
.*       If any online terminal, convert a few special characters to
.*       facsimiles.
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
..su off
..cw
..su ..if '&SYSTERMT' eq TERM
.  ..th ..sr $fnconv = |..sr $fnout =  '(&$fnct.)';..sr $fnlen = 3+&l'&$fnct|
.  ..el ..sr $fnconv = |..sr $fnout = &S'&$fnct.;..sr $fnlen = 1+&l'&$fnct|
..su ..if '&NOTE' eq END
.  ..th ..sr $enconv = |..sr $fnout = '&$fnct.&$hex02';..sr $fnlen = 5;..sr $fnun = 2+&l'&$fnct|
.  ..el ..sr $enconv = |..sr $fnun = &$fnlen|
..su on
..cw ;
.if '&systermt' eq TERM
.th .do
.tr ac * bc * ab * bb * bf - af - ad < bd >
.do end
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Set up page format.
.*       Allowance is made for two heading lines.
.*       Paragraphs are not indented.
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.ll 64;.tm 8;.hm 4;.hs 2;.bm 7;.fm 2
.tt 1 ////;.tt 2 ////;.bt ////
.wd yes
.pi 0
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Set up adjust values for left or center binding.
.*       Default adjust value is 2, to allow for revision bars;
.*       this can be easily changed to a margin of 10, suitable for
.*       NW printing, or alternate margins of 13 and 6, for use
.*       with back-to-back printing, by specifiying LEFT or CENTER
.*       on the SCRIPT command line:
.*
.*                SCRIPT filename (+BINDING= LEFT | CENTER
.*
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.if &sysad eq 0
.   .th .ad 2
.   .el .cm
.if &$binding eq CENTER
.   .th .do begin
.      .ad 6
.      .ad odd 7
.      .em yes
.      .do end
.   .el .cm
.if &$binding eq LEFT
.   .th .do begin
.      .ad 10
.      .em no
.      .do end
.   .el .cm
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Set up index.  The index will be printed when the .pix
.*       macro is called, but only if indexing has been
.*       enabled by means of a new command line option:
.*
.*                SCRIPT filename (&INDEX= YES
.*
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.if &$index = YES
.th .do
.dm sysix0 /.sk 1/.in 0/.cc 4/&1/
.dm sysix1 /.in 0/.hi 1/
.dm sysix2 /.in 3/.hi 1/
.dm sysix3 /.in 6/.hi 1/
.sr sysixref = '^^'
.dm pix begin
.pa
.head1 'Index'
 ^
.co
.ju no
.su on
.cl (&sysll-2)/2
.sr gutter = &sysll-2*&syscl
.cd 2 0 &syscl+&gutter
.ix . dump
.sc
.in 0
.dm pix end
.do end
.el .do
.dm ix //
.dm pix //
.do end
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Set up Table of Contents.  For best results, the last
.*       line of the file should invoke the following macro:
.*
.*                 .tofc
.*
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.dh 1 to ts noj
.dh 2 to nts tcin 1
.dh 3 to nts tcin 2
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Define special characters:  "," becomes the no-break
.*       control indicator;  "!" is defined as the hilight escape
.*       character;  "^" is defined as the special, non-expandable
.*       blank;  "|" is defined as the revision character for
.*       revision level 1;  "(" is the character to cause the
.*       next line to be appended (without a blank) to the current
.*       line.
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.dc linb ,
.ud set !
.dc rb ^
.dc cont (
.rc 1 |
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Define initial tab settings to be ten spaces apart.
.*       Set default tab character.
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.tb 11 21 31 41 51 61
.tb set #
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Define miscellaneous formatting macros:
.*
.*       .alp     to create a series of "alphabetic" points;
.*
.*       .blt     to format a point with a bullet;
.*
.*       .exam    to set off sample lines of terminal input
.*                or JCL;
.*
.*       .pp      to begin a paragraph without indentation;
.*
.*       .seq     to create a series of numbered points;
.*
.*       .tentry  to create a table entry;
.*
.*       .tend    to end a series of table entries;
.*
.*       .tofc    to generate a Table of Contents;
.*
.*       .topic   to define a low-level heading that does not
.*                warrant a decimal label.
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.cm                                 - - - alp         - - -
.dm alp begin
.if &T'&1 eq 'N'
.  .th .do
.     .se $alpct = &1
.     .do end
.if &e'&$alppend = 0 .sr $alppend = 0
.if &0 eq 0 OR &T'&1 eq 'N'
.  .th .do
.     .if &$alppend = 0 .do begin
.          .se $nestlevel = &$nestlevel + 1
.          .se $alppend = &$nestlevel
.          .in +4
.          .do end
.     .cp 5
.     .sk 1
.     .un 3
.     .se *alpchr = &a'&$alpct
.     &*alpchr..&sysrb.&syscont
.* If we can continue on the same line do so, otherwise just overprint.
.     .if '&syscont.' = ' ' .sk -1
.     .se $alpct = &$alpct + 1
.     .if &$alpct gt 26 .sr $alpct = 1
.     .do end
.  .el .do
.     .if &$alppend ^= &$nestlevel .do begin
.        .er 4 ATTEMPT TO END .alp OUT OF SEQUENCE.
.        .ef
.        .do end
.     .sk 1;.sk 1 c
.     .in -4
.     .se $nestlevel = &$nestlevel - 1
.     .sr $alppend = 0
.     .sr $alpct = 1
.     .do end
.dm alp end
.*
.cm                                 - - - blt         - - -
.dm blt begin
.if &e'&$bltpend = 0 .sr $bltpend = 0
.if &0 eq 0
.th .do
.      .if &$bltpend = 0 .do begin
.            .se $nestlevel = &$nestlevel + 1
.            .se $bltpend = &$nestlevel
.            .in +4
.            .do end
.      .sk 1
.      .un 3
.      &$bullet.&sysrb.&sysrb.&syscont
.* If we can continue on the same line do so, otherwise just overprint.
.      .if '&syscont.' = ' ' .sk -1
.      .do end
.el .do begin
.     .if &$bltpend ^= &$nestlevel .do begin
.        .er 4 ATTEMPT TO END .blt OUT OF SEQUENCE.
.        .ef
.        .do end
.     .sk 1;.sk 1 c
.     .in -4
.     .se $nestlevel = &$nestlevel - 1
.     .sr $bltpend = 0
.     .do end
.dm blt end
.*
.cm                                 - - - exam        - - -
.dm exam begin
.if &0 eq 0
.   .th .do
.      .fo no
.      .in +5
.      .sk 1;.cp begin
.      .do end
.   .el .do
.      .fo yes
.      .br
.      .in -5
.      .br;.cp end
.      .sk 1;.sk 1 c
.      .do end
.dm exam end
.*
.cm                                 - - - pp          - - -
.dm pp begin
.sk 1 c
.dm pp end
.*
.cm                                 - - - seq         - - -
.dm seq begin
.if &0 gt 0 AND &T'&1 eq 'N'
.   .th .do
.      .se $seqct = &1
.      .do end
.if &e'&$seqpend = 0 .sr $seqpend = 0
.if &0 eq 0 OR &T'&1 eq 'N'
.   .th .do
.      .if &$seqpend = 0 .do begin
.            .se $nestlevel = &$nestlevel + 1
.            .se $seqpend = &$nestlevel
.            .in +5
.            .do end
.      .se *seqct = &$seqct
.      .if &$seqct lt 10 .se *seqct = '&sysrb.&*seqct.'
.      .sk 1
.      .cp 5
.      .un 4
.      &*seqct.)&sysrb.&syscont
.* If we can continue on the same line do so, otherwise just overprint.
.      .if '&syscont.' = ' ' .sk -1
.      .se $seqct = &$seqct + 1
.      .do end
.   .el .do
.      .if &$seqpend ^= &$nestlevel .do begin
.        .er 4 ATTEMPT TO END .seq OUT OF SEQUENCE.
.        .ef
.        .do end
.      .sk 1;.sk 1 c
.      .in -5
.      .se $nestlevel = &$nestlevel - 1
.      .sr $seqpend = 0
.      .sr $seqct = 1
.      .do end
.dm seq end
.*
.cm                                 - - - tentry      - - -
.dm tentry begin
.if &0 eq 0
.     .th .er 4 'MISSING TENTRY OPERAND'
.el .do
.  .if &$tenin = 99
.     .th .se $tenin = &sysin
.  .if &0 = 2 AND &T'&2 eq 'N'
.     .th .se $tenof = &2
.  .sk 1
.  .in &$tenin+&$tenof
.  .se *tenpad = (&$tenof - (&L'&1)) - 1
.  .se *tenblank = ''
.  .if &*tenpad gt 0
.     .th .se *tenblank = '&$spb(1|&*tenpad)'
.  .un &$tenof
.  &1.&*tenblank
.  .if &*tenpad lt 0
.     .th .br
.  .do end
.dm tentry end
.*
.cm                                 - - - tend        - - -
.dm tend begin
.sk 1;.sk 1 c
.in &$tenin
.sr $tenin = 99
.dm tend end
.*
.cm                                 - - - tofc        - - -
.dm tofc begin
.pa 1
.pn roman
.dh 1 pa noj nto us spaf 4
.tc 1 Table of Contents
.dm tofc end
.*
.cm                                 - - - topic       - - -
.dm topic begin
.if &0 eq 0
. .th .er 4 MISSING TOPIC HEADING
. .el .do
.   .sk 2;.cp 7
.   .ud on . , ( ) ^ 40
.   .us !&$bullet !&1
.   .ud off . , ( ) ^ 40
.   .sk 1;.sk 1 c
.   .do end
.dm topic end
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Define MACROs used to create decimal blocks.  They
.*       are named BLOCK1, BLOCK2, and BLOCK3, and all require
.*       a heading string, in quotes, as a parameter.  BLOCK1
.*       allows the initial level number as a second parameter.
.*
.*       Also define MACROs used to create non-decimal blocks.
.*       They are named HEAD1, HEAD2, and HEAD3, and all
.*       require a heading string, in quotes, as a parameter.
.*
.*       Also define a MACRO that sets the "page eject"
.*       trigger used by BLOCK1 and HEAD1 and another
.*       macro that determines the blocks and headings
.*       to be included in the Table of Contents.
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.cm                                 - - - block1      - - -
.dm block1 begin
.if &0 eq 0
.th .er 4 MISSING BLOCK1 HEADING
.el .do
.ur .if &0 eq 2 AND &T'&2 eq 'N'
.th .se $b1ct = &2
.el .se $b1ct = &$b1ct + 1
.sk 5
.cp &$trigger
.ud on . , ( ) ^ 40
.ur .uc &$b1ct &1
.ud off . , ( ) ^ 40
.ur .if &$pitb1 = Y
.th .ur .hl 1 &$b1ct &1
.sk 3;.sk 2 c
.do end
.sr $b2ct = 0
.sr $b3ct = 0
.dm block1 end
.*
.cm                                 - - - block2      - - -
.dm block2 begin
.ur .if &0 eq 0
.th .er 4 MISSING BLOCK2 HEADING
.el .do
.se $b2ct = &$b2ct + 1
.sk 3;.cp 8
.ud on . , ( ) ^ 40
.ur .uc &$b1ct..&$b2ct &1
.ud off . , ( ) ^ 40
.ur .if &$pitb2 = Y
.th .ur .hl 2 &$b1ct..&$b2ct &1
.sk 1;.sk 1 c
.do end
.sr $b3ct = 0
.dm block2 end
.*
.cm                                 - - - block3      - - -
.dm block3 begin
.ur .if &0 eq 0
.th .er 4 MISSING BLOCK3 HEADING
.el .do
.se $b3ct = &$b3ct + 1
.sk 3;.cp 8
.ur .up &$b1ct..&$b2ct..&$b3ct &1
.ur .if &$pitb3 = Y
.th .ur .hl 3 &$b1ct..&$b2ct..&$b3ct &1
.sk 1;.sk 1 c
.do end
.dm block3 end
.*
.cm                                 - - - head1      - - -
.dm head1 begin
.ur .if &0 eq 0
.th .er 4 MISSING HEAD1 HEADING
.el .do
.sk 5
.cp &$trigger
.ud on . , ( ) ^ 40
.ur .uc &1
.ud off . , ( ) ^ 40
.ur .if &$pith1 = Y
.th .ur .hl 1 &1
.sk 3;.sk 2 c
.do end
.dm head1 end
.*
.cm                                 - - - head2      - - -
.dm head2 begin
.ur .if &0 eq 0
.th .er 4 MISSING HEAD2 HEADING
.el .do
.sk 3;.cp 8
.ud on . , ( ) ^ 40
.ur .uc &1
.ud off . , ( ) ^ 40
.ur .if &$pith2 = Y
.th .ur .hl 2 &1
.sk 1;.sk 1 c
.do end
.dm head2 end
.*
.cm                                 - - - head3      - - -
.dm head3 begin
.ur .if &0 eq 0
.th .er 4 MISSING HEAD3 HEADING
.el .do
.sk 3;.cp 8
.ur .up &1
.ur .if &$pith3 = Y
.th .ur .hl 3 &1
.sk 1;.sk 1 c
.do end
.dm head3 end
.*
.cm                                 - - - pit        - - -
.dm pit begin
.sr $pitb1 = 'N';.sr $pitb2 = 'N';.sr $pitb3 = 'N'
.sr $pith1 = 'N';.sr $pith2 = 'N';.sr $pith3 = 'N'
.ur .pe &0
.se $pit&1=Y;.se 1=&2;.se 2=&3;.se 3=&4;.se 4=&5;.se 5=&6
.dm pit end
.*
.cm                                 - - - spt        - - -
.dm spt begin
.ur .if &0 eq 1 AND &T'&1 eq 'N'
.th .se $trigger = &1
.el .sr $trigger = 55
.dm spt end
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.*       Define MACROs to allow footnoting using superscripts.
.*            (Borrowed from UW EasyScript -jb)
.*       Endnotes can be produced instead, by specifying
.*
.*                 SCRIPT filename (&NOTE= END
.*
.*       and using the .endnotes macro at the point where the
.*       list is to appear.
.*
.*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
.*
.cm                                 - - - footnote    - - -
..dm footnote begin
..sr $fnct = &$fnct + 1
..su &$fnconv
&*1.&$fnout.&*2
..if &NOTE = END
.   ..th ..fb begin
.   ..el ..fn begin
..sk
..su &$enconv
..in;..in &$fnlen;..un &$fnun
..tr 02 4b
&$fnout
..tr 02
..dm
.cm                                 - - - footend     - - -
.dm footend begin
..if &note = 'END'
.   ..th ..fb end
.   ..el ..fn end
.dm footend end
.*
.cm                                 - - - endnotes    - - -
.dm endnotes begin
..if &note ne 'END'
.   ..th ..ef
..br
..fb dump
.dm endnotes end
.*
