Prev Next codep

Preformatted Code Text

Syntax
$codep text$$

See Also
srccode , codei , pre , math , verbatim

Description
All of the text in text is printed in with a pre-formatted font . There can be no $ characters in text . The codep command uses the exact same font as the code command to signify that the text is compute input or output. (The pre command uses a font that is close to the normal font, but uniformly spaced.)

Example
The input
 
     $codep
     begin
          x = y
     end
     $$
would create the following output
 
     begin
          x = y
     end

Source Code Examples
All the characters, except the end of line character, in the first and last line of the codep command are ignored. (There must be at least two newlines in text .) This enables the inclusion of source code that is actually compiled. For example, the input
 
     $codep */
     {
          x = 1
     }
     /* $$
would create the following output
 
     {
          x = 1
     }
This enables the codep command and its corresponding terminating $$ to be commented out so that it is not included in the compilation.

Highlighting Example
The following input
 
     $hilitecmd codep$$
     $hiliteseq%
          %codep% %%
          %hiliteseq% %hilite%
          %hilitecmd% %hilite
     %$$
     $codep
          The hiliteseq and hilitecmd commands can be used
          to highlight and cross reference text that is inside of a
          codep command.
     $$
would create the following output
 
     The hiliteseq and hilitecmd commands can be used
     to highlight and cross reference text that is inside of a
     codep command.

Input File: codep.omh