[net.sources] NRO macros

lra@aluxe.UUCP (08/26/83)

NRO Macros:

Following this header is a shell script that generates three files:

         "m" ==> macro file for NRO
"macros.doc" ==> Documentation for the macros for use with NRO
			and the supplied macros.
"macros.out" ==> Resulting output [ nro -mm -b macros.doc ]

Headings H1 to H8, variable lists ( VL, LI, LE ), page headers
( PH, OH, EH ) and page footers ( PF, OF, EF ) are amoung
the supplied macros.

These macros are pretty new, so there may be a couple bugs. 
If there are any more macros out there in netland please share
them with the world.

				Lonnie R. Abelbeck
				BTL - Reading Pa.
				..!aluxz!aluxe!lra
=======================================================================

cat > macros.doc << !funky!stuff!
.PH "NRO Macros" "Page #" "NRO Macros"
.PF "" "August 26, 1983" ""
.H1 "Introduction"
.PP
Following is a brief explanation of a basic set of macros
for the NRO text formatter.  The syntax was developed
to be as compatible as possible to the
standard NROFF memorandum macros.
.H1 "Paragraphs"
.VL
.LI "PP   "
Followed by one or more lines of text, denotes the beginning
of a paragraph.  A single space is performed before the first
line of text.
.LE
.H1 "Numbered Headings"
.H2 "Syntax"
.VL
.LI "H1 string    "
The highest level of headings is outdented 5 characters and put
in bold print.  The string will be preceded with a number of the
occurence of that heading. Note that the 'string' must be surrounded
with double quotes if it contains spaces. The register 'a' contains
the number of the current highest level heading.
.LI "H2 string    "
The second highest level of headings is printed in bold and the
following text follows after a break (return).  The string will be
preceded with a number of the latest highest heading and the present
occurence of the second level heading. The register 'b' contains
the heading number.
.LI "H3 string    "
The third highest level of headings is underlined and
the following text follows after a break. The number preceding the
string is a.b.c where a,b and c are the registers.
.LI "H4 string    "
The fourth highest level of headings is underlined and the following
text follows after a break.  The number preceding the string is
a.b.c.d where a to d are registers.
.LI "H5 string    "
The fifth highest level of headings is underlined and the following
text follows after a break.  The number preceding the string is
a.b.c.d.e where a to e are registers.
.LI "H6 string    "
The sixth highest level of headings is underlined and the following
text follows after a break.  The number preceding the string is
a.b.c.d.e.f where a to f are registers.
.LI "H7 string    "
The seventh highest level of headings is underlined and the following
text follows right after the string, no break.  The number preceding the
string is a.b.c.e.f.g where a to g are registers.
.LI "H8 string    "
The eighth highest level of headings is underlined and the following
text follows right after the string, no break.  THe number preceding the
string is a.b.c.e.f.g.h where a to h are registers.
.LE
.H2 "Caveats"
The mark or string following each
.bo
Hn
command must not begin with a command character (dot) and the
spacing to the right of the string (for H7 and H8) must be included in the string
as quoted spaces, unless you are satisfed with the default
spacing, (the normal spacing between characters).
.H1 "Lists"
.H2 "Introduction"
Creating lists requites the user to signal when he/she wants a
list to start,
.bo
VL
for example.  Each list item is started by the,
.bo
LI
command.  LI is followed by a string if desired to serve as a mark.
The list started by VL is ended by the
.bo
LE
command.  Lists may be nested limited only to the width of the paper
since each list is indented 6 spaces.
.H2 "Syntax"
.VL
.LI "VL    "
Marks the beginning of a variable list, a list where each LI provides
its own mark.  The margin is indented 6 spaces.
.LI "AL    "
Stands for automatic list, but actually does exactly the same as
the VL command.  Added for compatibility reasons.
.LI "LI string    "
Creates a list item with a mark as shown by string.  This line
is temporally outdented 4 characters, the following lines
conform to the margin set by the previous VL command.
.LI "LE [number]    "
The previous list is ended by the LE command.  The margin is
reset to the value previous to the VL command.  The optional
number is the number os spaces included after the list, (default=1).
.LE
.H2 "Caveats"
As with the headers, the string following the LI command must
not begin with a command character, and the spacing following
the string must be include in quotes.
.H1 "Headers"
.H2 "Introduction"
There exist three types of header commands.  One is a common
page header, PH; another is an odd page header occurring on
odd numbered pages, OH; and the other is an even page header
occurring on even numbered pages, EH.
.H2 "Syntax"
.VL
.LI "PH string1 string2 string3   "
This header will appear on every page, string1 will appear on the
left, string2 is centered, and string3 is on the right.  Note
that any or all of these strings may be null, (i.e. "").
.LI "OH string1 string2 string3   "
The same as the PH command, except the header will occur only
on odd numbered pages, very handy when producing double sided
copies and you want the page numbers on the outside on each
page.
.LI "EH string1 string2 string3   "
The same as above, except the header will occur only
on even numbered pages.
.LE
.H1 "Footers"
.H2 "Introduction"
There exist three types of footer commands.  One is a common
page footer, PF; another is an odd page footer occurring on
odd numbered pages, OF; and the other is an even page footer
occurring on even numbered pages, EF.
.H2 "Syntax"
.VL
.LI "PF string1 string2 string3   "
This footer will appear on every page, string1 will appear on the
left, string2 is centered, and string3 is on the right.  Note that
any or all of these strings may be null, (i.e. "").
.LI "OF string1 string2 string3   "
The same as the PF command, except the footer will occur only
on the odd numbered pages.
.LI "EF string1 string2 string3   "
The same as above, except the footer will occur only on even numbered
pages.
.LE
!funky!stuff!
cat > macros.out << !funky!stuff!



     NRO Macros                      Page 1                      NRO Macros



     11. IInnttrroodduuccttiioonn 



          Following  is  a  brief explanation of a basic set of macros
          for the NRO text formatter.  The syntax was developed to  be
          as  compatible  as possible to the standard NROFF memorandum
          macros.  



     22. PPaarraaggrraapphhss 




            PPPP  Followed by one or more lines  of  text,  denotes  the
                beginning of a paragraph.  A single space is performed 
                before the first line of text.  



     33. NNuummbbeerreedd HHeeaaddiinnggss 



          33.11 SSyynnttaaxx 



            HH11  ssttrriinngg    The highest level of headings is outdented 5
                characters and put in bold print.  The string will  be
                preceded  with  a  number  of  the  occurence  of that
                heading.  Note that the 'string'  must  be  surrounded
                with double   quotes  if  it  contains  spaces.    The
                register  'a'  contains  the  number  of  the  current
                highest level heading.  


            HH22 ssttrriinngg  The second highest level of headings is printed 
                in  bold  and the following text follows after a break
                (return). The string will be preceded with a number of 
                the latest highest heading and the  present  occurence
                of the   second  level  heading.    The  register  'b'
                contains the heading number.  


            HH33  ssttrriinngg    The  third  highest  level  of  headings  is
                underlined  and  the  following  text  follows after a
                break.  The number preceding the string is a.b.c where 
                a,b and c are the registers.  


            HH44 ssttrriinngg    The  fourth  highest  level  of  headings  is
                underlined  and  the  following  text  follows after a
                break.  The number preceding  the  string  is  a.b.c.d
                where a to d are registers.  


            HH55  ssttrriinngg    The  fifth  highest  level  of  headings  is
                underlined and the  following  text  follows  after  a
                break.   The  number preceding the string is a.b.c.d.e
                where a to e are registers.  


            HH66  ssttrriinngg    The  sixth  highest  level  of  headings  is
                underlined  and  the  following  text  follows after a
                break.  The number preceding the string is a.b.c.d.e.f 
                where a to f are registers.  



                                August 26, 1983



     NRO Macros                      Page 2                      NRO Macros



            HH77 ssttrriinngg   The  seventh  highest  level  of  headings  is
                underlined  and the following text follows right after
                the string, no break.  The number preceding the string 
                is a.b.c.e.f.g where a to g are registers.  


            HH88 ssttrriinngg    The  eighth  highest  level  of  headings  is
                underlined  and the following text follows right after
                the string, no break.  THe number preceding the string 
                is a.b.c.e.f.g.h where a to h are registers.  


          33.22 CCaavveeaattss 
          The mark or string following each HHnn command must not  begin
          with  a command character (dot) and the spacing to the right
          of the string (for H7 and H8) must be included in the string 
          as quoted spaces, unless you are satisfed with  the  default
          spacing, (the normal spacing between characters).  



     44. LLiissttss 



          44.11 IInnttrroodduuccttiioonn 
          Creating lists requites the user to signal when he/she wants 
          a list  to start, VVLL for example.  Each list item is started
          by the, LLII command.  LI is followed by a string  if  desired
          to serve  as a mark.  The list started by VL is ended by the
          LLEE command.  Lists may be nested limited only to  the  width
          of the paper since each list is indented 6 spaces.  


          44.22 SSyynnttaaxx 



            VVLL    Marks the beginning of a variable list, a list where
                each LI provides its own mark.  The margin is indented 
                6 spaces.  


            AALL  Stands for automatic list, but actually  does  exactly
                the same  as  the VL command.  Added for compatibility
                reasons.  


            LLII ssttrriinngg  Creates a list item with a  mark  as  shown  by
                string.    This   line   is   temporally  outdented  4
                characters, the following lines conform to the  margin
                set by the previous VL command.  


            LLEE  [nnuummbbeerr]    The  previous  list  is  ended  by  the LE
                command.  The margin is reset to the value previous to 
                the VL command.  The optional number is the number  os
                spaces included after the list, (default=1).  


          44.33 CCaavveeaattss 
          As  with  the  headers,  the string following the LI command
          must not begin with a command  character,  and  the  spacing
          following the string must be include in quotes.  



     55. HHeeaaddeerrss 




                                August 26, 1983



     NRO Macros                      Page 3                      NRO Macros



          55.11 IInnttrroodduuccttiioonn 
          There exist three types of header commands.  One is a common 
          page  header, PH; another is an odd page header occurring on
          odd numbered pages, OH; and the other is an even page header 
          occurring on even numbered pages, EH.  


          55.22 SSyynnttaaxx 



            PPHH ssttrriinngg11 ssttrriinngg22 ssttrriinngg33  This  header  will  appear  on
                every  page,  string1 will appear on the left, string2
                is centered, and string3 is on the right.   Note  that
                any or all of these strings may be null, (i.e. "").  


            OOHH  ssttrriinngg11  ssttrriinngg22  ssttrriinngg33  The same as the PH command,
                except the header will  occur  only  on  odd  numbered
                pages,  very  handy when producing double sided copies
                and you want the page numbers on the outside  on  each
                page.  


            EEHH  ssttrriinngg11 ssttrriinngg22 ssttrriinngg33  The same as above, except the
                header will occur only on even numbered pages.  



     66. FFooootteerrss 



          66.11 IInnttrroodduuccttiioonn 
          There exist three types of footer commands.  One is a common 
          page footer, PF; another is an odd page footer occurring  on
          odd numbered pages, OF; and the other is an even page footer 
          occurring on even numbered pages, EF.  


          66.22 SSyynnttaaxx 



            PPFF  ssttrriinngg11  ssttrriinngg22  ssttrriinngg33   This footer will appear on
                every page, string1 will appear on the  left,  string2
                is centered,  and  string3 is on the right.  Note that
                any or all of these strings may be null, (i.e. "").  


            OOFF ssttrriinngg11 ssttrriinngg22 ssttrriinngg33  The same as  the  PF  command,
                except  the footer will occur only on the odd numbered
                pages.  


            EEFF ssttrriinngg11 ssttrriinngg22 ssttrriinngg33  The same as above, except  the
                footer will occur only on even numbered pages.  
          













                                August 26, 1983

