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 Free Software Foundation, Inc.
14 written by Gaius Mulley <gaius@glam.ac.uk>, with additions by
15 Werner Lemberg <wl@gnu.org> and Bernd Warken <bwarken@mayn.de>.
17 groff is free software; you can redistribute it and/or modify it under
18 the terms of the GNU General Public License as published by the Free
19 Software Foundation; either version 2, or (at your option) any later
22 groff is distributed in the hope that it will be useful, but WITHOUT
23 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 You should have received a copy of the GNU General Public License
28 along with groff; see the file COPYING. If not, write to the Free
29 Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
33 ------------------------------------------------------------------------
35 ------------------------------------------------------------------------
37 A simple set of macros to provide HTML documents with basic
38 www functionality. It should work with any macro set.
41 .\" --------------------------------------------------------------------
43 .\" --------------------------------------------------------------------
45 .do if d www:lenstr .nx
54 .if '\*[.T]'html' .nr www-html 1
56 .\" set up www-image-template
58 .if !d www-image-template \
59 . ds www-image-template
62 . \" remove the title command when we are generating images for html
63 . \" (stops a title accidentally appearing inside an image)
73 .\" --------------------------------------------------------------------
74 .\" Test for `.substring'; result in register `www.substring_ok'.
75 .\" The automated break points in .URL addresses are only added if
76 .\" this register is non-zero.
78 .nr www:substring_ok 0
79 .de www:@test_substring
83 . substring \\$0:s 1 1
84 . if !'\\*[\\$0:s]'b' \{\
89 . substring \\$0:s 0 0
90 . if !'\\*[\\$0:s]'a' \{\
95 . substring \\$0:s 1 -1
96 . if !'\\*[\\$0:s]'bcdefg' \{\
100 . nr www:substring_ok 1
104 .rm www:@test_substring
107 .\" --------------------------------------------------------------------
109 .\" --------------------------------------------------------------------
111 .\" --------------------------------------------------------------------
114 .\" Space before paragraph. Use \n[PD] if it exists.
118 . ie r PD .sp \\n[PD]u
119 . el .sp \\n[www:pd]u
123 .\" --------------------------------------------------------------------
124 .\" www:error (<test>...)
126 .\" Print error message
129 . tm \\n[.F]:\\n[.c]: macro error: \\$*
131 .als www:error www-error
133 .\" --------------------------------------------------------------------
134 .\" www:lenstr (<register_name> <string_name>)
136 .\" Store length of string named <string_name> into register named
140 . if !(\\n[.$] == 2) \{\
141 . tm .\\$0 expects 2 arguments.
144 . length \\$0:n x\\*[\\$2]
145 . nr \\$1 (\\n[\\$0:n]-1)
148 .\" --------------------------------------------------------------------
149 .\" www:splitstr (<name>)
151 .\" Add a space character between any two adjacent characters in string
152 .\" <name> and restore result into the string variable <name>; space
153 .\" characters are first replaced by the word `space'.
156 . if !(\\n[.$] == 1) \
157 . www:error .\\$0 expects 1 argument.
160 . ds \\$0:r "\\*[\\$1]\""
163 . ds \\$0:c "\\*[\\$0:r]\""
164 . substring \\$0:c 0 0\"
165 . ie '\\*[\\$0:c]' ' \
166 . as \\$0:s " space\""
168 . as \\$0:s " \\*[\\$0:c]\""
169 . www:lenstr \\$0:n \\$0:r
170 . if (\\n[\\$0:n] <= 1) \{\
173 . substring \\$0:r 1 -1\"
175 . if !'\\*[\\$0:s]'' \
176 . substring \\$0:s 1 -1
177 . ds \\$1 \\*[\\$0:s]
183 .\" --------------------------------------------------------------------
184 .\" www:url_breaks (<string_name>)
186 .\" Add `\:' (possible break point) within URL strings after `/'.
188 .\" Smart about multiple `/', existing `\:', and space characters;
189 .\" does not set a break point if less than 5 characters would go to
193 . if !(\\n[.$] == 1) \
194 . www:error .\\$0 expects 1 argument.
195 . if !\n[www:substring_ok] \
197 . ds \\$0:s "\\*[\\$1]\""
198 . www:splitstr \\$0:s
199 . www:url_breaks_splitted \\$0:s \\*[\\$0:s]
200 . ds \\$1 "\\*[\\$0:s]\""
203 .\" --------------------------------------------------------------------
204 .\" www:url_breaks_splitted (<result> <char> [<char>...])
206 .\" Add `\:' within URL strings, but arguments are a splitted string.
208 .\" Arguments: >=2: <result> <char> [<char>...]
210 .de www:url_breaks_splitted
211 . nr \\$0:min 5 \" minimal number of characters for next line
213 . www:error .\\$0 expects at least 2 arguments.
218 . while !\\n[\\$0:done] \{\
219 . if (\\n[.$] <= 0) \{\
223 . if '\\$1'space' \{\
228 . if (\\n[.$] < \\n[\\$0:min]) \{\
238 . \" we are at a `/' character
241 . if (\\n[.$] == 0) \{\
247 . if \\n[\\$0:done] \
249 . if (\\n[.$] < \\n[\\$0:min]) \
255 . ds \\*[\\$0:res] \\*[\\$0:s]\"
259 .\" --------------------------------------------------------------------
261 .\" --------------------------------------------------------------------
263 .\" --------------------------------------------------------------------
266 .\" the main auxiliary macro for the HTML interface
269 . if \\n[www-html] \{\
270 . \" was implemented via .nop \&\X^html:\\$*^ but
271 . \" is now implemented using HTML-NS to utilize code factoring.
273 . \" the `\&' makes the vertical mode leave, so to say
281 .\" an auxiliary macro for HTML (without following space)
284 . nop \X^html:\\$*^\c
287 .\" emit a HTML tag after shutting down a (possibly open) paragraph
290 . if \\n[www-html] \{\
291 . \" the `\&' makes the vertical mode leave, so to say
292 . nop \&\X^html</p>:\\$*^
295 .\" --------------------------------------------------------------------
298 .\" Automatic heading level cut off.
300 .\" N is the depth limit of automatically linked headings. So a depth
301 .\" of 2 would cause grohtml to generate a list of links for `.NH 1'
302 .\" and `.NH 2' but not for `.NH 3'.
308 .\" --------------------------------------------------------------------
309 .\" BCL foreground background active not-visited visited
312 . HTML <body text=\\$1 bgcolor=\\$2 link=\\$3 alink=\\$4 vlink=\\$5>
314 .\" --------------------------------------------------------------------
318 . HTML <body background=\\$1>
320 .\" --------------------------------------------------------------------
321 .\" URL url [description] [after]
322 .\" if description is absent then the url becomes the anchor text
327 . www:url_breaks \\$0:adr
329 . ie \\n[www-html] \{\
333 . ds \\$0:after \&\\$3
335 . HTML-NS <a href="\\$1">\\$1</a>
337 . HTML-NS <a href="\\$1">\\$2</a>
338 . nop \\*[\\$0:after]
342 . if !r ps4html .ad l
350 . nop \%\[la]\m[blue]\f[C]\\*[\\$0:adr]\f[]\m[]\[ra]\\$3
352 . nop \%\[la]\f[CB]\\*[\\$0:adr]\f[]\[ra]\\$3
358 . nop \m[blue]\\$2\m[]\\$3
360 . nop \f[B]\\$2\f[]\\$3
364 . nop \m[blue]\\$2\m[] \%\[la]\f[C]\\*[\\$0:adr]\f[]\[ra]\\$3
366 . nop \f[B]\\$2\f[] \%\[la]\f[C]\\*[\\$0:adr]\f[]\[ra]\\$3
373 .\" --------------------------------------------------------------------
374 .\" FTP url description [after]
379 .\" --------------------------------------------------------------------
380 .\" MTO address description [after]
382 .\" ADDRESS is the email address (without the `mailto:' prefix).
384 .\" DESCRIPTION is the optional name. If an empty argument is given,
385 .\" ADDRESS is used instead.
387 .\" AFTER is optional stuff printed immediately after ADDRESS
388 .\" (resp. DESCRIPTION).
392 .\" Foobar has been written by
393 .\" .MTO fred@foo.bar "Fredrick Bloggs" .
396 . ie \\n[www-html] \{\
398 . URL mailto:\\$1 \\$1 "\\$3"
400 . URL mailto:\\$1 "\\$2" "\\$3"
410 . nop \%\m[blue]\f[C]\\$1\f[]\m[]\\$3
412 . nop \%\f[CB]\\$1\f[]\\$3
418 . nop \m[blue]\\$2\m[]\\$3
420 . nop \f[B]\\$2\f[]\\$3
424 . nop \m[blue]\\$2\m[] \%\[la]\f[C]\\$1\f[]\[ra]\\$3
426 . nop \f[B]\\$2\f[] \%\[la]\f[C]\\$1\f[]\[ra]\\$3
431 .\" --------------------------------------------------------------------
434 .\" Generate an html name NAME.
437 . HTML <a name="\\$1"></a>
439 .\" --------------------------------------------------------------------
440 .\" IMG [-R|-L|-C] filename [width] [height]
442 .\" Include an image of any type (will only work for -Thtml).
444 .\" Alignment is centered by default (-C).
445 .\" Default value for WIDTH is 1i.
446 .\" If HEIGHT is not given, WIDTH is used as the height.
449 . ie \\n[www-html] \{\
451 . DEVTAG ".right-image"
454 . DEVTAG ".left-image"
456 . DEVTAG ".centered-image"
461 . nr www-height \\n[www-width]
464 . HTML <img src="\\$1" alt="Image \\$1" \
465 width=\\n[www-width] height=\\n[www-height]>
468 . nop \[la]\f[C]\\$1\f[]\[ra]
470 .\" --------------------------------------------------------------------
471 .\" PIMG [-R|-L|-C] filename [width] [height]
473 .\" Include a png image. It will work for -Tps and -Thtml.
474 .\" The default value for WIDTH and HEIGHT is zero; the default
475 .\" alignment is centering (-C).
477 .\" Note: This macro can only be used with the `-U' option of groff,
478 .\" activating unsafe mode, if not used with -Thtml; the PNG image
479 .\" is then converted to the EPS format using netpbm utilities.
482 . ie \\n[www-html] \{\
484 . DEVTAG ".right-image"
487 . DEVTAG ".left-image"
489 . DEVTAG ".centered-image"
494 . nr www-width (\\$3 * 100 / 240)
496 . nr www-height (\\$4 * 100 / 240)
497 . ie (\\n[www-width] == 0) \{\
498 . ie (\\n[www-height] == 0) \
499 . HTML <img src="\\$2" alt="Image \\$2">
501 . HTML <img src="\\$1" alt="Image \\$2" height=\\n[www-height]>
504 . ie (\\n[www-height] == 0) \
505 . HTML <img src="\\$2" alt="Image \\$2" width=\\n[www-width]>
507 . HTML <img src="\\$2" alt="Image \\$2" width=\\n[www-width] \
508 height=\\n[www-height]>
513 . www-make-unique-name
514 . sy pngtopnm \\$2 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps
516 . PSPIC \\*[www-unique-name].eps \\$3 \\$4
518 . PSPIC \\$1 \\*[www-unique-name].eps \\$3 \\$4
523 .\" --------------------------------------------------------------------
524 .\" auxiliary definitions for MPIMG
526 .nr www-left-ll-trap 0
527 .nr www-left-po-trap 0
528 .nr www-right-ll-trap 0
530 .de www-finish-left-po
531 . po -(\\n[www-left-indent]u + \\n[www-image-gap]u)
532 . wh \\n[www-left-po-trap]u
533 . nr www-left-indent 0
536 .\" called when the -R picture is finished
537 .de www-finish-right-ll
538 . ll +(\\n[www-right-indent]u + \\n[www-image-gap]u)
539 . \" now see whether we need to inline www-finish-left-ll
540 . if (\\n[www-left-ll-trap]u > 0) \
541 . if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-ll-trap]u) \{\
542 . mk www-left-po-trap
543 . nr www-left-po-trap +1v
544 . wh \\n[www-left-po-trap]u www-finish-left-po
545 . ll +\\n[www-left-indent]u
546 . wh \\n[www-left-ll-trap]u
547 . nr www-left-ll-trap 0
549 . \" and see whether we need to inline www-finish-left-po
550 . if (\\n[www-left-po-trap]u > 0) \
551 . if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-po-trap]u) \{\
552 . po -\\n[www-left-indent]u
553 . wh \\n[www-left-po-trap]u
554 . nr www-left-indent 0
556 . wh \\n[www-right-ll-trap]u
557 . nr www-right-ll-trap 0
560 .de www-finish-left-ll
561 . if (\\n[www-right-ll-trap] > 0) \
562 . if ((\\n[www-left-ll-trap] + 1v) >= \\n[www-right-ll-trap]) \{\
563 . ll +\\n[www-right-indent]u
564 . nr www-right-ll-trap 0
566 . mk www-left-po-trap
567 . nr www-left-po-trap +1v
568 . wh \\n[www-left-po-trap]u www-finish-left-po
569 . ll +(\\n[www-left-indent]u + \\n[www-image-gap]u)
570 . wh \\n[www-left-ll-trap]u
571 . nr www-left-ll-trap 0
574 .\" www-handle-percent arg N1 N2 S1
575 .\" arg - input string (number or number%)
576 .\" output parameters:
577 .\" N1 - name of number register 1=absolute 0=percentage
578 .\" N2 - number register name for absolute value
579 .\" S1 - string register name for percentage value
581 .de www-handle-percent
582 . ds www-percent \\$1\"
583 . substring www-percent -1 -1
585 . ie '\\*[www-percent]'%' \{\
587 . substring www-abs 0 -2
589 . nr \\$3 \\*[www-abs]
599 .\" --------------------------------------------------------------------
600 .\" MPIMG [-R|-L] [-G gap] filename [width [height]]
602 .\" Include a png image and wrap text around it. It will work for
603 .\" -Tps and -Thtml. The default value for WIDTH is 1i; default value
604 .\" for HEIGHT is WIDTH; the default alignment is left (-L).
605 .\" -G is used to insert a gap between the text and the image.
606 .\" The height and width can also be given as a percentage.
607 .\" The PostScript device converts the percentage width into an
608 .\" absolute value by using \\n[.l], and the height by using \\n[.p].
611 .\" Note: This macro can only be used with the `-U' option of groff,
612 .\" activating unsafe mode, if not used with -Thtml; the PNG image
613 .\" is then converted to the EPS format using netpbm utilities.
616 .nr www-htmlimage-gap 0
619 . nr www-image-just 1
621 . while (\\n[.$] > 0) \{\
623 . nr www-image-just 1
628 . nr www-image-just 0
633 . nr www-image-gap \\$2
634 . nr www-htmlimage-gap (\\$2 * 100 / 240)
643 . ds www-size-specs "width=\\n[www-width] height=\\n[www-height]\"
645 . nr www-is-absolute 0
647 . ds www-percentage none\"
648 . www-handle-percent \\$2 www-is-absolute www-absolute www-percentage
649 . ie !\\n[www-is-absolute] \{\
650 . \" percentage of linelength requested
651 . nr www-width (\\n[www-absolute] * \\n[.l] / 100)
653 . nr www-width (\\n[www-width] * 100 / 240)
654 . ds www-size-specs "width=\\*[www-percentage]\"
657 . nr www-width \\n[www-absolute]
659 . nr www-width (\\n[www-width] * 100 / 240)
660 . ds www-size-specs "width=\\n[www-width]\"
663 . nr www-height \\n[www-width]
665 . nr www-is-absolute 0
667 . ds www-percentage none\"
668 . www-handle-percent \\$3 www-is-absolute www-absolute www-percentage
669 . ie !\\n[www-is-absolute] \{\
670 . \" percentage of pagelength requested
671 . nr www-height (\\n[www-absolute] * \\n[.p] / 100)
673 . nr www-height (\\n[www-height] * 100 / 240)
674 . ds www-size-specs "\\*[www-size-specs] height=\\*[www-percentage]\"
677 . nr www-height \\n[www-absolute]
679 . nr www-height (\\n[www-height] * 100 / 240)
680 . ds www-size-specs "\\*[www-size-specs] height=\\*[www-height]\"
685 . \" height not specified; use width value
686 . ie !\\n[www-is-absolute] \{\
687 . \" percentage value
688 . ds www-size-specs "\\*[www-size-specs] height=\\*[www-percentage]\"
689 . nr www-height \\n[www-width]
692 . ds www-size-specs "\\*[www-size-specs] height=\\*[www-width]\"
693 . nr www-height \\n[www-width]
697 . ie \\n[www-html] \{\
698 . ie !\\n[www-image-just] \
699 . HTML <img src="\\$1" alt="Image \\$1" hspace=\\n[www-htmlimage-gap] \
700 align=right \\*[www-size-specs]>
702 . HTML <img src="\\$1" alt="Image \\$1" hspace=\\n[www-htmlimage-gap] \
703 align=left \\*[www-size-specs]>
706 . tm www-width is \\n[www-width]
707 . tm www-height is \\n[www-height]
709 . www-make-unique-name
710 . sy pngtopnm \\$1 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps
711 . ie !\\n[www-image-just] \{\
712 . \" we must now disable a possible left image trap
714 . if (\\n[www-left-ll-trap] > 0) \
715 . wh \\n[www-left-ll-trap]u
716 . if (\\n[www-left-po-trap] > 0) \
717 . wh \\n[www-left-po-trap]u
718 . PSPIC -R \\*[www-unique-name].eps \\n[www-width]u \\n[www-height]u
720 . nr www-right-indent \\n[ps-deswid]u
721 . \" we want to have some space between text and image,
722 . \" so the line length must be shorter
723 . ll -(\\n[www-right-indent]u + \\n[www-image-gap]u)
724 . mk www-right-ll-trap
725 . nr www-right-ll-trap +(\\n[ps-desht]u - 1v)
726 . wh \\n[www-right-ll-trap]u www-finish-right-ll
727 . \" now restore possible left trap
728 . if (\\n[www-left-ll-trap] > 0) \
729 . wh \\n[www-left-ll-trap]u www-finish-left-ll
730 . if (\\n[www-left-po-trap] > 0) \
731 . wh \\n[www-left-po-trap]u
734 . \" we must now disable a possible right image trap
735 . if (\\n[www-right-ll-trap] > 0) \
736 . wh \\n[www-right-ll-trap]u
737 . PSPIC -L \\*[www-unique-name].eps \\n[www-width]u \\n[www-height]u
739 . nr www-left-indent \\n[ps-deswid]u
740 . \" increase offset by gap
741 . po +(\\n[www-left-indent]u + \\n[www-image-gap]u)
742 . \" decrease line length by gap
743 . ll -(\\n[www-left-indent]u + \\n[www-image-gap]u)
744 . mk www-left-ll-trap
745 . nr www-left-ll-trap +(\\n[ps-desht]u - 1v)
746 . wh \\n[www-left-ll-trap]u www-finish-left-ll
747 . \" now restore possible right trap
748 . if (\\n[www-right-ll-trap] > 0) \
749 . wh \\n[www-right-ll-trap]u www-finish-right-ll
754 .\" --------------------------------------------------------------------
757 .\" Begin heading. Heading level is N.
763 .\" If your heading contains URL, FTP, MTO macros you might wish to
764 .\" disable automatic links to headings. This can be done via `-P-l'
765 .\" from the command line or by using a cakk to `.HX 0'.
767 .nr www-heading-no -1
771 . nr www-heading-no 1
773 . nr www-heading-no \\$1
774 . DEVTAG-NH \\n[www-heading-no]
778 . if (\\n[www-heading-no] == -1) \
779 . www-error "HnE found without a corresponding HnS"
782 .\" --------------------------------------------------------------------
785 .\" Emit the automatically collected links derived from
786 .\" section/numbered headings at this position.
791 .\" --------------------------------------------------------------------
794 .\" Produce a horizontal line.
799 .\" --------------------------------------------------------------------
802 .\" Suppresses the generation of the top and bottom rules which grohtml
803 .\" emits by default.
806 . DEVTAG ".no-auto-rule"
809 .\" www-end-nowhere - end of input trap called to finish diversion.
812 . if !\\n[www-html] \
816 .\" --------------------------------------------------------------------
819 .\" Generate an HTML title only. This differs from the -ms .TL macro
820 .\" which generates both an HTML title and an H1 heading.
822 .\" This is useful when an author wishes to use a HTML title as search
823 .\" engine fodder but a graphic title in the document.
825 .\" The macro terminates when a space or break is seen (.sp, .br).
829 . if !\\n[www-html] \
831 . it 2 www-end-nowhere
834 .\" --------------------------------------------------------------------
835 .\" auxiliary definitions for lists
837 .ds www-ul-level1 \[bu]\ \ \"
838 .ds www-ul-level2 \[sq]\ \ \"
839 .ds www-ul-level3 \[ci]\ \ \"
842 .ds www-ol-level1 decimal\"
843 .ds www-ol-level2 lower-alpha\"
844 .ds www-ol-level3 lower-roman\"
845 .ds www-ol-tmp 00\ \ \"
857 .\" allow nested lists
860 .nr www-li-indent \n[.i]
872 .\" which macro to use for LI
875 . ds www-level\\n[www-depth] \\$1\"
881 . als LI \\*[www-level\\n[www-depth]]
885 .\" Auxiliary macro for ULS.
887 .de www-push-ul-level
889 . if (\\n[www-ul-level] > 3) \
890 . www-error "ULS: too many levels of indentation (\\n[www-ul-level])"
893 .\" Auxiliary macro for ULE.
896 . if !\\n[www-ul-level] \
897 . www-error "ULE: trying to terminate a list which does not exist"
902 .\" Auxiliary macro for OLS.
904 .de www-push-ol-level
906 . if (\\n[www-ol-level] > 3) \
907 . www-error "OLS: too many levels of indentation (\\n[www-ol-level])"
910 .\" Auxiliary macro for OLE.
913 . if !\\n[www-ol-level] \
914 . www-error "OLE: trying to terminate a list which does not exist"
918 .\" --------------------------------------------------------------------
921 .\" Start an unordered list.
924 . www-push-li www-li-ul
929 . nr www-li-indent +\w'\\*[www-ul-level\\n[www-ul-level]]'u
932 .\" --------------------------------------------------------------------
935 .\" End an unordered list.
941 . nr www-li-indent -\w'\\*[www-ul-level\\n[www-ul-level]]'u
942 . in \\n[www-li-indent]u
947 .\" --------------------------------------------------------------------
950 .\" Start an ordered list.
953 . www-push-li www-li-ol
956 . HTML</p> "<ol style='list-style-type: \\*[www-ol-level\\n[www-ol-level]]'>"
958 . nr www-li-indent +\w'\\*[www-ol-tmp]'u
960 .\" --------------------------------------------------------------------
963 .\" End an ordered list.
969 . nr www-li-indent -\w'\\*[www-ol-tmp]'u
970 . in \\n[www-li-indent]u
971 . nr www-ol-ctr\\n[www-ol-level] 0 1
976 .\" --------------------------------------------------------------------
979 .\" Start a definition list.
982 . www-push-li www-li-dl
987 . nr www-li-indent +\\n[www-dl-shift]u
988 . in \\n[www-li-indent]u
991 .\" --------------------------------------------------------------------
994 .\" End a definition list.
1000 . nr www-li-indent -\\n[www-dl-shift]u
1001 . in \\n[www-li-indent]u
1003 . nr www-dl-level -1
1006 .\" --------------------------------------------------------------------
1009 .\" Insert a list item.
1012 .\" www-li-ul - bulleted list item
1015 . ie \\n[www-html] \
1019 . in \\n[www-li-indent]u
1020 . ti -\w'\\*[www-ul-level\\n[www-ul-level]]'u
1021 . nop \\*[www-ul-level\\n[www-ul-level]]\c
1025 .\" www-li-ol - numbered list item
1028 . ie \\n[www-html] \
1032 . in \\n[www-li-indent]u
1033 . ti -\w'\\n[www-ol-ctr\\n[www-ol-level]]\ \ 'u
1034 . nop \\n+[www-ol-ctr\\n[www-ol-level]]\ \ \c
1038 .\" www-li-dl - definition list item
1041 . ie \\n[www-html] \{\
1042 . HTML "<dt>\\$1</dt>"
1047 . in \\n[www-li-indent]u
1048 . ti -\\n[www-dl-shift]u
1053 .\" --------------------------------------------------------------------
1054 .\" DC l text [color]
1056 .\" L is the letter to be dropped and enlarged.
1058 .\" TEXT is the following text whose height the first letter should not
1061 .\" COLOR is the optional color of the dropped letter (default black).
1064 . ds www-dropcolor black
1066 . ds www-dropcolor \\$3
1067 . ie '\*(.T'html' \{\
1068 . www-make-unique-name
1069 . nr www-drop-width (100u * \\n[.v]u * 3u / \\n[.l]u)
1070 . MPIMG -L \\*[www-unique-name].png "\\n[www-drop-width]%"
1074 . www-make-unique-name
1075 . \" To avoid interferences with another DC macro call which is located
1076 . \" very near to the current one, we draw the glyph on a separate page.
1077 . \" Otherwise it could theoretically happen that the dropped capital
1078 . \" glyphs overlap.
1082 . nop \O[5i\\*[www-unique-name].png]\O[1]
1083 . nop \m[\\*[www-dropcolor]]\s[160]\O[3]\\$1\O[4]
1093 . nr dummy \w'\\$1'u
1094 . nr dcht ((\\n[.v] + \\n[rst]) * \\n[.ps] / \\n[rst])
1095 . char \[dcap] \m[\\*[www-dropcolor]]\s'\\n[dcht]u'\\$1
1096 . nop \v'\\n[.v]u'\\[dcap]\v'-\\n[.v]u'\c
1103 .\" --------------------------------------------------------------------
1104 .\" Setup around HTML-IMAGE and friends
1106 .\" now set up TS, TE, EQ, EN default macros
1108 .do if !d TS .do ds TS HTML-IMAGE
1109 .do if !d TE .do ds TE HTML-IMAGE-END
1110 .do if !d EQ .do ds EQ HTML-IMAGE
1111 .do if !d EN .do ds EN HTML-IMAGE-END
1113 .\" supplementary macros used by other macro sets
1115 .\" here are some tags specially for -Tps or -Thtml when invoked by
1116 .\" pre-html to generate png images from postscript.
1118 .\" --------------------------------------------------------------------
1119 .\" HTML-DO-IMAGE - tells troff to issue an image marker which can be
1120 .\" read back by pre-html
1124 . nop \O[5\\$2\\$1.png]\O[1]\O[3]
1125 . if \\n[www-html] \
1126 . nop \O[5\\$2\\$1.png]\O[0]\O[3]
1128 .\" --------------------------------------------------------------------
1129 .\" HTML-IMAGE-END - terminates an image for html
1133 . nop \O[4]\O[2]\O[0]
1134 . if \\n[www-html] \
1135 . nop \O[4]\O[2]\O[1]
1140 .\" --------------------------------------------------------------------
1141 .\" www-make-unique-name - generates another unique name in string
1142 .\" `www-unique-name'
1144 .de www-make-unique-name
1146 . ds www-unique-name \\*[www-image-template]\\n[www-png-no]
1148 .\" --------------------------------------------------------------------
1149 .\" HTML-IMAGE and friends tell grohtml that this region of text needs
1150 .\" to be rendered as an image.
1153 . \" generates a centered image
1154 . www-make-unique-name
1155 . HTML-DO-IMAGE \\*[www-unique-name] c
1158 .de HTML-IMAGE-RIGHT
1159 . www-make-unique-name
1160 . HTML-DO-IMAGE \\*[www-unique-name] r
1164 . www-make-unique-name
1165 . HTML-DO-IMAGE \\*[www-unique-name] l
1168 .de HTML-IMAGE-INLINE
1169 . www-make-unique-name
1170 . HTML-DO-IMAGE \\*[www-unique-name] i
1173 .\" --------------------------------------------------------------------
1176 .\" Generate multiple output files containing the html.
1177 .\" A file is split whenever a .SH or .NH 1 is encountered.
1178 .\" The argument to JOBNAME is the file stem for future output files.
1181 . DEVTAG .job-name \\$1
1183 .\" --------------------------------------------------------------------
1186 .\" Adds information to the <head> </head> section of the html
1188 .\" --------------------------------------------------------------------
1190 . DEVTAG .head "\\$*"
1192 .\" --------------------------------------------------------------------
1194 .\" --------------------------------------------------------------------
1196 .if \n[www-html] \{\
1202 .\" start of some code
1210 .\" end of some code
1218 .if r ps4html .nop \O[0]
1223 .\" --------------------------------------------------------------------
1225 .\" --------------------------------------------------------------------
1227 .\" Local Variables: