Prev Next hilite

Automatic Highlighting and Cross Referencing Certain Tokens

Syntax
See Also
Purpose
hilitecmd
hiliteseq
     seq_j
     before_j
     after_j
     Highlighting
     Cross Referencing
White Space
Example
Root Section

Syntax
$hilitecmd%cmd_1% ... %cmd_m%$$
$hiliteseq%
     
before_1%seq_1%after_1%tag_1%
                 
...
     
before_n%seq_n%after_n%tag_n
%$$


See Also
srccode , srcfile

Purpose
These commands enables you to automatically highlight and cross reference certain tokens in the output text. This is useful for examples that contain special tokens that need emphasis or explanation.

hilitecmd
The values cmd_1 , ... , cmd_m , specify the commands (with out the $ character) for which this automatic highlighting and cross referencing is to be done. Currently, the only valid commands for automatic highlighting and cross referencing are the codep , and verbatim commands.

hiliteseq

seq_j
Is any sequence of characters (leading and trailing white space is ignored). If this sequence appears in the input text and matches the before and after requirements below, it will be highlighted or cross referenced (depending on tag_j ; see below).

before_j
A match for the sequence seq_j requires that one of the characters in before_j must directly precede the sequence (not counting space or tab characters). If before_j is empty, then it suffices to have white space , or the beginning of the text, precede seq_j .

after_j
A pattern match for the sequence seq_j requires that one of the characters in after_j must directly follow the sequence (not counting space or tab characters). If after_j is empty, then it suffices to have a white space , or the end of the text, follow seq_j .

Highlighting
If a pattern match is detected in the input stream (for a command specified by hilitecmd) and tag_j empty, seq_j appears in the hilitecolor in the corresponding output.

Cross Referencing
If a pattern match is detected in the input stream (for a command specified by hilitecmd) and tag_j not empty, seq_j is linked to the section corresponding to tag_j and it appears in the linkcolor in the corresponding output.

White Space
Leading and trailing white space is removed from before_j , seq_j , after_j , and tag_j .

Example
The following input
 
     $hilitecmd%codep%$$
     $hiliteseq%
          %xref% %%
          %cref% %cref
     %$$
     $codep
          The OMhelp xref command has been deprecated,
          you should use the cref command instead.
          This xref, does not have white space after it.
     $$
generates the following output:
 
     The OMhelp xref command has been deprecated,
     you should use the cref command instead.
     This xref, does not have white space after it.

Root Section
The commands and tokens specified at the end of the root section , are used as initial setting for all other sections. There are no initial settings for the root section.
Input File: omh/hilite.omh