!funky!stuff!
cat > m << !funky!stuff!
.de PP
.br
.sp 1
.en
.de H1
.nr a +1
.nr b 0
.nr c 0
.nr d 0
.nr e 0
.nr f 0
.nr g 0
.nr h 0
.sp 2
.ti -5
.bo
@na. $0
.br
.sp 1
.en
.de H2
.nr b +1
.nr c 0
.nr d 0
.nr e 0
.nr f 0
.nr g 0
.nr h 0
.sp 1
.bo
@na.@nb $0
.br
.en
.de H3
.nr c +1
.nr d 0
.nr e 0
.nr f 0
.nr g 0
.nr h 0
.sp 1
.ul
@na.@nb.@nc $0
.br
.en
.de H4
.nr d +1
.nr e 0
.nr f 0
.nr g 0
.nr h 0
.sp 1
.ul
@na.@nb.@nc.@nd $0
.br
.en
.de AL
.sp
.in +6
.en
.de VL
.sp
.in +6
.en
.de LE
.sp $0
.in -6
.en
.de LI
.br
.sp
.ti -4
.bo
$0
.en
.de H5
.nr e +1
.nr f 0
.nr g 0
.nr h 0
.sp 1
.ul
@na.@nb.@nc.@nd.@ne $0
.br
.en
.de H6
.nr f +1
.nr g 0
.nr h 0
.sp 1
.ul
@na.@nb.@nc.@nd.@ne.@nf $0
.br
.en
.de H7
.nr g +1
.nr h 0
.sp 1
.ul
@na.@nb.@nc.@nd.@ne.@nf.@ng $0
.en
.de H8
.nr h +1
.sp 1
.ul
@na.@nb.@nc.@nd.@ne.@nf.@ng.@nh $0
.en
.de PH
.bp 1
.in 5
.rm 75
.he |$0|$1|$2|
.fo ||-#-||
.in 10
.rm 70
.en
.de EH
.bp 1
.in 5
.rm 75
.eh |$0|$1|$2|
.fo ||-#-||
.in 10
.rm 70
.en
.de OH
.bp 1
.in 5
.rm 75
.oh |$0|$1|$2|
.fo ||-#-||
.in 10
.rm 70
.en
.de PF
.in 5
.rm 75
.fo |$0|$1|$2|
.in 10
.rm 70
.en
.de OF
.in 5
.rm 75
.of |$0|$1|$2|
.in 10
.rm 70
.en
.de EF
.in 5
.rm 75
.ef |$0|$1|$2|
.in 10
.rm 70
.en
.de SH
.sp 1
.ti -5
.bo
$0
.br
.en
!funky!stuff!