.left margin
.ifnot hlp
.hl 1 DEFINE, DELETE, and RESET
.p;The DEFINE, DELETE, and RESET commands are not available in DSR.
These commands may be used to define features such as bolding
which is available in DSR.
.else hlp
.i-1;3 DEFINE
.p;These commands are not available in DSR.
.endif hlp
.if hlp
.if rsx.i5;ADDITIONAL HELP AVAILABLE:
.nj.ts+10,+10,+10,+10,+10
COMMAND	ESCAPE	ITEM	NUMBER	SUBSCRIPT	
SUPERSCRIPT	SUBSTITUTE	VARIABLE__SPACE
.j
.endif rsx
.i-1;4 COMMAND
.endif hlp
.lm +5
.q _.DEFINE COMMAND /label/command string
.p.x DEFINE>COMMAND
defines commands.  The label consists of up to 20 letters. 
.ifnot small
Imbedded spaces
inside the label are treated as optional syntax elements.  The actual command
may have single, multiple or no spaces. The command string must be a legal set
of commands to be substituted for the label. If a command is defined the same
as a normal command, the normal command will be used and the defined one
ignored. _.ENDIF will be ignored if used in a defined command. 
This must be the last command on the line.  All text following this command
is treated as the command definition.
Essentially the command string is substituted for the defined command. 
Defined commands may be
nested to 3 levels the same as substitutions. To prevent conflict with future
commands all user commands may begin with the letter Q. This command is
invaluable for defining commands which exist in other versions of RUNOFF, but
are not available here. 
.if hlp
.if rsx.i5;FURTHER HELP: PARAMETERS EXAMPLE
.endif rsx
.i-6;5 PARAMETERS
.rm -2
.endif hlp
.bb
.p
Parameters to be substituted into the command may be marked by _%.
Text parameters following titles, subtitles and so on may not be substituted.
The parameters must be included in the previous command.  In other words
parameters may be nested.
.if hlp
.i-6;5 EXAMPLE
.endif hlp
.s.c;EXAMPLE
_.HEADER#A may be defined to skip a line, indent both margins by 5 spaces, and
output a centered line of text. 
.i5;_.DEFINE COMMAND /HEADER#A/.s.lm+5.rm-5.c;
.br;Acceptable variants of the command are _.HEADERA, _.HEADER#A, and
_.HEADER##A 
.p;The first command after the label (s) need not be preceeded by a
decimal point as it is already implied. 
For example the previous command may be defined as:
.s.i5;_.DEFINE COMMAND /HEADER#A/s.lm+5.rm-5.c;
.s.br;An example of parameter substitution is:
.i5;_.DEFINE COMMAND /Q/.s %.i %
.i5;_.Q 5,8
.br;The command will skip 5 lines then indent 8.
.eb
.rm
.endif small
.if hlp.i-6;4 ESCAPE
.endif hlp
.q_.DEFINE ESCAPE "escape label" [,modifiers] definition
.ifnot hlp
.p.x DEFINE>ESCAPE
defines escape sequences for control of a variety of printers. Each escape
sequence is indicated in the text by either _\ or _^  or a symbol of your
choice followed by another symbol.  For example _^_* can enable bolding by
issuing a sequence to turn on bolding and _\_* may disable bolding by issuing a
turn off sequence.  The escape sequence is entered as follows. First you
select which 2 character label. The first character must be either _^,_\, or
your flag character, while the second one may be any other character. They are
entered as a literal.  
.ifnot small
For example the label _^_* may be entered as "_^_*" or
'_^_*' or "_^","_*". Your flag character is defined by the _.FLAGS ESCAPE
command. 
.bb
.p
If you change the uppercase flag from _^ or the lowercase flag from _/
then the new uppercase and lowercase flags may be the first character of an
escape sequence.  You must pick your upper/lowercase flags via a _.FLAGS 
command before defining the escape sequences.
.eb
.p
Next the modifiers are entered.  These define how the escape sequence is
handled.
.endif small
.endif hlp
.s.c; Modifiers
.lm+5
.i-5; LCK - escape sequence is a lock/unlock pair.
.ifnot hlp
.ifnot small
For example if _^_* and _\_* are defined as a lock/unlock pair, then the
first appearance of _^_* will "lock" this feature on and a subsequent
appearance of _^_* will be ignored if _\_* is not used in between them.
Effectively the lock is _^_* and unlock is _\_*.
In addition this allows RNO to control these sequences to prevent them from
acting on the headers.  They will only change the text, much in the same way
the underline flag works.
Only 16 escape sequences may be declared LCK.
If a line contains only the "lock" sequence then the unlock sequence will
be automatically output at the end off the line.  The next line will then
be automatically preceeded by the lock sequence.
This continues till the input text contains the "unlock" sequence flag.
If you define a sequence which changes the character style it should
always be defined as a lock/unlock pair.  An example of changed character
style is hardware underlining, shadow printing, bolding, font changes,
or ribbon color changes.
.endif small
.endif hlp
.i-5; VSP,spacing - escape sequence changes vertical position by spacing.
.ifnot hlp
.ifnot small
This allows you to define a sequence which changes the vertical position.
The spacing parameter is specified in half lines with 1 being
1/2 line advance, -1 is 1/2 line backwards.
.endif small
.endif hlp
.i-5; HSP,spacing - sequence modifies the horizontal position by spacing.
.ifnot hlp
.ifnot small
You may define a sequence which modifies the horizontal position.
Sequences which modify the position are considered printable characters
,while sequences without HSP are considered attribute changes.  If
a space follows an escape sequence it will be deleted from the output
(while in fill mode) if HSP is not defined.
.endif small
.endif hlp
.i-5; PSP - The horizontal spacing specified by HSP is applied to all
printable characters following the escape sequence.
.ifnot hlp
.ifnot small
This attribute modifies the HSP attribute.  You can define a sequence
which changes the character width, and let RNO know what the new width is.
The width may only be 0,1,2,... or multiples of the normal width.
If the HSP is specified as a number other than 1, certains aspects of fill
are disabled.  Spaces will not be expanded if necessary to justify.  Only
"normal" spaces with HSP=1 are expanded.  This allows imbedding extra wide
text inside normal text, or centering extra wide text.  A whole line of extra
wide text can not be justified, but a mixed line of normal and wide can
be justified.
This restriction may be removed in future releases of RNO.
.p
If an escape sequence changes the permanent spacing to a value other than 1
then it should also have the attribute LCK.  Failure to do this will
mess up a varitey of things including underlining and margins.
.endif small
.endif hlp
.i-5; CHR - The lock/unlock pair is used to change only 1 printable character.
.ifnot small
.ifnot hlp
This attribute is used only if the lock/unlock pair is designed to function
similarly to the underline flag.  You must also declare the escape character
in a _.FLAGS SPECIAL command.
.endif hlp
.endif small
.lm-5
.ifnot small
.ifnot hlp
.p
Then following this the escape sequence is entered.  Printable characters
may be entered as literals ('This is a literl'), while non printable
must be entered as a decimal value.
The numbers and literals may be separated by blanks,tabs, and or commas.
Two commas in a row constitute a null and are illegal.
If you define an escape sequence twice in your text only the first
definition will be obeyed unless you reset escape before the second one.
The second definition will cause an error message.
.p
If you use a large number of different escape sequences frequently,
you should define the most commonly used ones first.  This will
increase the speed with which RUNOFF can find them.
.p; Escape sequences can be very trickey. To use them intelligently
the following rules will be helpful.
.list 0
.le Always use LCK and define a lock/unlock pair for a sequence
that changes the text attributes.  Such sequences are ones which
.list 0
.le Change font
.le Change all character spacing
.le Underline characters
.le Change ribbon color
.le Bold or shadow print characters
.els
.le Always define HSP for sequences which output printable characters
.le Always define HSP and PSP for sequences which permanently change the
horizontal spacing. 
.le Always define VSP for sequences which change the vertical postion.
.ifnot RT
.le Use /UL:L instead of /UL:B for the underlining option especially if
sub or superscripted expressions are to be underlined.  /UL:L is also necessary
if alternate fonts substitute other characters for the underscore.
.endif RT
.if RT
.le Use /U:L instead of /U:B for the underlining option especially if
sub or superscripted expressions are to be underlined.  /U:L is also necessary
if alternate fonts substitute other characters for the underscore.
.endif RT
.le If a font switch results in a pitch change which is not an even multiple
of the normal font, you must handle this change manually.  If such a change
is defines as a lock/unlock pair, RNO will be able to print headers in the old
pitch while using the new one for text.  New margins should be set for the new
pitch, while the old permanent margins are maintained to control the headers.
.ifnot rt
Underlining will not work properly in the new pitch unless /UL:B is used.
.endif rt
.if rt
Underlining will not work properly in the new pitch unless /U:B is used.
.endif rt
.le If a single font is used throughout then no attributes need be defined
for the font change.
.bb
.le Never use letters after _^ or ^/ when defining escape sequence labels.
Combinations like _^A will defeat the uppercase flag for the letter "A", and
_/A defeats the lowercase flag for "A". You may not intend using either the
uppercase flag or lowercase flag, but you will probably need them. 
.le Escape sequences may be used inside substitutions, but you should
be careful to use the proper options.
.le;Escape sequences can interact badly with the equation formatting if you
are not careful.  Each partial line advance is noted, and the equation 
formatting will shift the equations to allow for subscripts and superscripts.
If you move characters up or down by smaller than 1/2 lines then you should
probably not specify the actual vertical movement (VSP).
.le;Some sequences may conflict with DEC device handler conventions.    In
particular XON(17) or XOFF(19) will be intercepted by the device handler for
RSX or VMS.  These codes should be avoided in escape sequence definitions. If
these control codes must be used then the terminal should be in passall mode
or the output must be directly to the device with the /TT option. Other
control codes such as TAB(9) may be passed directly to the device by setting
the characteristics of the device. 
.eb
.els 0
.note
^&Failure to use these suggestions can cause unpredictable results.\&
.end note
.c;EXAMPLES
.list 1
.le The following example shows
the definition of an escape sequence to turn on bolding, and turn off bolding:
.s.tt6.c;DIABLO compatible printer.
.s.i5;_.DEFINE ESCAPE '_^_*',CHR,LCK,27,'W'
.I5; _.DEFINE ESCAPE '_\_*',CHR,LCK,27,'_&'
.i5; _.FLAGS SPECIAL _*
.s.tt 6.c;Bolding for an LA-50:
.s.i5;_.DEFINE ESCAPE '_^_*',CHR,LCK,27,'[1m'
.I +5; _.DEFINE ESCAPE '_\_*',CHR,LCK,27,'[22m'
.i5; _.FLAGS SPECIAL _*
.p
The net effect of these definitions is to have _^_* turn on bolding, _\_* turn
off bolding and _* will bold a single character following it. Bolding will
never occurr for titles, page numbers and subtitles. 
.le The following shows how to define escape sequences to produce special
symbols on a DIABLO compatible printer.  The extra font is enabled by SO(14)
and disabled by SI(15). 
.s.i5; _.FLAGS ESCAPE `
.i5; _.DEFINE ESCAPE "`A",HSP,1,14,"A",15
.i5; _.DEFINE ESCAPE "`a",HSP,1,14,"q",15
.i5; _.DEFINE ESCAPE "`_^",HSP,1,14,1,15
.br;The 3 symbols are invoked by `A, `B, and `_^.
.p;The following defines a "pi" for an LA-50 or VT-100:
.i5;_.DEFINE ESCAPE '`p',HSP,1,27,"(0{",27,"(B"
.le;The following example shows double width characters for an LA-50.
It is assumed that the normal pitch is 10 characters/inch.
.i5;_.DEFINE ESCAPE "_^=",HSP,2,PSP,LCK,27,"[5w"
.i5;_.DEFINE ESCAPE "_\=",HSP,1,PSP,LCK,27,"[1w"
.br;_^_= turns on elongated characters. (5 pitch)
.br;_/_= turns off elongated chars. (10 pitch)
.els 0
.NOTE
Some example of escape sequence definitions and substitutions are provided
in the files: VT100.RNO, LA50.RNO and CIT161.RNO.
.en
.endif hlp
.endif small
.if hlp.i-6;4 ITEM
.endif hlp
.bb
.q_.DEFINE ITEM /name/ [format],[n]
.p.x DEFINE>ITEM
This command defines a numbered item which may be included in your text.
The name is a substitution label for the item.  The format is the format
to display the item, see _.DISPLAY PAGE.  The inital value for the item may
be specified as n in the range 0 to 3999 or as a series of letters A to EWU.
.ifnot small
If letters are used for n then the format may not be omitted. The item is
included in the SUBSTITUTE table. The value may be incremented or changed by
_.NUMBER ITEM. For example the following commands will define, increment and
display a number. 
.i5;_.DEFINE ITEM /FIG_$/
.i5;_.NUMBER ITEM /FIG_$/ +1
.i5;_._$FIG_$
.endif small
.s.i5;DEFAULT: _.DEFINE ITEM /item/ D 1
.if hlp.i-6;4 NUMBER
.endif hlp
.q_.DEFINE NUMBER parameter /label/
.p.x DEFINE>NUMBER
defines a numeric substitution.  The parameter determines what number is used
in the substitution.  Normally the number must be defined before you use the
label. You may reference the label before the _.DEFINE#NUMBER
statement if you use the 
.x Two pass mode
.if RT
/2
.else RT
/2P
.endif RT
option.
Parameters are:
.nf .ts +10,+20,+10
	Param.	Number substituted
	APPENDIX	Current Appendix or chapter
	CHAPTER	Current Chapter or appendix
	LIST	Current List element
	LEVEL	Current Header level
	PAGE	Current Page-subpage number
	ITEM /name/	Item named
