NAME
htmlroff – HTML formatting and typesetting |
DESCRIPTION
Htmlroff(1) accepts troff input with a few extensions and changes.
This manual describes the changes to the input language, assuming
a working knowledge of troff itself. Name lengths
Request, macro, string, and number names can be longer than two
letters, as in:
HTML output
Two new requests:
<
The .ihtml request is similar to .html but is intended for inline
HTML constructs such as <b> or <i> (those that can be contained within
<p>). Unlike .html, .ihtml treats the open HTML tags as a set rather
than a stack: each must be explicitly closed. Although it treats
the tags as a set, .ihtml treats nesting
properly in the output, closing and reopening tags as necessary.
For example, the input:
<
Font changes
Htmlroff interprets the usual \f, .ft, \s, and .ps requests to
change the font and point size. After applying each such change
to its internal registers, htmlroff invokes the .font macro to
emit corresponding HTML. The default definition of .font is:
Paragraphs Subscripts and superscripts
Htmlroff interprets the \u, \d, and \v requests to move vertically
during output. It emits output vertically offset up the page inside
<sup> tags and output vertically offset down the page inside <sub>
tags. This heuristic handles simple equations formatted by eqn(1). Conditional input To make it easier to write input files that can be formatted by both troff and htmlroff, htmlroff adds a new condition h which evaluates true in .if and .ie requests. The t condition continues to evaluate true, to accomodate input files trying to distinguish between troff and nroff. To write a conditional matching troff alone, use `.if !h .if t'.
Htmlroff 's handling of conditional input does not match troff's
exactly. For example,
Diversions
Diversions in htmlroff use the alignment in effect at the time
of the diversion when output. In particular,
Traps Input pipes
Htmlroff adds a new request .inputpipe stop cmd that redirects
htmlroff's input into a pipe to cmd. The redirection stops on
encountering the line stop, optionally followed by white space
and extra text. This is a dangerous and clumsy request, as htmlroff
stops interpreting its input during the redirection, so stop
must be found in the input itself, not in a macro that the input
might appear to call. Although clumsy, .inputpipe allows input
files to invoke troff to handle complicated input. For example,
tmac.html redefines the PS macro that marks the beginning of a
pic(1) picture:
Unimplemented
Some requests, such as .tl, are unimplemented for lack of a good
implementation. Workarounds can be defined as necessary in input
files. |
SEE ALSO
htmlroff(1), mhtml(6) |