.\" www.tmac .\" .\" A simple set of macros to provide HTML documents with basic .\" www functionality. It should work with any macro set. .\" .nr _C \n(.C .cp 0 . .nr www-html 0 .if '\*[.T]'html' .nr www-html 1 . .\" set up www-image-template .\" (cannot do this in html.tmac as the image device must .\" also know about this string) . .if !d www-image-template \ . ds www-image-template . .if r ps4html \{\ . \" remove the title command when we are generating images for html . \" (stops a title accidentally appearing inside an image) . di www-notitle . tl '''' . di . rm tl . de tl . . .\} . .de www-error . tm \\n[.F]:\\n[.c]: macro error: \\$* .. .\" .\" the main auxiliary macro for the HTML interface .\" .de HTML . if \\n[www-html] \{\ . \" the following line makes the vertical mode leave, so to say . nop \& . nop \X^html:\\$*^ . \} .. .\" .\" an auxiliary macro for HTML (without following space) .\" .de HTML-NS . if \\n[www-html] \ . nop \X^html:\\$*^\c .. .\" .\" HX n .\" .\" Automatic heading level cut off. .\" .\" N is the depth limit of automatically linked headings. So a depth .\" of 2 would cause grohtml to generate a list of links for `.NH 1' and .\" `.NH 2' but not for `.NH 3'. .\" .de HX . if \\n[www-html] \ . nop \X^index:\\$*^ .. .\" .\" BCL foreground background active not-visited visited .\" .de BCL . HTML
.. .\" .\" BGIMG imagefile .\" .de BGIMG . HTML .. .\" .\" URL url description [after] .\" .de URL . ie \\n[www-html] \ . HTML \\$2\\$3 . el \ . nop \m[blue]\\$2\m[] \%\[la]\f[C]\\$1\f[]\[ra]\\$3 .. .\" .\" FTP url description [after] .\" .\" Same as UTL. .\" .als FTP URL .\" .\" MTO address description [after] .\" .\" ADDRESS is the email address (without the `mailto:' prefix). .\" .\" DESCRIPTION is the optional name. If an empty argument is given, .\" ADDRESS is used instead. .\" .\" AFTER is optional stuff printed immediately after ADDRESS .\" (resp. DESCRIPTION). .\" .\" Example: .\" .\" Foobar has been written by .\" .MTO fred@foo.bar "Fredrick Bloggs" . .\" .de MTO . ie \\n[www-html] \{\ . ie '\\$2'' \ . URL mailto:\\$1 \\$1 "\\$3" . el \ . URL mailto:\\$1 "\\$2" "\\$3" . \} . el \{\ . ie '\\$2'' \ . nop \%\m[blue]\f[C]\\$1\f[]\m[]\\$3 . el \ . nop \m[blue]\\$2\m[] \%\[la]\f[C]\\$1\f[]\[ra]\\$3 . \} .. .\" .\" TAG name .\" .\" Generate an html name NAME. .\" .de TAG . HTML .. .\" .\" IMG [-R|-L|-C] filename [width] [height] .\" .\" Include an image of any type (will only work for -Thtml). .\" .\" Alignment is centered by default (-C). .\" Default value for WIDTH is 1i. .\" If HEIGHT is not given, WIDTH is used as the height. .\" .de IMG . ie \\n[www-html] \{\ . ie '\\$2'-R' \ . HTML-TAG ".right-image" . el \{\ . ie '\\$2'-L' \ . HTML-TAG ".left-image" . el \ . HTML-TAG ".centered-image" . \} . nr www-width 100 . if !'\\$3'' \ . nr www-width \\$3 . nr www-height \\n[www-width] . if !'\\$4'' \ . nr www-height \\$4 . HTML . \} . el \ . nop \[la]\f[C]\\$1\f[]\[ra] .. .\" .\" HTML-TAG .\" .\" Emit a tag for grohtml. This is an internal macro. .\" .de HTML-TAG . if \\n[www-html] \{\ . \" the following line makes the vertical mode leave, so to say . nop \& . nop \X^html-tag:\\$*^ . \} .. .\" .\" HTML-TAG-NS .\" .\" Emit a tag for grohtml (without a space). This is an internal macro. .\" .de HTML-TAG-NS . if \\n[www-html] \ . nop \X^html-tag:\\$*^\c .. .\" .\" PIMG [-R|-L|-C] filename [width] [height] .\" .\" Include a png image. It will work for -Tps and -Thtml. .\" The default value for WIDTH and HEIGHT is zero; the default .\" alignment is centering (-C). .\" .\" Note: This macro can only be used with the `-U' option of groff, .\" activating unsafe mode, if not used with -Thtml; the PNG image .\" is then converted to the EPS format using netpbm utilities. .\" .de PIMG . ie \\n[www-html] \{\ . ie '\\$1'-R' \ . HTML-TAG ".right-image" . el \{\ . ie '\\$1'-L' \ . HTML-TAG ".left-image" . el \ . HTML-TAG ".centered-image" . \} . nr www-width 0 . nr www-height 0 . if !'\\$3'' \ . nr www-width (\\$3 * 100 / 240) . if !'\\$4'' \ . nr www-height (\\$4 * 100 / 240) . ie (\\n[www-width] == 0) \{\ . ie (\\n[www-height] == 0) \ . HTML . el \ . HTML . \} . el \{\ . ie (\\n[www-height] == 0) \ . HTML . el \ . HTML . \} . \} . el \{\ . if !r ps4html \{\ . www-make-unique-name . sy pngtopnm \\$2 | pnmcrop -white | pnmtops -noturn > \\*[www-unique-name].eps . ie '\\$1'-C' \ . PSPIC \\*[www-unique-name].eps \\$3 \\$4 . el \ . PSPIC \\$1 \\*[www-unique-name].eps \\$3 \\$4 . \} . \} .. . .nr www-left-ll-trap 0 .nr www-left-po-trap 0 .nr www-right-ll-trap 0 . .de www-finish-left-po . po -\\n[www-left-indent]u . wh \\n[www-left-po-trap]u . nr www-left-indent 0 .. . .de www-finish-right-ll . ll +\\n[www-right-indent]u . \" now see whether we need to inline www-finish-left-ll . if (\\n[www-left-ll-trap]u > 0) \ . if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-ll-trap]u) \{\ . mk www-left-po-trap . nr www-left-po-trap +1v . wh \\n[www-left-po-trap]u www-finish-left-po . ll +\\n[www-left-indent]u . wh \\n[www-left-ll-trap]u . nr www-left-ll-trap 0 . \} . \" and see whether we need to inline www-finish-left-po . if (\\n[www-left-po-trap]u > 0) \ . if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-po-trap]u) \{\ . po -\\n[www-left-indent]u . wh \\n[www-left-po-trap]u . nr www-left-indent 0 . \} . wh \\n[www-right-ll-trap]u . nr www-right-ll-trap 0 .. . .de www-finish-left-ll . if (\\n[www-right-ll-trap] > 0) \ . if ((\\n[www-left-ll-trap] + 1v) >= \\n[www-right-ll-trap]) \{\ . ll +\\n[www-right-indent]u . nr www-right-ll-trap 0 . \} . mk www-left-po-trap . nr www-left-po-trap +1v . wh \\n[www-left-po-trap]u www-finish-left-po . ll +\\n[www-left-indent]u . wh \\n[www-left-ll-trap]u . nr www-left-ll-trap 0 .. .\" .\" MPIMG [-R|-L] filename [width] [height] .\" .\" Include a png image and wrap text around it. It will work for .\" -Tps and -Thtml. The default value for WIDTH is 1i; default value .\" for HEIGHT is WIDTH; the default alignment is left (-L). .\" .\" Note: This macro can only be used with the `-U' option of groff, .\" activating unsafe mode, if not used with -Thtml; the PNG image .\" is then converted to the EPS format using netpbm utilities. .\" .de MPIMG . nr www-width 1i . if !'\\$3'' \ . nr www-width \\$3 . nr www-height \\n[www-width] . if !'\\$4'' \ . nr www-height \\$4 . nr www-width (\\n[www-width] * 100 / 240) . nr www-height (\\n[www-height] * 100 / 240) . ie \\n[www-html] \{\ . ie '\\$1'-R' \ . HTML . el \ . HTML . \} . el \{\ . if !r ps4html \{\ . www-make-unique-name . sy pngtopnm \\$2 | pnmcrop -white | pnmtops -noturn > \\*[www-unique-name].eps . ie '\\$1'-R' \{\ . \" we must now disable a possible left image trap . sp -1 . if (\\n[www-left-ll-trap] > 0) \ . wh \\n[www-left-ll-trap]u . if (\\n[www-left-po-trap] > 0) \ . wh \\n[www-left-po-trap]u . PSPIC -R \\*[www-unique-name].eps \\$3 \\$4 . sp -\\n[ps-desht]u . nr www-right-indent \\n[ps-deswid]u . ll -\\n[www-right-indent]u . mk www-right-ll-trap . nr www-right-ll-trap +(\\n[ps-desht]u - 1v) . wh \\n[www-right-ll-trap]u www-finish-right-ll . \" now restore possible left trap . if (\\n[www-left-ll-trap] > 0) \ . wh \\n[www-left-ll-trap]u www-finish-left-ll . if (\\n[www-left-po-trap] > 0) \ . wh \\n[www-left-po-trap]u . \} . el \{\ . \" we must now disable a possible right image trap . if (\\n[www-right-ll-trap] > 0) \ . wh \\n[www-right-ll-trap]u . PSPIC -L \\*[www-unique-name].eps \\$3 \\$4 . sp -\\n[ps-desht]u . nr www-left-indent \\n[ps-deswid]u . po +\\n[www-left-indent]u . ll -\\n[www-left-indent]u . mk www-left-ll-trap . nr www-left-ll-trap +(\\n[ps-desht]u - 1v) . wh \\n[www-left-ll-trap]u www-finish-left-ll . \" now restore possible right trap . if (\\n[www-right-ll-trap] > 0) \ . wh \\n[www-right-ll-trap]u www-finish-right-ll . \} . \} . \} .. .\" .\" HnS n .\" .\" Begin heading. Heading level is N. .\" .\" HnE .\" .\" End heading. .\" .\" If your heading contains URL, FTP, MTO macros you might wish to .\" disable automatic links to headings. This can be done via `-P-l' .\" from the command line or by using a cakk to `.HX 0'. .\" .nr www-heading-no -1 . .de HnS . ie '\\$1'' \ . nr www-heading-no 1 . el \ . nr www-heading-no \\$1 . HTML-TAG ".NH \\n[www-heading-no]" .. . .de HnE . if (\\n[www-heading-no] == -1) \ . www-error "HnE found without a corresponding HnS" . br .. .\" .\" LK .\" .\" Emit the automatically collected links derived from .\" section/numbered headings at this position. .\" .de LK . HTML-TAG ".links" .. .\" .\" HR .\" .\" Produce a horizontal line .\" .de HR . ie \\n[www-html] \{\ . ti 0 . HTML-NS