.f
.ifnot small
.if hlp
.if rsx;FURTHER HELP: restrictions examples
.endif rsx
.i-6;5 restrictions
.rm-2
.endif hlp
.f.s
The LEVEL may not be defined inside a footnote or text section. You should be
careful mixing these commands with _.TEXT DEFERRED. The text deferred command
can cause the output text to appear on another page, or in another section of
your text.  If you use _.DEFINE NUMBER PAGE, it will only work properly
in 2 pass mode.  In particular definitions inside text deferred will
only give the correct page number after the text has been output.
The actual page number may be off by 1 page even in 2 pass mode, 
if the definition appears after the symbol is used.
To always work correctly an infinite pass mode would be necessary.
As a practical matter, you can help RNO by defining the label to be
approximately the same length as the anticipated number.
.if hlp;.i-6;5 examples
.endif hlp
.s.c;EXAMPLE
You wish to refer to a section in your document by the label SECA_$
so in that section you have the command:
.i5;_.DEFINE NUMBER LEVEL 'SECA_$'
.br;And later in your document you refer to the section:
.i5;See section _$SECA_$ .#.#.#
.p
The following command will print
the current chapter number:
.i5;_.DEFINE NUMBER CHAPTER /CHAPA_$/ ; _$CHAPA_$
.endif small
.eb
.if hlp.i-6;4 SUBSTITUTE
.rm
.endif hlp
.q_.DEFINE SUBSTITUTE /label/ text
.p.x DEFINE>SUBSTITUTE
defines a substitution to be made in the text. The label is preceeded and
followed by a delimiter of your choice.  The label must be no more than 20
characters long and may not contain spaces or tabs. 
.ifnot small
The command and the first delimiter must be separated by one or more spaces or
tabs,  but no spaces are necessary after the second delimiter unless you wish
to include them in the text. When the substitute flag is encountered in your
text followed by a defined label, the specified text will be substituted for
the flag+label.  The text may contain another substitution. Up to 3 levels of
substitution may be nested. The rules for multiple definitions of escape
sequences also apply to substitutions. This must be the last command on the
line.  All text following this command is treated as the substitution
definition. 
.IF HLP
.if RSX.i5;ADDITIONAL HELP AVAILABLE:
.ts+10,+10,+10,+10,+10
.nf;example	DELIMETERS	LABELS	DSR__CONVENTIONS	WARNING
.f
.endif RSX
.rm-2.i-6;5 EXAMPLE
.endif hlp
.s.tt5; EXAMPLE:
You wish to abbreviate the phrase:
.i 5; The party of the first part
.s;So you define and enable substitution:
.i5; _.DEFINE SUBSTITUTE /P1_$/The party of the first part
.i5; _.FLAGS SUBSTITUTE
.s;Then every time you type into the text _$P1_$ you get instead
the substitute phrase:
.i5;The party of the first part
.if hlp.i-6;5 DELIMITERS
.endif hlp
.br;The example of define substitute could have used different delimiters
if you needed to used the delimiters in the text. For example it could
be done as follows:
.i5; _.DEFINE SUBSTITUTE :P1_$:The party of the first part
.I15; _... or
.i5; _.DEFINE SUBSTITUTE "P1_$"The party of the first part
.p
.if hlp.i-6;5 LABELS
.br
.endif hlp
The substitution label or name may consist of any printable character.
Upper case or lowercase letters may be used, however the case of the
letter will be ignored except for the first character.  In other words
the following commands are equivalent.
.i5; _.DEFINE SUBSTITUTE /ABC/
.i5; _.DEFINE SUBSTITUTE /Abc/
.i5; _.DEFINE SUBSTITUTE /AbC/
.br;But the following are not equivalent.
.i5; _.DEFINE SUBSTITUTE /aBC/
.i5; _.DEFINE SUBSTITUTE /ABC/
.if hlp.i-6;5 DSR__CONVENTIONS
.endif hlp
.p
A special convention is used to define DSR compatible substitutions.
If the first character of the substitution name is a dollar sign,
the dollar sign stands for
the substitute flag.  If the substitute flag is changed to a character other
than the dollar sign then the defined substitution is considered to begin with
the new substitute flag.  When the substitution is searched for,
the case of the input characters is ignored.
An example of such a substitution is the _$_$DATE permanently
defined substitution.
.s.lm+10.no fill.i-5; For example the following input:
 _.FLAGS SUBSTITUTE @
 _.DEFINE SUBSTITUTE /_$TEST/This is a test
@@test !!
.i-5; Will produce the following line:
 This is a test !!
.lm-10.fill
.ifnot hlp
.p
The substitution is a really invaluable aid for defining
complicated mathematical symbols.  All you need to enter in the text
is the simple abbreviation and the complicated symbol will be
substituted.  The substitution may contain all kinds of escape sequences
overstrike symbols and so on to construct the special symbol needed.
.endif hlp
.if HLP .i-6;5 Warning
.endif HLP
.note WARNING
You should always define substitutions with labels that do not contain other
substitute labels.  For example the labels ABC and A while unique will cause
you no ends of problems. The first label ABC contains the second label.  As a
result the construction _$ABC could be ambiguous. Did you intend the
substitution _$A followed by the letters BC or the substitutions _$ABC? The
easy way around this problem is to always terminate each substitution with a
terminal character.  It is suggested that the substitute flag character be
used.  You would then define A_$ and ABC_$ as the labels.  The typist would
then type _$ABC_$ for one substitution and _$A_$BC for the other followed by
BC.
.en
.endif small
.if hlp.i-6;4 SUBSCRIPT
.rm
.endif hlp
.q_.DEFINE SUBSCRIPT [parameters]
.p.x DEFINE>SUBSCRIPT
This command allows the user to define subscript escape sequences.  This is an
escape sequence that moves the text down 1/2 space on the page.  It must be a
maximum of 10 numbers or characters. The command is followed by either numbers
or literals.  
.ifnot small
The default is: 
.i5;_.DEFINE SUBSCRIPT 27,"U"
.br;This must be properly defined for equations of half spacing to work.
For an LA-50 it would be:
.i5;_.DEFINE SUBSCRIPT 27,"K"
.if hlp.i-6;4 SUPERSCRIPT
.endif hlp
.q_.DEFINE SUPERSCRIPT [parameters]
.p.x DEFINE>SUPERSCRIPT
This command allows the user to define superscript escape sequences.  This is
an escape sequence that moves the text down 1/2 space on the page.  It must be
a maximum of 10 numbers or characters. The parameters are either numbers or
literals. The default is: 
.i5;_.DEFINE SUPERSCRIPT 27,"D"
.br;This must be properly defined for equations of half spacing to work.
For an LA-50 it would be:
.i5;_.DEFINE SUPERSCRIPT 27,"L"
.endif small
.if hlp.i-6;4 VARIABLE__SPACE
.endif hlp
.q_.DEFINE VARIABLE SPACE n,[parameters]
.p.x DEFINE>VARIABLE SPACE
This command defines a micro space for implementing variable spacing between
words.  The n is the number of microspaces/space.  The parameters define
an escape sequence which produces a microspace.
The escape sequence may have up to 19 numbers or characters.
.ifnot small
The default is:
.i5;_.DEFINE VARIABLE SPACE 6,27,31,3," ",27,31,13
.br;This defines 6 microspaces/space for a DIABLO style printer at 10 pitch.
.i5;_.DEFINE VARIABLE SPACE 5,27,31,3," ",27,31,11
.br;Defines 12 pitch Diablo.  This is available as an option in RNPRE when
you build RNO.
To do the same for an LA-50 in 10 pitch with 180 dots/inch graphics:
.i5;_.DEFINE VARIABLE SPACE 6,27,"Pq",62,62,62,27,"\"
.endif small
.if hlp
.i-6;3 DELETE
.p;These commands are not available in DSR.
.if rsx.i5;ADDITIONAL  HELP AVAILABLE:
.nj.ts+10,+10,+10,+10,+10
COMMAND	SUBSTITUTE
.j
.endif rsx
.i-6;4 COMMAND
.endif hlp
.q_.DELETE COMMAND /label/
.p.x DELETE>COMMAND
This command deletes an already defined command.  Only commands defined
by _.DEFINE COMMAND may be removed.
.ifnot small
Both this command and _.DELETE SUBSTITUTE do not reclaim the space in
the substitution tables, so that extensive useage may cause the tables to
overflow.
.i5;This command is illegal in 2 pass mode.
.endif small
.if hlp.i-6;4 SUBSTITUTE
.endif hlp
.q_.DELETE SUBSTITUTE /label/
.p.x DELETE>SUBSTITUTE
This command deletes an already defined substitution.  Only commands defined
by _.DEFINE SUBSTITUTE may be removed.
.i5;This command is illegal in 2 pass mode.
.if hlp
.i-6;3 RESET
.p;These commands are not available in DSR.
.if rsx.i5;ADDITIONAL  HELP AVAILABLE:
.nj.ts+10,+10,+10,+10,+10
ESCAPE	SUBSTITUTE
.j
.endif rsx
.i-6;4 ESCAPE
.endif hlp
.q_.RESET ESCAPE
.p.x RESET>ESCAPE
resets all escape sequences.  This clears the table of escape sequences so you
may enter new ones by using _.DEFINE ESCAPE. After giving this command all
escape sequences are no longer defined. 
If you need to reset escape sequences, this should be done only once at
the beginning.
.if hlp.i-6;4 SUBSTITUTE
.endif hlp
.q_.RESET SUBSTITUTE
.p.x RESET>SUBSTITUTE
resets the table of substitutions so that all the previously defined
substitutions and commands are no longer available. The permanently defined
substitutions (_$_$DATE...) and defined commands are also no longer defined.
To remove a single entry use _.DELETE SUBSTITUTE or _.DELETE COMMAND. 
This command can be dangerous so use with caution.  It should
done only once at the beginning.
.i5;This command is illegal in 2 pass mode.
.lm
