All lines of
*infile* up to and including the first blank line
are skipped. (This makes it easy to omit the copyright notice
from the typeset version, for example.)

The portions of
*infile* that are not in comments will be typeset
verbatim, in typewriter font, obeying line breaks and indentation.
Any characters that have special significance to TeX will be quoted.

The portions of
*infile* that are in comments will be treated
differently depending on the position of the comment. There are
three cases:

1. Comments that do not begin in the first column are typeset in a
fixed-width font, including the "(*" and "*)" markers, obeying line
breaks and indentation, just like program text. For example, if
your program includes

PROCEDURE P(VAR (*OUT*) x: INTEGER);

then the "(*OUT*)" will be typeset in typewriter font, just
like rest of the line.

2. Comments that begin in the first column and are not preceded
by a blank line are indented and typeset in slanted roman text,
except that double-quoted expressions are typeset in slanted
typewriter font. The purpose of this is to allow a brief comment
after a procedure declaration, indicating what the procedure does.
For example, here is the specification of "Path.LineTo":

PROCEDURE LineTo(path: T; READONLY p: Point.T);
(* Extend "path" with a linear segment that starts
at its current point and ends at "p". *)

It is recommended that these slanted comments be kept brief;
additional details can be provided in longer type 3 comments.

3. Comments that begin in the first column and are preceded by a
blank line are typeset in a roman font and justified by TeX’s usual
rules to the document’s margins. Items enclosed in double-quotes
are set in unslanted typewriter font; for example, program
identifiers should be double-quoted this way. Line breaks and
indentation have no effect in these comments, since TeX is doing
the line-breaking. For example, here is the specification of
"Path.Close":

PROCEDURE Close(path: T);
(* Add a linear segment to create a closed loop in "path". *)
(* More precisely, let "p" be the current point of "path", and let
"q" be last point of "path" that was added by a call to "MoveTo".
(Thus "q" is the startpoint of the first segment of the last subpath
of "path".) "Close" adds a linear segment from "p" to "q" and marks
the sequence of segments from "q" to the end of the path as a closed
subpath. *)

Sometimes you want a portion of a comment to be treated verbatim, like
program text---for example, when including an example program or a
table. Therefore, m3totex treats any line that starts with "| "
(vertical bar followed by space) like program text, typesetting it
verbatim in typewriter font. For example, here is the specification
of "Path.CurveTo":

PROCEDURE CurveTo(path: T; READONLY q, r, s: Point.T);
(* Extend "path" with a curved segment that starts
at its current point and ends at "s". *)
(* "CurveTo" adds a curve that starts from the current point of "path"
in the direction of "q", and ends at "s" coming from the direction
of "r". More precisely, let "p" be the current point of "path"
and let "h(t)" and "v(t)" be the cubic polynomials such that
| (h(0), v(0)) = p
| (h(1), v(1)) = s
| (h’(0), v’(0)) = 3 * (q - p)
| (h’(1), v’(1)) = 3 * (s - r)

(Where the primes denote differentiation with respect to "t".)
Then "CurveTo" adds the segment "(h(t), v(t))" for "t" between zero
and one. (This is called the {\it Bezier} arc determined by "p",
"q", "r", and "s".) *)

Notice that the type-three comment included the TeX command "\it" to
print "Bezier" in italic type. In general you can use TeX commands
freely in type-three comments, but if you indulge yourself in this
you may baffle programmers who read your interfaces on-line.

Lines in type-three comments that begin with "| " are treated just
like program text with one exception: you can slip in words in roman
font by enclosing them in back-quotes. For example:

PROCEDURE Map(path: T; map: MapObject)
RAISES {Malformed};
(* Apply the appropriate method of "map" to each segment of "path". *)
(* That is, for each segment "s" of "path", in order, "Map" excecutes
the following:
| IF s ‘is a linear segment‘ (p, q) THEN
| IF s ‘was generated by‘ MoveTo THEN
| (* p = q *)
| map.move(p)
| ELSIF s ‘was generated by‘ LineTo THEN
| map.line(p, q)
| ELSE (* s ‘was generated by‘ Close *)
| map.close(p, q)
| END
| ELSE (* s ‘is a curved segment‘ (p, q, r, s) *)
| map.curve(p, q, r, s)
| END
"Map" raises the exception if it is passed a malformed path. *)