2 www.tmac - macro package for adding HTML elements to roff documents.
4 File position: <groff_source_top>/tmac/www.tmac
5 Installed position: groff's main macro directory.
7 ------------------------------------------------------------------------
9 ------------------------------------------------------------------------
11 This file is part of groff, the GNU roff type-setting system.
13 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008
14 Free Software Foundation, Inc.
15 written by Gaius Mulley <gaius@glam.ac.uk>, with additions by
16 Werner Lemberg <wl@gnu.org> and Bernd Warken <bwarken@mayn.de>.
18 groff is free software; you can redistribute it and/or modify it under
19 the terms of the GNU General Public License as published by the Free
20 Software Foundation; either version 2, or (at your option) any later
23 groff is distributed in the hope that it will be useful, but WITHOUT
24 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28 You should have received a copy of the GNU General Public License
29 along with groff; see the file COPYING. If not, write to the Free
30 Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
34 ------------------------------------------------------------------------
36 ------------------------------------------------------------------------
38 A simple set of macros to provide HTML (or XHTML) documents with basic
39 www functionality. It should work with any macro set. In the following,
40 HTML always denotes XHTML also.
44 .\" --------------------------------------------------------------------
46 .\" --------------------------------------------------------------------
48 .do if d www:lenstr .nx
57 .if '\*[.T]'html' .nr www-html 1
59 .\" set up www-image-template
61 .if !d www-image-template \
62 . ds www-image-template
65 . \" remove the title command when we are generating images for html
66 . \" (stops a title accidentally appearing inside an image)
76 .\" --------------------------------------------------------------------
77 .\" Test for `.substring'; result in register `www.substring_ok'.
78 .\" The automated break points in .URL addresses are only added if
79 .\" this register is non-zero.
81 .nr www:substring_ok 0
82 .de www:@test_substring
86 . substring \\$0:s 1 1
87 . if !'\\*[\\$0:s]'b' \{\
92 . substring \\$0:s 0 0
93 . if !'\\*[\\$0:s]'a' \{\
98 . substring \\$0:s 1 -1
99 . if !'\\*[\\$0:s]'bcdefg' \{\
103 . nr www:substring_ok 1
107 .rm www:@test_substring
110 .\" --------------------------------------------------------------------
112 .\" --------------------------------------------------------------------
114 .\" --------------------------------------------------------------------
117 .\" Space before paragraph. Use \n[PD] if it exists.
121 . ie r PD .sp \\n[PD]u
122 . el .sp \\n[www:pd]u
125 .\" --------------------------------------------------------------------
126 .\" www:error (<test>...)
128 .\" Print error message
131 . tm \\n[.F]:\\n[.c]: macro error: \\$*
133 .als www:error www-error
135 .\" --------------------------------------------------------------------
136 .\" www:lenstr (<register_name> <string_name>)
138 .\" Store length of string named <string_name> into register named
142 . if !(\\n[.$] == 2) \{\
143 . tm .\\$0 expects 2 arguments.
146 . length \\$0:n x\\*[\\$2]
147 . nr \\$1 (\\n[\\$0:n]-1)
151 .\" --------------------------------------------------------------------
152 .\" www:splitstr (<name>)
154 .\" Add a space character between any two adjacent characters in string
155 .\" <name> and restore result into the string variable <name>; space
156 .\" characters are first replaced by the word `space'.
159 . if !(\\n[.$] == 1) \
160 . www:error .\\$0 expects 1 argument.
163 . ds \\$0:r "\\*[\\$1]\""
166 . ds \\$0:c "\\*[\\$0:r]\""
167 . substring \\$0:c 0 0\"
168 . ie '\\*[\\$0:c]' ' \
169 . as \\$0:s " space\""
171 . as \\$0:s " \\*[\\$0:c]\""
172 . www:lenstr \\$0:n \\$0:r
173 . if (\\n[\\$0:n] <= 1) \{\
176 . substring \\$0:r 1 -1\"
178 . if !'\\*[\\$0:s]'' \
179 . substring \\$0:s 1 -1
180 . ds \\$1 \\*[\\$0:s]\"
187 .\" --------------------------------------------------------------------
188 .\" www:url_breaks (<string_name>)
190 .\" Add `\:' (possible break point) within URL strings after `/'.
192 .\" Smart about multiple `/', existing `\:', and space characters;
193 .\" does not set a break point if less than 5 characters would go to
197 . if !(\\n[.$] == 1) \
198 . www:error .\\$0 expects 1 argument.
199 . if !\n[www:substring_ok] \
201 . ds \\$0:s "\\*[\\$1]\""
202 . www:splitstr \\$0:s
203 . www:url_breaks_splitted \\$0:s \\*[\\$0:s]
204 . ds \\$1 "\\*[\\$0:s]\""
208 .\" --------------------------------------------------------------------
209 .\" www:url_breaks_splitted (<result> <char> [<char>...])
211 .\" Add `\:' within URL strings, but arguments are a splitted string.
213 .\" Arguments: >=2: <result> <char> [<char>...]
215 .de www:url_breaks_splitted
216 . nr \\$0:min 5 \" minimal number of characters for next line
218 . www:error .\\$0 expects at least 2 arguments.
223 . while !\\n[\\$0:done] \{\
224 . if (\\n[.$] <= 0) \{\
228 . if '\\$1'space' \{\
233 . if (\\n[.$] < \\n[\\$0:min]) \{\
243 . \" we are at a `/' character
246 . if (\\n[.$] == 0) \{\
252 . if \\n[\\$0:done] \
254 . if (\\n[.$] < \\n[\\$0:min]) \
260 . ds \\*[\\$0:res] \\*[\\$0:s]\"
266 .\" --------------------------------------------------------------------
268 .\" --------------------------------------------------------------------
270 .\" --------------------------------------------------------------------
273 .\" the main auxiliary macro for the HTML interface
276 . if \\n[www-html] \{\
277 . \" was implemented via .nop \&\X^html:\\$*^ but
278 . \" is now implemented using HTML-NS to utilize code factoring.
280 . \" the `\&' makes the vertical mode leave, so to say
289 .\" an auxiliary macro for HTML (without following space)
292 . nop \X^html:\\$*^\c
296 .\" emit a HTML tag after shutting down a (possibly open) paragraph
299 . if \\n[www-html] \{\
300 . \" the `\&' makes the vertical mode leave, so to say
301 . nop \&\X^html</p>:\\$*^
306 .\" emit an HTML tag. If text has been written in the paragraph
307 .\" then do not shut the paragraph down.
308 .\" If text was not written, remove the empty
309 .\" paragraph tag and emit the desired html tag.
312 . if \\n[www-html] .nop \&\X^html<?p>:\\$*^
316 .\" emit a MATH tag. If text has been written in the paragraph
317 .\" then do not shut the paragraph down.
318 .\" If text was not written, remove the empty
319 .\" paragraph tag and emit the desired math tag.
322 . if \\n[www-html] .nop \&\X^math<?p>:\\$*^
325 .\" --------------------------------------------------------------------
328 .\" Automatic heading level cut off.
330 .\" N is the depth limit of automatically linked headings. So a depth
331 .\" of 2 would cause grohtml to generate a list of links for `.NH 1'
332 .\" and `.NH 2' but not for `.NH 3'.
339 .\" --------------------------------------------------------------------
340 .\" BCL foreground background active not-visited visited
343 . HTML <body text=\\$1 \
350 .\" --------------------------------------------------------------------
354 . HTML <body background=\\$1>
357 .\" --------------------------------------------------------------------
358 .\" URL url [description] [after]
359 .\" if description is absent then the url becomes the anchor text
364 . www:url_breaks \\$0:adr
366 . ie \\n[www-html] \{\
370 . ds \\$0:after \&\\$3\"
372 . HTML-NS <a "href=""\\$1"">\\$1</a>"
374 . HTML-NS <a "href=""\\$1"">\\$2</a>"
375 . nop \\*[\\$0:after]
379 . if !r ps4html .ad l
387 . nop \%\\*[www:open]\m[\\*[www:color]]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\m[]\\*[www:close]\\$3
389 . nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\\*[www:close]\\$3
395 . nop \m[\\*[www:color]]\\$2\m[]\\$3
397 . nop \f[\\*[www:fontstyle]]\\$2\f[]\\$3
401 . nop \m[\\*[www:color]]\\$2\m[]
402 . nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\\*[www:close]\\$3
405 . nop \f[\\*[www:fontstyle]]\\$2\f[]
406 . nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\\*[www:close]\\$3
415 .\" --------------------------------------------------------------------
416 .\" FTP url description [after]
422 .\" --------------------------------------------------------------------
423 .\" MTO address description [after]
425 .\" ADDRESS is the email address (without the `mailto:' prefix).
427 .\" DESCRIPTION is the optional name. If an empty argument is given,
428 .\" ADDRESS is used instead.
430 .\" AFTER is optional stuff printed immediately after ADDRESS
431 .\" (resp. DESCRIPTION).
435 .\" Foobar has been written by
436 .\" .MTO fred@foo.bar "Fredrick Bloggs" .
439 . ie \\n[www-html] \{\
441 . URL mailto:\\$1 \\$1 "\\$3"
443 . URL mailto:\\$1 "\\$2" "\\$3"
453 . nop \%\m[\\*[www:color]]\f[\\*[www:fontstyle]]\\$1\f[]\m[]\\$3
455 . nop \%\f[\\*[www:fontstyle]]\\$1\f[]\\$3
461 . nop \m[\\*[www:color]]\\$2\m[]\\$3
463 . nop \f[\\*[www:fontstyle]]\\$2\f[]\\$3
467 . nop \m[\\*[www:color]]\\$2\m[]
468 . nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\$1\f[]\\*[www:close]\\$3
471 . nop \f[\\*[www:fontstyle]]\\$2\f[]
472 . nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\$1\f[]\\*[www:close]\\$3
479 .\" --------------------------------------------------------------------
482 .\" Generate an html name NAME.
485 . HTML <a "name=""\\$1""></a>"
488 .\" --------------------------------------------------------------------
489 .\" IMG [-R|-L|-C] filename [width] [height]
491 .\" Include an image of any type (only works for -Thtml).
493 .\" Alignment is centered by default (-C).
494 .\" Default value for WIDTH is 1i.
495 .\" If HEIGHT is not given, WIDTH is used as the height.
498 . ie \\n[www-html] \{\
500 . DEVTAG .right-image
505 . DEVTAG .centered-image
510 . nr www-height \\n[www-width]
513 . HTML <img src="\\$1" alt="Image \\$1" \
514 "width=""\\n[www-width]""" \
515 "height=""\\n[www-height]"""></img>
518 . nop \\*[www:open]\f[\\*[www:fontstyle]]\\$1\f[]\\*[www:close]
521 .\" --------------------------------------------------------------------
522 .\" PIMG [-R|-L|-C] filename [width] [height]
524 .\" Include a png image. It works for -Tps and -Thtml.
525 .\" The default value for WIDTH and HEIGHT is zero; the default
526 .\" alignment is centering (-C).
528 .\" Note: This macro can only be used with the `-U' option of groff,
529 .\" activating unsafe mode, if not used with -Thtml; the PNG image
530 .\" is then converted to the EPS format using netpbm utilities.
533 . ds www-pic-align -C\"
535 . ds www-pic-align -R\"
540 . ds www-pic-align -L\"
547 . ie \\n[www-html] \{\
548 . ds www-htmlalign align=center\"
549 . if '\\*[www-pic-align]'-R' \
550 . ds www-htmlalign align=right\"
551 . if '\\*[www-pic-align]'-L' \
552 . ds www-htmlalign align=left\"
556 . nr www-width (\\$3 * 100 / 240)
558 . nr www-height (\\$4 * 100 / 240)
559 . ie (\\n[www-width] == 0) \{\
560 . ie (\\n[www-height] == 0) \
561 . HTML</p> <p \\*[www-htmlalign]><img "src=""\\$1""" \
562 "alt=""Image \\$1"""></img></p>"
564 . HTML</p> <p \\*[www-htmlalign]><img "src=""\\$1""" \
565 "alt=""Image \\$1""" \
566 "height=""\\n[www-height]"""></img></p>
569 . ie (\\n[www-height] == 0) \
570 . HTML</p> <p \\*[www-htmlalign]><img "src=""\\$1""" \
571 "alt=""Image \\$1""" \
572 "width=""\\n[www-width]"""></img></p>
574 . HTML</p> <p \\*[www-htmlalign]><img "src=""\\$1""" \
575 "alt=""Image \\$1""" \
576 "width=""\\n[www-width]""" \
577 "height=""\\n[www-height]"""></img></p>
582 . www-make-unique-name
585 | @PNMTOPS_NOSETPAGE@ -noturn \
586 > \\*[www-unique-name].eps
588 . PSPIC \\*[www-pic-align] \\*[www-unique-name].eps \\$*
593 .\" --------------------------------------------------------------------
594 .\" auxiliary definitions for MPIMG
596 .nr www-left-ll-trap 0
597 .nr www-left-po-trap 0
598 .nr www-right-ll-trap 0
600 .de www-finish-left-po
601 . po -(\\n[www-left-indent]u + \\n[www-image-gap]u)
602 . wh \\n[www-left-po-trap]u
603 . nr www-left-indent 0
606 .\" called when the -R picture is finished
607 .de www-finish-right-ll
608 . ll +(\\n[www-right-indent]u + \\n[www-image-gap]u)
609 . \" now see whether we need to inline www-finish-left-ll
610 . if (\\n[www-left-ll-trap]u > 0) \
611 . if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-ll-trap]u) \{\
612 . mk www-left-po-trap
613 . nr www-left-po-trap +1v
614 . wh \\n[www-left-po-trap]u www-finish-left-po
615 . ll +\\n[www-left-indent]u
616 . wh \\n[www-left-ll-trap]u
617 . nr www-left-ll-trap 0
619 . \" and see whether we need to inline www-finish-left-po
620 . if (\\n[www-left-po-trap]u > 0) \
621 . if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-po-trap]u) \{\
622 . po -\\n[www-left-indent]u
623 . wh \\n[www-left-po-trap]u
624 . nr www-left-indent 0
626 . wh \\n[www-right-ll-trap]u
627 . nr www-right-ll-trap 0
630 .de www-finish-left-ll
631 . if (\\n[www-right-ll-trap] > 0) \
632 . if ((\\n[www-left-ll-trap] + 1v) >= \\n[www-right-ll-trap]) \{\
633 . ll +\\n[www-right-indent]u
634 . nr www-right-ll-trap 0
636 . mk www-left-po-trap
637 . nr www-left-po-trap +1v
638 . wh \\n[www-left-po-trap]u www-finish-left-po
639 . ll +(\\n[www-left-indent]u + \\n[www-image-gap]u)
640 . wh \\n[www-left-ll-trap]u
641 . nr www-left-ll-trap 0
644 .\" www-handle-percent arg N1 N2 S1
645 .\" arg - input string (number or number%)
646 .\" output parameters:
647 .\" N1 - name of number register 1=absolute 0=percentage
648 .\" N2 - number register name for absolute value
649 .\" S1 - string register name for percentage value
651 .de www-handle-percent
652 . ds www-percent \\$1\"
653 . substring www-percent -1 -1
655 . ie '\\*[www-percent]'%' \{\
657 . substring www-abs 0 -2
659 . nr \\$3 \\*[www-abs]
669 .\" --------------------------------------------------------------------
670 .\" MPIMG [-R|-L] [-G gap] filename [width [height]]
672 .\" Include a png image and wrap text around it. It works for
673 .\" -Tps and -Thtml. The default value for WIDTH is 1i; default value
674 .\" for HEIGHT is WIDTH; the default alignment is left (-L).
675 .\" -G is used to insert a gap between the text and the image.
676 .\" The height and width can also be given as a percentage.
677 .\" The PostScript device converts the percentage width into an
678 .\" absolute value by using \\n[.l], and the height by using \\n[.p].
681 .\" Note: This macro can only be used with the `-U' option of groff,
682 .\" activating unsafe mode, if not used with -Thtml; the PNG image
683 .\" is then converted to the EPS format using netpbm utilities.
685 .nr www-htmlimage-gap 0
688 . nr www-image-just 1
690 . while (\\n[.$] > 0) \{\
692 . nr www-image-just 1
697 . nr www-image-just 0
702 . nr www-image-gap \\$2
703 . nr www-htmlimage-gap (\\$2 * 100 / 240)
712 . ds www-size-specs width=""\\n[www-width]" height="\\n[www-height]"
714 . nr www-is-absolute 0
716 . ds www-percentage none\"
717 . www-handle-percent \\$2 www-is-absolute www-absolute www-percentage
718 . ie !\\n[www-is-absolute] \{\
719 . \" percentage of linelength requested
720 . nr www-width (\\n[www-absolute] * \\n[.l] / 100)
722 . nr www-width (\\n[www-width] * 100 / 240)
723 . ds www-size-specs width=\"\\*[www-percentage]"
726 . nr www-width \\n[www-absolute]
728 . nr www-width (\\n[www-width] * 100 / 240)
729 . ds www-size-specs width=\"\\n[www-width]"
732 . nr www-height \\n[www-width]
734 . nr www-is-absolute 0
736 . ds www-percentage none\"
737 . www-handle-percent \\$3 www-is-absolute www-absolute www-percentage
738 . ie !\\n[www-is-absolute] \{\
739 . \" percentage of pagelength requested
740 . nr www-height (\\n[www-absolute] * \\n[.p] / 100)
742 . nr www-height (\\n[www-height] * 100 / 240)
743 . ds www-size-specs "\\*[www-size-specs] height="\\*[www-percentage]"
746 . nr www-height \\n[www-absolute]
748 . nr www-height (\\n[www-height] * 100 / 240)
749 . ds www-size-specs "\\*[www-size-specs] "height="\\*[www-height]"
754 . \" height not specified; use width value
755 . ie !\\n[www-is-absolute] \{\
756 . \" percentage value
757 . ds www-size-specs "\\*[www-size-specs] "height="\\*[www-percentage]"
758 . nr www-height \\n[www-width]
761 . ds www-size-specs "\\*[www-size-specs] "height="\\*[www-width]"
762 . nr www-height \\n[www-width]
766 . ie \\n[www-html] \{\
767 . ie !\\n[www-image-just] \
768 . HTML <img "src=""\\$1""" \
769 "alt=""Image \\$1""" \
770 "hspace=""\\n[www-htmlimage-gap]""" \
771 "align=""right"" \\*[www-size-specs]"""></img>
773 . HTML <img "src=""\\$1""" \
774 "alt=""Image \\$1""" \
775 "hspace=""\\n[www-htmlimage-gap]""" \
776 "align=""left"" \\*[www-size-specs]"""></img>
779 . tm www-width is \\n[www-width]
780 . tm www-height is \\n[www-height]
782 . www-make-unique-name
785 | @PNMTOPS_NOSETPAGE@ -noturn \
786 > \\*[www-unique-name].eps
787 . ie !\\n[www-image-just] \{\
788 . \" we must now disable a possible left image trap
790 . if (\\n[www-left-ll-trap] > 0) \
791 . wh \\n[www-left-ll-trap]u
792 . if (\\n[www-left-po-trap] > 0) \
793 . wh \\n[www-left-po-trap]u
794 . PSPIC -R \\*[www-unique-name].eps \\n[www-width]u \\n[www-height]u
796 . nr www-right-indent \\n[ps-deswid]u
797 . \" we want to have some space between text and image,
798 . \" so the line length must be shorter
799 . ll -(\\n[www-right-indent]u + \\n[www-image-gap]u)
800 . mk www-right-ll-trap
801 . nr www-right-ll-trap +(\\n[ps-desht]u - 1v)
802 . wh \\n[www-right-ll-trap]u www-finish-right-ll
803 . \" now restore possible left trap
804 . if (\\n[www-left-ll-trap] > 0) \
805 . wh \\n[www-left-ll-trap]u www-finish-left-ll
806 . if (\\n[www-left-po-trap] > 0) \
807 . wh \\n[www-left-po-trap]u
810 . \" we must now disable a possible right image trap
811 . if (\\n[www-right-ll-trap] > 0) \
812 . wh \\n[www-right-ll-trap]u
813 . PSPIC -L \\*[www-unique-name].eps \\n[www-width]u \\n[www-height]u
815 . nr www-left-indent \\n[ps-deswid]u
816 . \" increase offset by gap
817 . po +(\\n[www-left-indent]u + \\n[www-image-gap]u)
818 . \" decrease line length by gap
819 . ll -(\\n[www-left-indent]u + \\n[www-image-gap]u)
820 . mk www-left-ll-trap
821 . nr www-left-ll-trap +(\\n[ps-desht]u - 1v)
822 . wh \\n[www-left-ll-trap]u www-finish-left-ll
823 . \" now restore possible right trap
824 . if (\\n[www-right-ll-trap] > 0) \
825 . wh \\n[www-right-ll-trap]u www-finish-right-ll
831 .\" --------------------------------------------------------------------
834 .\" Begin heading. Heading level is N.
840 .\" If your heading contains URL, FTP, MTO macros you might wish to
841 .\" disable automatic links to headings. This can be done via `-P-l'
842 .\" from the command line or by using a cakk to `.HX 0'.
844 .nr www-heading-no -1
848 . nr www-heading-no 1
850 . nr www-heading-no \\$1
851 . DEVTAG-NH \\n[www-heading-no]
855 . if (\\n[www-heading-no] == -1) \
856 . www-error HnE found without a corresponding HnS
860 .\" --------------------------------------------------------------------
863 .\" Emit the automatically collected links derived from
864 .\" section/numbered headings at this position.
870 .\" --------------------------------------------------------------------
873 .\" Produce a horizontal line.
879 .\" --------------------------------------------------------------------
882 .\" Suppresses the generation of the top and bottom rules which grohtml
883 .\" emits by default.
886 . DEVTAG .no-auto-rule
890 .\" www-end-nowhere - end of input trap called to finish diversion.
893 . if !\\n[www-html] \
898 .\" --------------------------------------------------------------------
901 .\" Generate an HTML title only. This differs from the -ms .TL macro
902 .\" which generates both an HTML title and an H1 heading.
904 .\" This is useful when an author wishes to use a HTML title as search
905 .\" engine fodder but a graphic title in the document.
907 .\" The macro terminates when a space or break is seen (.sp, .br).
911 . if !\\n[www-html] \
913 . it 2 www-end-nowhere
916 .\" --------------------------------------------------------------------
917 .\" auxiliary definitions for lists
919 .ds www-ul-level1 \[bu]\ \ \"
920 .ds www-ul-level2 \[sq]\ \ \"
921 .ds www-ul-level3 \[ci]\ \ \"
924 .ds www-ol-level1 decimal\"
925 .ds www-ol-level2 lower-alpha\"
926 .ds www-ol-level3 lower-roman\"
927 .ds www-ol-tmp 00\ \ \"
939 .\" allow nested lists
942 .nr www-li-indent \n[.i]
954 .\" which macro to use for LI
957 . ds www-level\\n[www-depth] \\$1\"
958 . ds www-ltag\\n[www-depth]
964 . als LI \\*[www-level\\n[www-depth]]
967 .\" www-emit-ltag - shuts down a previous open list tag
968 .\" before issuing a new tag \\$1.
969 .\" It then records tag \\$1 is open.
972 . if !'\\*[www-ltag\\n[www-depth]]'' \
973 . HTML-NS </\\*[www-ltag\\n[www-depth]]>
976 . ds www-ltag\\n[www-depth] \\$1
980 .\" Auxiliary macro for ULS.
982 .de www-push-ul-level
984 . if (\\n[www-ul-level] > 3) \
985 . www-error ULS: too many levels of indentation (\\n[www-ul-level])
988 .\" Auxiliary macro for ULE.
991 . if !\\n[www-ul-level] \
992 . www-error ULE: trying to terminate a list which does not exist
997 .\" Auxiliary macro for OLS.
999 .de www-push-ol-level
1000 . nr www-ol-level +1
1001 . if (\\n[www-ol-level] > 3) \
1002 . www-error OLS: too many levels of indentation (\\n[www-ol-level])
1006 .\" Auxiliary macro for OLE.
1008 .de www-pop-ol-level
1009 . if !\\n[www-ol-level] \
1010 . www-error OLE: trying to terminate a list which does not exist
1011 . nr www-ol-level -1
1014 .\" --------------------------------------------------------------------
1017 .\" Start an unordered list.
1020 . www-push-li www-li-ul
1022 . ie \\n[www-html] \{\
1027 . nr www-li-indent +\w'\\*[www-ul-level\\n[www-ul-level]]'u
1030 .\" --------------------------------------------------------------------
1033 .\" End an unordered list.
1036 . ie \\n[www-html] \{\
1041 . nr www-li-indent -\w'\\*[www-ul-level\\n[www-ul-level]]'u
1042 . in \\n[www-li-indent]u
1048 .\" --------------------------------------------------------------------
1051 .\" Start an ordered list.
1054 . www-push-li www-li-ol
1056 . ie \\n[www-html] \{\
1058 . HTML</p> <ol "style=""list-style-type:" \
1059 "\\*[www-ol-level\\n[www-ol-level]]"">"
1062 . nr www-li-indent +\w'\\*[www-ol-tmp]'u
1065 .\" --------------------------------------------------------------------
1068 .\" End an ordered list.
1071 . ie \\n[www-html] \{\
1076 . nr www-li-indent -\w'\\*[www-ol-tmp]'u
1077 . in \\n[www-li-indent]u
1078 . nr www-ol-ctr\\n[www-ol-level] 0 1
1084 .\" --------------------------------------------------------------------
1087 .\" Start a definition list.
1090 . www-push-li www-li-dl
1091 . nr www-dl-level +1
1092 . ie \\n[www-html] \{\
1097 . nr www-li-indent +\\n[www-dl-shift]u
1098 . in \\n[www-li-indent]u
1102 .\" --------------------------------------------------------------------
1105 .\" End a definition list.
1108 . ie \\n[www-html] \{\
1113 . nr www-li-indent -\\n[www-dl-shift]u
1114 . in \\n[www-li-indent]u
1116 . nr www-dl-level -1
1120 .\" --------------------------------------------------------------------
1123 .\" Insert a list item.
1126 .\" www-li-ul - bulleted list item
1129 . ie \\n[www-html] \
1133 . in \\n[www-li-indent]u
1134 . ti -\w'\\*[www-ul-level\\n[www-ul-level]]'u
1135 . nop \\*[www-ul-level\\n[www-ul-level]]\c
1140 .\" www-li-ol - numbered list item
1143 . ie \\n[www-html] \
1147 . in \\n[www-li-indent]u
1148 . ti -\w'\\n[www-ol-ctr\\n[www-ol-level]]\ \ 'u
1149 . nop \\n+[www-ol-ctr\\n[www-ol-level]]\ \ \c
1154 .\" www-li-dl - definition list item
1157 . ie \\n[www-html] \{\
1158 . HTML <dt>\\$1</dt>
1163 . in \\n[www-li-indent]u
1164 . ti -\\n[www-dl-shift]u
1170 .\" --------------------------------------------------------------------
1171 .\" DC l text [color]
1173 .\" L is the letter to be dropped and enlarged.
1175 .\" TEXT is the following text whose height the first letter should not
1178 .\" COLOR is the optional color of the dropped letter (default black).
1181 . ds www-dropcolor black\"
1183 . ds www-dropcolor \\$3\"
1184 . ie '\*[.T]'html' \{\
1185 . www-make-unique-name
1186 . nr www-drop-width (100u * \\n[.v]u * 3u / \\n[.l]u)
1187 . MPIMG -L \\*[www-unique-name].png \\n[www-drop-width]%
1191 . www-make-unique-name
1192 . \" To avoid interferences with another DC macro call which is located
1193 . \" very near to the current one, we draw the glyph on a separate page.
1194 . \" Otherwise it could theoretically happen that the dropped capital
1195 . \" glyphs overlap.
1199 . nop \O[5i\\*[www-unique-name].png]\O[1]
1200 . nop \m[\\*[www-dropcolor]]\s[160]\O[3]\\$1\O[4]
1210 . nr dummy \w'\\$1'u
1211 . nr dcht ((\\n[.v] + \\n[rst]) * \\n[.ps] / \\n[rst])
1212 . char \[dcap] \m[\\*[www-dropcolor]]\s'\\n[dcht]u'\\$1
1213 . nop \v'\\n[.v]u'\\[dcap]\v'-\\n[.v]u'\c
1221 .\" --------------------------------------------------------------------
1222 .\" Setup around HTML-IMAGE and friends
1224 .\" now set up TS, TE, EQ, EN default macros
1226 .do if !d TS .do ds TS HTML-IMAGE\"
1227 .do if !d TE .do ds TE HTML-IMAGE-END\"
1228 .do if !d EQ .do ds EQ EQN-HTML-IMAGE\"
1229 .do if !d EN .do ds EN EQN-HTML-IMAGE-END\"
1232 .\" supplementary macros used by other macro sets
1234 .\" here are some tags specially for -Tps or -Thtml when invoked by
1235 .\" pre-html to generate png images from postscript.
1237 .\" --------------------------------------------------------------------
1238 .\" HTML-DO-IMAGE - tells troff to issue an image marker which can be
1239 .\" read back by pre-html
1243 . nop \O[5\\$2\\$1.png]\O[1]\O[3]
1244 . if \\n[www-html] \
1245 . nop \O[5\\$2\\$1.png]\O[0]\O[3]
1248 .\" --------------------------------------------------------------------
1249 .\" HTML-IMAGE-END - terminates an image for html
1253 . nop \O[4]\O[2]\O[0]
1254 . if \\n[www-html] \
1255 . nop \O[4]\O[2]\O[1]
1260 .\" --------------------------------------------------------------------
1261 .\" www-make-unique-name - generates another unique name in string
1262 .\" `www-unique-name'
1264 .de www-make-unique-name
1266 . ds www-unique-name \\*[www-image-template]\\n[www-png-no]\"
1269 .\" --------------------------------------------------------------------
1270 .\" HTML-IMAGE and friends tell grohtml that this region of text needs
1271 .\" to be rendered as an image.
1274 . \" generates a centered image
1275 . www-make-unique-name
1276 . HTML-DO-IMAGE \\*[www-unique-name] c
1279 .de HTML-IMAGE-RIGHT
1280 . www-make-unique-name
1281 . HTML-DO-IMAGE \\*[www-unique-name] r
1285 . www-make-unique-name
1286 . HTML-DO-IMAGE \\*[www-unique-name] l
1289 .de HTML-IMAGE-INLINE
1290 . www-make-unique-name
1291 . HTML-DO-IMAGE \\*[www-unique-name] i
1294 .\" EQN-HTML-IMAGE and friends check to see whether the equation is
1295 .\" not in an image, in which case it allows html
1296 .\" (mathml) to be generated (if -Txhtml was specified).
1299 . \" generates a centered image
1300 . www-make-unique-name
1301 . EQN-HTML-DO-IMAGE \\*[www-unique-name] c
1304 .de EQN-HTML-IMAGE-RIGHT
1305 . www-make-unique-name
1306 . EQN-HTML-DO-IMAGE \\*[www-unique-name] r
1309 .de EQN-HTML-IMAGE-LEFT
1310 . www-make-unique-name
1311 . EQN-HTML-DO-IMAGE \\*[www-unique-name] l
1314 .de EQN-HTML-IMAGE-INLINE
1315 . www-make-unique-name
1316 . EQN-HTML-DO-IMAGE \\*[www-unique-name] i
1318 .\" --------------------------------------------------------------------
1319 .\" EQN-HTML-DO-IMAGE - tells troff to issue an image marker which can be
1320 .\" read back by pre-html
1322 .de EQN-HTML-DO-IMAGE
1324 . if !(\\n[.O] == 0) \{\
1326 . nop \O[5\\$2\\$1.png]\O[1]\O[3]
1327 . if \\n[www-html] \
1328 . nop \O[5\\$2\\$1.png]\O[0]\O[3]
1331 . el .HTML-DO-IMAGE \\$*
1334 .\" --------------------------------------------------------------------
1335 .\" EQN-HTML-IMAGE-END - terminates an image for html
1337 .de EQN-HTML-IMAGE-END
1339 . if !(\\n[.O] == 0) \{\
1341 . nop \O[4]\O[2]\O[0]
1342 . if \\n[www-html] \
1343 . nop \O[4]\O[2]\O[1]
1346 . el .HTML-IMAGE-END
1349 .\" --------------------------------------------------------------------
1352 .\" Generate multiple output files containing the html.
1353 .\" A file is split whenever a .SH or .NH 1 is encountered.
1354 .\" The argument to JOBNAME is the file stem for future output files.
1357 . DEVTAG .job-name \\$1
1360 .\" --------------------------------------------------------------------
1363 .\" Adds information to the <head> </head> section of the html
1365 .\" --------------------------------------------------------------------
1367 . DEVTAG .head "\\$*"
1370 .\" --------------------------------------------------------------------
1371 .\" start of some code
1378 .\" --------------------------------------------------------------------
1379 .\" end of some code
1386 .ds www-nav-colour #eeeeee\"
1387 .nr www-nav-width-left 30
1388 .nr www-nav-width-right 70
1390 .\" --------------------------------------------------------------------
1391 .\" LNS - left navigation start
1394 . HTML</p> <table><tr><td valign=top \
1395 width=\\n[www-nav-width-left]% \
1396 "bgcolor=""\\*[www-nav-colour]"">"
1398 . HTML</p> </td><td valign=top \
1399 width=\\n[www-nav-width-right]%>
1403 .\" --------------------------------------------------------------------
1404 .\" LNE - left navigation end
1407 . HTML</p> </td></tr></table>
1415 .\" some auxiliary macros for left navigation lists
1418 . if (0\\$1 == 0) \{\
1419 . if (\\n[SH-open] == 1) \
1427 . if (0\\$1 <= 1) \{\
1428 . if (\\n[SH-open] == 1) \
1437 . if (\\n[needs-begin] == 1) \{\
1444 .\" --------------------------------------------------------------------
1445 .\" ALN [colour] [left width percentage]
1447 .\" Turn on automatic left navigation. This macro should only be
1448 .\" called once (normally at the start of the document) as it
1449 .\" indicates that all top-level section headings form a navigation
1450 .\" list on the left of the main text.
1453 . if '\*[.T]'html' \{\
1455 . ds www-nav-colour \\$1\"
1456 . if (0\\$2 > 0) \{\
1457 . nr www-nav-width-left \\$2
1458 . nr www-nav-width-right (100 - \\$2)
1469 .\" --------------------------------------------------------------------
1470 .\" LINKSTYLE color [fontstyle [openglyph closeglyph]]
1472 .\" Initializes www.tmac so that when this macro set is used with
1473 .\" non-HTML devices the urls are rendered the user defined attributes.
1476 .\" LINKSTYLE blue CR < >
1479 . if (\\n[.$] < 1) \
1480 . www:error .\\$0 expects at least 1 argument.
1481 . ds www:color \\$1\"
1483 . if (\\n[.$] < 1) \
1485 . ds www:fontstyle \\$1\"
1487 . if (\\n[.$] < 1) \
1488 . www:error .\\$0 expects that both the open and close glyph is specified
1489 . ds www:open \\$1\"
1490 . ds www:close \\$2\"
1493 .\" MATHML - enable eqn mathml output to pass through to the device
1497 . if (\\n[.O] == 0) .MATH<?p> \\$*
1500 .\" --------------------------------------------------------------------
1502 .\" --------------------------------------------------------------------
1504 .LINKSTYLE blue C \[la] \[ra]
1506 .if \n[www-html] \{\
1511 .if r ps4html .nop \O[0]
1516 .\" --------------------------------------------------------------------
1518 .\" --------------------------------------------------------------------
1520 .\" Local Variables: