3 htmlroff \- HTML formatting and typesetting
8 input with a few extensions and changes.
9 This manual describes the changes to the input language,
10 assuming a working knowledge of
15 Request, macro, string, and number names can be longer
16 than two letters, as in:
34 \&.html \fIid\fP \fR[ \fI<html>\fP ]\fL
35 \&.ihtml \fIid\fP \fR[ \fI<ihtml>\fP ]\fL
41 insert HTML into the output.
42 The requests are only for opening new HTML tags.
43 To close previously-opened tags, repeat the request
46 For example, the input:
59 <table><tr><td>Cell 1</td><td>Cell 2</td></tr></table>
64 request is intended for block-level HTML constructs (those that can contain
66 and maintains the HTML tag stack automatically.
67 Intermediate tags need not be explicitly closed:
70 line in the example above would produce the same output.
74 closes the HTML tags immediately after printing them.
80 but is intended for inline HTML constructs such as
84 (those that can be contained
90 treats the open HTML tags as a set rather than a stack:
91 each must be explicitly closed.
92 Although it treats the tags as a set,
94 treats nesting properly in the output,
95 closing and reopening tags as necessary.
96 For example, the input:
100 \&.ihtml link <a href="link.html">
103 and italic, still linked.
109 produces this output:
112 <b><a href="link.html">Bold</a></b>
113 <i><a href="link.html">and italic, still linked.</i></a>
121 requests, the characters
126 are treated as normal characters, not HTML markers,
127 and are translated to
133 To embed the raw HTML markers, use
148 requests to change the font and point size.
149 After applying each such change to its internal registers,
153 macro to emit corresponding HTML.
154 The default definition of
162 \&.ihtml f <span style=\"font-size=\\n(.spt\">
163 \&.if \\n(.f==2 .ihtml f1 <i>
164 \&.if \\n(.f==3 .ihtml f1 <b>
165 \&.if \\n(.f==4 .ihtml f1 <b><i>
166 \&.if \\n(.f==5 .ihtml f1 <tt>
167 \&.if \\n(.f==6 .ihtml f1 <tt><i>
171 Input files can redefine
173 like any other request or macro.
176 implements line height, text adjustment, and margins by
177 wrapping all output text in
180 This behavior can be disabled by setting the
182 number register to zero.
186 eliminates only the margin annotations.
187 .SS Subscripts and superscripts
195 requests to move vertically during output.
196 It emits output vertically offset up the page inside
198 tags and output vertically offset down the page
202 This heuristic handles simple equations formatted by
204 .SS Conditional input
206 To make it easier to write input files that can be formatted by both
213 which evaluates true in
220 condition continues to evaluate true, to accomodate
221 input files trying to distinguish between
225 To write a conditional matching
228 .RB ` ".if !h .if t" '.
231 handling of conditional input does not match
249 Do not write files depending on this behavior, as this bug may be fixed
254 in some cases. To work around them, use
256 on a line by itself, as in the last example.
261 use the alignment in effect at the time of the
275 produces a centered line in
279 The solution is to center inside the diversion, as in
289 implements traps at vertical position 0,
290 which run when the first character is about
292 Other position traps are ignored.
293 Input traps are implemented.
305 The redirection stops on encountering the line
307 optionally followed by white space and extra text.
308 This is a dangerous and clumsy request, as
310 stops interpreting its input during the redirection, so
312 must be found in the input itself, not in a macro that
313 the input might appear to call.
316 allows input files to invoke
318 to handle complicated input.
323 macro that marks the beginning of a
330 \&.ds pngbase "\e\e*[basename]
331 \&.if '\e\e*[pngbase]'' .ds pngbase \e\en(.B
332 \&.ds pngfile \e\e*[pngbase]\e\en+[png].png
333 \&.html - <center><img src="\e\e*[pngfile]"></center>
334 \&.inputpipe .PE troff2png >\e\e*[pngfile]
338 This macro invokes the shell script
340 to run troff and convert the Postscript
341 output to a PNG image file.
342 Before starting the program, the macro creates
343 a new file name for the image and prints
344 HTML referring to it.
347 register holds the final path element
348 (the base name) of the current input file.
350 Tabs are set every eight spaces and cannot be changed.
352 Some requests, such as
354 are unimplemented for lack of a good implementation.
355 Workarounds can be defined as necessary in input files.