* src/preproc/html/pre-html.cpp (usage): Don't describe options but
[s-roff.git] / tmac / www.tmac
blobc1743193c719dba075fa0321de47a2c38faeaac7
1 .ig
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 ------------------------------------------------------------------------
8     Legalize
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
21 version.
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
26 for more details.
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
31 02110-1301, USA.
34 ------------------------------------------------------------------------
35     Description
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 .\" --------------------------------------------------------------------
45 .\" Setup
46 .\" --------------------------------------------------------------------
48 .do if d www:lenstr .nx
50 .do mso devtag.tmac
52 .nr _C \n(.C
53 .cp 0
56 .nr www-html 0
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
64 .if r ps4html \{\
65 .  \" remove the title command when we are generating images for html
66 .  \" (stops a title accidentally appearing inside an image)
67 .  di www-notitle
68 .  tl ''''
69 .  di
70 .  rm tl
71 .  de tl
72 .  .
73 .\}
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.
80 .\"
81 .nr www:substring_ok 0
82 .de www:@test_substring
83 .  if !d substring \
84 .    return
85 .  ds \\$0:s abcdefg\"
86 .  substring \\$0:s 1 1
87 .  if !'\\*[\\$0:s]'b' \{\
88 .    rm \\$0:s
89 .    return
90 .  \}
91 .  ds \\$0:s abcdefg\"
92 .  substring \\$0:s 0 0
93 .  if !'\\*[\\$0:s]'a' \{\
94 .    rm \\$0:s
95 .    return
96 .  \}
97 .  ds \\$0:s abcdefg\"
98 .  substring \\$0:s 1 -1
99 .  if !'\\*[\\$0:s]'bcdefg' \{\
100 .    rm \\$0:s
101 .    return
102 .  \}
103 .  nr www:substring_ok 1
104 .  rm \\$0:s
106 .www:@test_substring
107 .rm www:@test_substring
110 .\" --------------------------------------------------------------------
111 .\" Local Macros
112 .\" --------------------------------------------------------------------
114 .\" --------------------------------------------------------------------
115 .\" www:paraspace
117 .\" Space before paragraph. Use \n[PD] if it exists.
119 .nr www:pd 0.5v
120 .de www:paraspace
121 .  ie r PD .sp \\n[PD]u
122 .  el .sp \\n[www:pd]u
125 .\" --------------------------------------------------------------------
126 .\" www:error (<test>...)
128 .\" Print error message
130 .de www-error
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
139 .\" <register_name>.
141 .de www:lenstr
142 .  if !(\\n[.$] == 2) \{\
143 .    tm .\\$0 expects 2 arguments.
144 .    ab
145 .  \}
146 .  length \\$0:n x\\*[\\$2]
147 .  nr \\$1 (\\n[\\$0:n]-1)
148 .  rr \\$0:n
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'.
158 .de www:splitstr
159 .  if !(\\n[.$] == 1) \
160 .    www:error .\\$0 expects 1 argument.
161 .  if '\\*[\\$1]'' \
162 .    return
163 .  ds \\$0:r "\\*[\\$1]\""
164 .  ds \\$0:s\"
165 .  while 1 \{\
166 .    ds \\$0:c "\\*[\\$0:r]\""
167 .    substring \\$0:c 0 0\"
168 .    ie '\\*[\\$0:c]' ' \
169 .      as \\$0:s " space\""
170 .    el \
171 .      as \\$0:s " \\*[\\$0:c]\""
172 .    www:lenstr \\$0:n \\$0:r
173 .    if (\\n[\\$0:n] <= 1) \{\
174 .      break
175 .    \}
176 .    substring \\$0:r 1 -1\"
177 .  \}
178 .  if !'\\*[\\$0:s]'' \
179 .    substring \\$0:s 1 -1 
180 .  ds \\$1 \\*[\\$0:s]\"
181 .  rm \\$0:c
182 .  rr \\$0:n
183 .  rm \\$0:r
184 .  rm \\$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
194 .\" the next line.
196 .de www:url_breaks
197 .  if !(\\n[.$] == 1) \
198 .    www:error .\\$0 expects 1 argument.
199 .  if !\n[www:substring_ok] \
200 .    return
201 .  ds \\$0:s "\\*[\\$1]\""
202 .  www:splitstr \\$0:s
203 .  www:url_breaks_splitted \\$0:s \\*[\\$0:s]
204 .  ds \\$1 "\\*[\\$0:s]\""
205 .  rm \\$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
217 .  if (\\n[.$] < 2) \
218 .    www:error .\\$0 expects at least 2 arguments.
219 .  ds \\$0:res \\$1\"
220 .  shift
221 .  ds \\$0:s\"
222 .  nr \\$0:done 0
223 .  while !\\n[\\$0:done] \{\
224 .    if (\\n[.$] <= 0) \{\
225 .      nr \\$0:done 1
226 .      break
227 .    \}
228 .    if '\\$1'space' \{\
229 .      as \\$0:s " \""
230 .      shift
231 .      continue
232 .    \}
233 .    if (\\n[.$] < \\n[\\$0:min]) \{\
234 .      as \\$0:s "\\$1\""
235 .      shift
236 .      continue
237 .    \}
238 .    if !'\\$1'/' \{\
239 .      as \\$0:s "\\$1\""
240 .      shift
241 .      continue
242 .    \}
243 .    \" we are at a `/' character
244 .    while '\\$1'/' \{\
245 .      as \\$0:s /\"
246 .      if (\\n[.$] == 0) \{\
247 .        nr \\$0:done 1
248 .        break
249 .      \}
250 .      shift
251 .    \}
252 .    if \\n[\\$0:done] \
253 .      break
254 .    if (\\n[.$] < \\n[\\$0:min]) \
255 .      continue
256 .    if '\\$1'\:' \
257 .      shift
258 .    as \\$0:s \:\"
259 .  \}
260 .  ds \\*[\\$0:res] \\*[\\$0:s]\"
261 .  rm \\$0:res
262 .  rm \\$0:s
266 .\" --------------------------------------------------------------------
267 .\" User Interface
268 .\" --------------------------------------------------------------------
270 .\" --------------------------------------------------------------------
271 .\" HTML
273 .\" the main auxiliary macro for the HTML interface
275 .de HTML
276 .  if \\n[www-html] \{\
277 .    \" was implemented via .nop \&\X^html:\\$*^ but
278 .    \" is now implemented using HTML-NS to utilize code factoring.
279 .    \"
280 .    \" the `\&' makes the vertical mode leave, so to say
281 .    \"
282 .    nop \&\c
283 .    HTML-NS \\$*
284 .    nop \&
285 .  \}
289 .\" an auxiliary macro for HTML (without following space)
291 .de HTML-NS
292 .  nop \X^html:\\$*^\c
296 .\" emit a HTML tag after shutting down a (possibly open) paragraph
298 .de HTML</p>
299 .  if \\n[www-html] \{\
300 .    \" the `\&' makes the vertical mode leave, so to say
301 .    nop \&\X^html</p>:\\$*^
302 .  \}
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.
311 .de HTML<?p>
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.
321 .de MATH<?p>
322 .  if \\n[www-html] .nop \&\X^math<?p>:\\$*^
325 .\" --------------------------------------------------------------------
326 .\" HX n
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'.
334 .de HX
335 .  if \\n[www-html] \
336 .    nop \X^index:\\$*^
339 .\" --------------------------------------------------------------------
340 .\" BCL foreground background active not-visited visited
342 .de BCL
343 .  HTML <body text=\\$1 \
344               bgcolor=\\$2 \
345               link=\\$3 \
346               alink=\\$4 \
347               vlink=\\$5>
350 .\" --------------------------------------------------------------------
351 .\" BGIMG imagefile
353 .de BGIMG
354 .  HTML <body background=\\$1>
357 .\" --------------------------------------------------------------------
358 .\" URL url [description] [after]
359 .\"     if description is absent then the url becomes the anchor text
361 .de URL
362 .  ie !'\\$1'' \{\
363 .    ds \\$0:adr \\$1\"
364 .    www:url_breaks \\$0:adr
365 .  \}
366 .  ie \\n[www-html] \{\
367 .    ie '\\$3'' \
368 .      ds \\$0:after \&\"
369 .    el \
370 .      ds \\$0:after \&\\$3\"
371 .    ie '\\$2'' \
372 .       HTML-NS <a "href=""\\$1"">\\$1</a>"
373 .    el \
374 .       HTML-NS <a "href=""\\$1"">\\$2</a>"
375 .    nop \\*[\\$0:after]
376 .    rm \\$0:after
377 .  \}
378 .  el \{\
379 .    if !r ps4html .ad l
380 .    ie '\\$2'' \{\
381 .      ie '\\$1'' \{\
382 .        ie !'\\$3'' \
383 .          nop \\$3
384 .      \}
385 .      el \{\
386 .        ie \\n[.color] \
387 .          nop \%\\*[www:open]\m[\\*[www:color]]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\m[]\\*[www:close]\\$3
388 .        el \
389 .          nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\\*[www:close]\\$3
390 .      \}
391 .    \}
392 .    el \{\
393 .      ie '\\$1'' \{\
394 .        ie \\n[.color] \
395 .          nop \m[\\*[www:color]]\\$2\m[]\\$3
396 .        el \
397 .          nop \f[\\*[www:fontstyle]]\\$2\f[]\\$3
398 .      \}
399 .      el \{\
400 .        ie \\n[.color] \{\
401 .          nop \m[\\*[www:color]]\\$2\m[]
402 .          nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\\*[www:close]\\$3
403 .        \}
404 .        el \{\
405 .          nop \f[\\*[www:fontstyle]]\\$2\f[]
406 .          nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\*[\\$0:adr]\f[]\\*[www:close]\\$3
407 .        \}
408 .      \}
409 .    \}
410 .    if !r ps4html .ad
411 .  \}
412 .  rm \\$0:adr
415 .\" --------------------------------------------------------------------
416 .\" FTP url description [after]
418 .\"   Same as URL.
420 .als FTP URL
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).
433 .\"     Example:
435 .\"       Foobar has been written by
436 .\"       .MTO fred@foo.bar "Fredrick Bloggs" .
438 .de MTO
439 .  ie \\n[www-html] \{\
440 .    ie '\\$2'' \
441 .      URL mailto:\\$1 \\$1 "\\$3"
442 .    el \
443 .      URL mailto:\\$1 "\\$2" "\\$3"
444 .  \}
445 .  el \{\
446 .    ie '\\$2'' \{\
447 .      ie '\\$1'' \{\
448 .        ie !'\\$3'' \
449 .          nop \\$3
450 .      \}
451 .      el \{\
452 .        ie \\n[.color] \
453 .          nop \%\m[\\*[www:color]]\f[\\*[www:fontstyle]]\\$1\f[]\m[]\\$3
454 .        el \
455 .          nop \%\f[\\*[www:fontstyle]]\\$1\f[]\\$3
456 .      \}
457 .    \}
458 .    el \{\
459 .      ie '\\$1'' \{\
460 .        ie \\n[.color] \
461 .          nop \m[\\*[www:color]]\\$2\m[]\\$3
462 .        el \
463 .          nop \f[\\*[www:fontstyle]]\\$2\f[]\\$3
464 .      \}
465 .      el \{\
466 .        ie \\n[.color] \{\
467 .          nop \m[\\*[www:color]]\\$2\m[]
468 .          nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\$1\f[]\\*[www:close]\\$3
469 .        \}
470 .        el \{\
471 .          nop \f[\\*[www:fontstyle]]\\$2\f[]
472 .          nop \%\\*[www:open]\f[\\*[www:fontstyle]]\\$1\f[]\\*[www:close]\\$3
473 .        \}
474 .      \}
475 .    \}
476 .  \}
479 .\" --------------------------------------------------------------------
480 .\" TAG name
482 .\"   Generate an html name NAME.
484 .de TAG
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.
497 .de IMG
498 .  ie \\n[www-html] \{\
499 .    ie '\\$2'-R' \
500 .      DEVTAG .right-image
501 .    el \{\
502 .      ie '\\$2'-L' \
503 .        DEVTAG .left-image
504 .      el \
505 .        DEVTAG .centered-image
506 .    \}
507 .    nr www-width 100
508 .    if !'\\$3'' \
509 .      nr www-width \\$3
510 .    nr www-height \\n[www-width]
511 .    if !'\\$4'' \
512 .      nr www-height \\$4
513 .    HTML <img src="\\$1" alt="Image \\$1" \
514            "width=""\\n[www-width]""" \
515            "height=""\\n[www-height]"""></img>
516 .  \}
517 .  el \
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.
532 .de PIMG
533 .  ds www-pic-align -C\"
534 .  ie '\\$1'-R' \{\
535 .    ds www-pic-align -R\"
536 .    shift
537 .  \}
538 .  el \{\
539 .    ie '\\$1'-L' \{\
540 .      ds www-pic-align -L\"
541 .      shift
542 .    \}
543 .  \}
544 .  if '\\$1'-C' \
545 .    shift
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\"
553 .    nr www-width 0
554 .    nr www-height 0
555 .    if !'\\$2'' \
556 .      nr www-width (\\$3 * 100 / 240)
557 .    if !'\\$3'' \
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>"
563 .      el \
564 .        HTML</p> <p \\*[www-htmlalign]><img "src=""\\$1""" \
565                                              "alt=""Image \\$1""" \
566                                              "height=""\\n[www-height]"""></img></p>
567 .    \}
568 .    el \{\
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>
573 .      el \
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>
578 .    \}
579 .  \}
580 .  el \{\
581 .    if !r ps4html \{\
582 .      www-make-unique-name
583 .      sy pngtopnm \\$1 \
584           | pnmcrop -white \
585           | @PNMTOPS_NOSETPAGE@ -noturn \
586           > \\*[www-unique-name].eps
587 .      shift
588 .      PSPIC \\*[www-pic-align] \\*[www-unique-name].eps \\$*
589 .    \}
590 .  \}
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
618 .    \}
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
625 .    \}
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
635 .    \}
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]'%' \{\
656 .    ds www-abs \\$1\"
657 .    substring www-abs 0 -2
658 .    nr \\$2 0
659 .    nr \\$3 \\*[www-abs]
660 .    ds \\$4 \\$1\"
661 .  \}
662 .  el \{\
663 .    nr \\$2 1
664 .    nr \\$3 \\$1
665 .    ds \\$4 none\"
666 .  \}
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].
679 .\"   
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
687 .de MPIMG
688 .  nr www-image-just 1
689 .  nr www-image-gap 0
690 .  while (\\n[.$] > 0) \{\
691 .    if '-L'\\$1' \{\
692 .      nr www-image-just 1
693 .      shift
694 .      continue
695 .    \}
696 .    if '-R'\\$1' \{\
697 .      nr www-image-just 0
698 .      shift
699 .      continue
700 .    \}
701 .    if '-G'\\$1' \{\
702 .      nr www-image-gap \\$2
703 .      nr www-htmlimage-gap (\\$2 * 100 / 240)
704 .      shift 2
705 .      continue
706 .    \}
707 .    break
708 .  \}
710 .  nr www-width 1i
711 .  nr www-height 1i
712 .  ds www-size-specs width=""\\n[www-width]" height="\\n[www-height]"
713 .  ie !'\\$2'' \{\
714 .    nr www-is-absolute 0
715 .    nr www-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)
721 .      if \\n[www-html] \
722 .        nr www-width (\\n[www-width] * 100 / 240)
723 .      ds www-size-specs width=\"\\*[www-percentage]"
724 .    \}
725 .    el \{\
726 .      nr www-width \\n[www-absolute]
727 .      if \\n[www-html] \
728 .        nr www-width (\\n[www-width] * 100 / 240)
729 .      ds www-size-specs width=\"\\n[www-width]"
730 .    \}
732 .    nr www-height \\n[www-width]
733 .    ie !'\\$3'' \{\
734 .      nr www-is-absolute 0
735 .      nr www-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)
741 .        if \\n[www-html] \
742 .           nr www-height (\\n[www-height] * 100 / 240)
743 .        ds www-size-specs "\\*[www-size-specs] height="\\*[www-percentage]"
744 .      \}
745 .      el \{\
746 .        nr www-height \\n[www-absolute]
747 .        if \\n[www-html] \
748 .           nr www-height (\\n[www-height] * 100 / 240)
749 .        ds www-size-specs "\\*[www-size-specs] "height="\\*[www-height]"
750 .      \}
751 .    \}
752 .  \}
753 .  el \{\
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]
759 .    \}
760 .    el \{\
761 .       ds www-size-specs "\\*[www-size-specs] "height="\\*[www-width]"
762 .       nr www-height \\n[www-width]
763 .    \}
764 .  \}
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>
772 .    el \
773 .      HTML <img "src=""\\$1""" \
774                  "alt=""Image \\$1""" \
775                  "hspace=""\\n[www-htmlimage-gap]""" \
776                  "align=""left"" \\*[www-size-specs]"""></img>
777 .  \}
778 .  el \{\
779 .    tm www-width is \\n[www-width]
780 .    tm www-height is \\n[www-height]
781 .    if !r ps4html \{\
782 .      www-make-unique-name
783 .      sy pngtopnm \\$1 \
784           | pnmcrop -white \
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
789 .        sp -1
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
795 .        sp -\\n[ps-desht]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
808 .      \}
809 .      el \{\
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
814 .        sp -\\n[ps-desht]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
826 .      \}
827 .    \}
828 .  \}
831 .\" --------------------------------------------------------------------
832 .\" HnS n
834 .\"   Begin heading.  Heading level is N.
836 .\" HnE
838 .\"   End heading.
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
846 .de HnS
847 .  ie '\\$1'' \
848 .    nr www-heading-no 1
849 .  el \
850 .    nr www-heading-no \\$1
851 .  DEVTAG-NH \\n[www-heading-no]
854 .de HnE
855 .  if (\\n[www-heading-no] == -1) \
856 .    www-error HnE found without a corresponding HnS
857 .  DEVTAG-EO-H
860 .\" --------------------------------------------------------------------
861 .\" LK
863 .\"   Emit the automatically collected links derived from
864 .\"   section/numbered headings at this position.
866 .de LK
867 .  DEVTAG .links
870 .\" --------------------------------------------------------------------
871 .\" HR
873 .\"   Produce a horizontal line.
875 .de HR
876 .  HTML</p> <hr></hr>
879 .\" --------------------------------------------------------------------
880 .\" NHR
882 .\"  Suppresses the generation of the top and bottom rules which grohtml
883 .\"  emits by default.
885 .de NHR
886 .  DEVTAG .no-auto-rule
890 .\" www-end-nowhere - end of input trap called to finish diversion.
892 .de www-end-nowhere
893 .  if !\\n[www-html] \
894 .    di
895 .  DEVTAG-EO-TL
898 .\" --------------------------------------------------------------------
899 .\" HTL
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).
909 .de HTL
910 .  DEVTAG .html-tl
911 .  if !\\n[www-html] \
912 .    di www-nowhere
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]\ \ \"
922 .nr www-ul-level 0
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\ \ \"
928 .nr www-ol-ctr1 0 1
929 .nr www-ol-ctr2 0 1
930 .nr www-ol-ctr3 0 1
931 .af www-ol-ctr2 a
932 .af www-ol-ctr3 i
933 .nr www-ol-level 0
935 .nr www-dl-level 0
936 .nr www-dl-shift 5n
939 .\" allow nested lists
941 .nr www-depth 0
942 .nr www-li-indent \n[.i]
943 .ds www-level0 nop\"
944 .ds www-level1
945 .ds www-level2
946 .ds www-level3
947 .ds www-level4
948 .ds www-level5
949 .ds www-level6
950 .ds www-level7
951 .ds www-level8
952 .ds www-level9
954 .\" which macro to use for LI
955 .de www-push-li
956 .  nr www-depth +1
957 .  ds www-level\\n[www-depth] \\$1\"
958 .  ds www-ltag\\n[www-depth]
959 .  als LI \\$1
962 .de www-pop-li
963 .  nr www-depth -1
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.
971 .de www-emit-ltag
972 .  if !'\\*[www-ltag\\n[www-depth]]'' \
973 .    HTML-NS </\\*[www-ltag\\n[www-depth]]>
974 .  if !'\\$1'' \
975 .    HTML-NS <\\$1>
976 .  ds www-ltag\\n[www-depth] \\$1
980 .\" Auxiliary macro for ULS.
982 .de www-push-ul-level
983 .  nr www-ul-level +1
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.
990 .de www-pop-ul-level
991 .  if !\\n[www-ul-level] \
992 .    www-error ULE: trying to terminate a list which does not exist
993 .  nr www-ul-level -1
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 .\" --------------------------------------------------------------------
1015 .\" ULS
1017 .\"   Start an unordered list.
1019 .de ULS
1020 .  www-push-li www-li-ul
1021 .  www-push-ul-level
1022 .  ie \\n[www-html] \{\
1023 .    www-emit-ltag
1024 .    HTML</p> <ul>
1025 .  \}
1026 .  el \
1027 .    nr www-li-indent +\w'\\*[www-ul-level\\n[www-ul-level]]'u
1030 .\" --------------------------------------------------------------------
1031 .\" ULE
1033 .\"   End an unordered list.
1035 .de ULE
1036 .  ie \\n[www-html] \{\
1037 .    www-emit-ltag
1038 .    HTML</p> </ul>
1039 .  \}
1040 .  el \{\
1041 .    nr www-li-indent -\w'\\*[www-ul-level\\n[www-ul-level]]'u
1042 .    in \\n[www-li-indent]u
1043 .  \}
1044 .  www-pop-ul-level
1045 .  www-pop-li
1048 .\" --------------------------------------------------------------------
1049 .\" OLS
1051 .\"   Start an ordered list.
1053 .de OLS
1054 .  www-push-li www-li-ol
1055 .  www-push-ol-level
1056 .  ie \\n[www-html] \{\
1057 .    www-emit-ltag
1058 .    HTML</p> <ol "style=""list-style-type:" \
1059                            "\\*[www-ol-level\\n[www-ol-level]]"">"
1060 .  \}
1061 .  el \
1062 .    nr www-li-indent +\w'\\*[www-ol-tmp]'u
1065 .\" --------------------------------------------------------------------
1066 .\" OLE
1068 .\"   End an ordered list.
1070 .de OLE
1071 .  ie \\n[www-html] \{\
1072 .    www-emit-ltag
1073 .    HTML </ol>
1074 .  \}
1075 .  el \{\
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
1079 .  \}
1080 .  www-pop-ol-level
1081 .  www-pop-li
1084 .\" --------------------------------------------------------------------
1086 .\" DLS
1087 .\"   Start a definition list.
1089 .de DLS
1090 .  www-push-li www-li-dl
1091 .  nr www-dl-level +1
1092 .  ie \\n[www-html] \{\
1093 .    www-emit-ltag
1094 .    HTML</p> <dl>
1095 .  \}
1096 .  el \{\
1097 .    nr www-li-indent +\\n[www-dl-shift]u
1098 .    in \\n[www-li-indent]u
1099 .  \}
1102 .\" --------------------------------------------------------------------
1104 .\" DLE
1105 .\"   End a definition list.
1107 .de DLE
1108 .  ie \\n[www-html] \{\
1109 .    www-emit-ltag
1110 .    HTML </dl>
1111 .  \}
1112 .  el \{\
1113 .    nr www-li-indent -\\n[www-dl-shift]u
1114 .    in \\n[www-li-indent]u
1115 .  \}
1116 .  nr www-dl-level -1
1117 .  www-pop-li
1120 .\" --------------------------------------------------------------------
1121 .\" LI
1123 .\"   Insert a list item.
1125 .\" ********
1126 .\" www-li-ul - bulleted list item
1128 .de www-li-ul
1129 .  ie \\n[www-html] \
1130 .    www-emit-ltag li
1131 .  el \{\
1132 .    www:paraspace
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
1136 .  \}
1139 .\" ********
1140 .\" www-li-ol - numbered list item
1142 .de www-li-ol
1143 .  ie \\n[www-html] \
1144 .    www-emit-ltag li
1145 .  el \{\
1146 .    www:paraspace
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
1150 .  \}
1153 .\" ********
1154 .\" www-li-dl - definition list item
1156 .de www-li-dl
1157 .  ie \\n[www-html] \{\
1158 .    HTML <dt>\\$1</dt>
1159 .    www-emit-ltag dd
1160 .  \}
1161 .  el \{\
1162 .    www:paraspace
1163 .    in \\n[www-li-indent]u
1164 .    ti -\\n[www-dl-shift]u
1165 .    nop \&\\$1
1166 .    br
1167 .  \}
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
1176 .\"   exceed.
1178 .\"   COLOR is the optional color of the dropped letter (default black).
1180 .de DC
1181 .  ds www-dropcolor black\"
1182 .  if !'\\$3'' \
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]%
1188 .  \}
1189 .  el \{\
1190 .    ie r ps4html \{\
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.
1196 .      bp
1197 .      ev www-DC
1198 .      vs 320p
1199 .      nop \O[5i\\*[www-unique-name].png]\O[1]
1200 .      nop \m[\\*[www-dropcolor]]\s[160]\O[3]\\$1\O[4]
1201 .      nop \O[2]\O[0]
1202 .      br
1203 .      ev
1204 .      bp
1205 .    \}
1206 .    el \{\
1207 .      ie n \
1208 .        nop \\$1\c
1209 .      el \{\
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
1214 '        ti \w'\\[dcap]'u
1215 .      \}
1216 .    \}
1217 .  \}
1218 .  nop \\$2
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
1241 .de HTML-DO-IMAGE
1242 .  if r ps4html \
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
1251 .de HTML-IMAGE-END
1252 .  if r ps4html \
1253 .    nop \O[4]\O[2]\O[0]
1254 .  if \\n[www-html] \
1255 .    nop \O[4]\O[2]\O[1]
1258 .nr www-png-no 0
1260 .\" --------------------------------------------------------------------
1261 .\" www-make-unique-name - generates another unique name in string
1262 .\"                        `www-unique-name'
1264 .de www-make-unique-name
1265 .  nr www-png-no +1
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.
1273 .de HTML-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
1284 .de HTML-IMAGE-LEFT
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).
1298 .de EQN-HTML-IMAGE
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
1323 .  ie r xhtml \{\
1324 .    if !(\\n[.O] == 0) \{\
1325 .      if r ps4html \
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]
1329 .    \}
1330 .  \}
1331 .  el .HTML-DO-IMAGE \\$*
1334 .\" --------------------------------------------------------------------
1335 .\" EQN-HTML-IMAGE-END - terminates an image for html
1337 .de EQN-HTML-IMAGE-END
1338 .  ie r xhtml \{\
1339 .    if !(\\n[.O] == 0) \{\
1340 .      if r ps4html \
1341 .        nop \O[4]\O[2]\O[0]
1342 .      if \\n[www-html] \
1343 .        nop \O[4]\O[2]\O[1]
1344 .    \}
1345 .  \}
1346 .  el .HTML-IMAGE-END
1349 .\" --------------------------------------------------------------------
1350 .\" JOBNAME
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.
1356 .de JOBNAME
1357 .  DEVTAG .job-name \\$1
1360 .\" --------------------------------------------------------------------
1361 .\" HEAD
1363 .\"   Adds information to the <head> </head> section of the html
1364 .\"   document
1365 .\" --------------------------------------------------------------------
1366 .de HEAD
1367 .  DEVTAG .head "\\$*"
1370 .\" --------------------------------------------------------------------
1371 .\" start of some code
1373 .de CDS
1374 .  ft C
1375 .  nf
1378 .\" --------------------------------------------------------------------
1379 .\" end of some code
1381 .de CDE
1382 .  fi
1383 .  ft P
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
1393 .de LNS
1394 .  HTML</p> <table><tr><td valign=top \
1395                            width=\\n[www-nav-width-left]% \
1396                            "bgcolor=""\\*[www-nav-colour]"">"
1397 .  LK
1398 .  HTML</p> </td><td valign=top \
1399                      width=\\n[www-nav-width-right]%>
1400 .  nr SH-open 1
1403 .\" --------------------------------------------------------------------
1404 .\" LNE - left navigation end
1406 .de LNE
1407 .  HTML</p> </td></tr></table>
1408 .  HR
1411 .nr SH-open 0
1412 .nr needs-begin 0
1415 .\" some auxiliary macros for left navigation lists
1417 .de www-SH
1418 .  if (0\\$1 == 0) \{\
1419 .    if (\\n[SH-open] == 1) \
1420 .      LNE
1421 .    nr needs-begin 1
1422 .    @SH-old
1423 .  \}
1426 .de www-NH
1427 .  if (0\\$1 <= 1) \{\
1428 .    if (\\n[SH-open] == 1) \
1429 .      LNE
1430 .    nr needs-begin 1
1431 .    @NH-old
1432 .  \}
1435 .de www-LP
1436 .  @LP-old
1437 .  if (\\n[needs-begin] == 1) \{\
1438 .    HR
1439 .    LNS
1440 .  \}
1441 .  nr needs-begin 0
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.
1452 .de ALN
1453 .  if '\*[.T]'html' \{\
1454 .    if !'\\$1'' \
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)
1459 .    \}
1460 .    rn @SH @SH-old
1461 .    rn www-SH @SH
1462 .    rn @NH @NH-old
1463 .    rn www-NH @NH
1464 .    rn @LP @LP-old
1465 .    rn www-LP @LP
1466 .  \}
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.
1474 .\"    For example:
1476 .\"    LINKSTYLE blue CR < >
1478 .de LINKSTYLE
1479 .  if (\\n[.$] < 1) \
1480 .    www:error .\\$0 expects at least 1 argument.
1481 .  ds www:color \\$1\"
1482 .  shift
1483 .  if (\\n[.$] < 1) \
1484 .    return
1485 .  ds www:fontstyle \\$1\"
1486 .  shift
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
1494 .\"          driver
1496 .de MATHML
1497 .  if (\\n[.O] == 0) .MATH<?p> \\$*
1500 .\" --------------------------------------------------------------------
1501 .\" Final Setup
1502 .\" --------------------------------------------------------------------
1504 .LINKSTYLE blue C \[la] \[ra]
1506 .if \n[www-html] \{\
1507 .  nh
1508 .  nr HY 0
1511 .if r ps4html .nop \O[0]
1512 .cp \n(_C
1514 .\" now set
1516 .\" --------------------------------------------------------------------
1517 .\" Emacs settings
1518 .\" --------------------------------------------------------------------
1520 .\" Local Variables:
1521 .\" mode: nroff
1522 .\" End:
1523 .\" EOF