summaryrefslogtreecommitdiff
path: root/tmac/www.tmac
blob: 90bd1f4e44a87610a4b0b03cc97219777d4746e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
.ig
www.tmac - macro package for adding HTML elements to roff documents.

File position: <groff_source_top>/tmac/www.tmac
Installed position: groff's main macro directory.

------------------------------------------------------------------------
    Legalize
------------------------------------------------------------------------

This file is part of groff, the GNU roff type-setting system.

Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
written by Gaius Mulley <gaius@glam.ac.uk>, with additions by
Werner Lemberg <wl@gnu.org> and Bernd Warken <bwarken@mayn.de>.

groff is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.

groff is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with groff; see the file COPYING.  If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.


------------------------------------------------------------------------
    Description
------------------------------------------------------------------------

A simple set of macros to provide HTML documents with basic
www functionality.  It should work with any macro set.
..
.
.\" --------------------------------------------------------------------
.\" Setup
.\" --------------------------------------------------------------------
.
.nr _C \n(.C
.cp 0
.
.mso devtag.tmac
.
.nr www-html 0
.if '\*[.T]'html' .nr www-html 1
.
.\" set up www-image-template
.
.if !d www-image-template \
.  ds www-image-template
.
.if r ps4html \{\
.  \" remove the title command when we are generating images for html
.  \" (stops a title accidentally appearing inside an image)
.  di www-notitle
.  tl ''''
.  di
.  rm tl
.  de tl
.  .
.\}
.
.
.\" --------------------------------------------------------------------
.\" Test for `.substring'; result in register `www.substring_ok'.
.\" The automated break points in .URL addresses are only added if
.\" this register is non-zero.
.\"
.nr www:substring_ok 0
.de www:@test_substring
.  if !d substring \
.    return
.  ds \\$0:s abcdefg\"
.  substring \\$0:s 1 1
.  if !'\\*[\\$0:s]'b' \{\
.    rm \\$0:s
.    return
.  \}
.  ds \\$0:s abcdefg\"
.  substring \\$0:s 0 0
.  if !'\\*[\\$0:s]'a' \{\
.    rm \\$0:s
.    return
.  \}
.  ds \\$0:s abcdefg\"
.  substring \\$0:s 1 -1
.  if !'\\*[\\$0:s]'bcdefg' \{\
.    rm \\$0:s
.    return
.  \}
.  nr www:substring_ok 1
.  rm \\$0:s
..
.www:@test_substring
.rm www:@test_substring
.
.
.\" --------------------------------------------------------------------
.\" Local Macros
.\" --------------------------------------------------------------------
.
.\" --------------------------------------------------------------------
.\" www:paraspace
.\"
.\" Space before paragraph. Use \n[PD] if it exists.
.\"
.nr www:pd 0.5v
.de www:paraspace
.  ie r PD .sp \\n[PD]u
.  el .sp \\n[www:pd]u
..
.
.\"
.\" --------------------------------------------------------------------
.\" www:error (<test>...)
.\"
.\" Print error message
.\"
.de www-error
.  tm \\n[.F]:\\n[.c]: macro error: \\$*
..
.als www:error www-error
.
.\" --------------------------------------------------------------------
.\" www:lenstr (<register_name> <string_name>)
.\"
.\" Store length of string named <string_name> into register named
.\" <register_name>.
.\"
.de www:lenstr
.  if !(\\n[.$] == 2) \{\
.    tm .\\$0 expects 2 arguments.
.    ab
.  \}
.  length \\$0:n x\\*[\\$2]
.  nr \\$1 (\\n[\\$0:n]-1)
.  rr \\$0:n
..
.\" --------------------------------------------------------------------
.\" www:splitstr (<name>)
.\"
.\" Add a space character between any two adjacent characters in string
.\" <name> and restore result into the string variable <name>; space
.\" characters are first replaced by the word `space'.
.\"
.de www:splitstr
.  if !(\\n[.$] == 1) \
.    www:error .\\$0 expects 1 argument.
.  if '\\*[\\$1]'' \
.    return
.  ds \\$0:r "\\*[\\$1]\""
.  ds \\$0:s\"
.  while 1 \{\
.    ds \\$0:c "\\*[\\$0:r]\""
.    substring \\$0:c 0 0\"
.    ie '\\*[\\$0:c]' ' \
.      as \\$0:s " space\""
.    el \
.      as \\$0:s " \\*[\\$0:c]\""
.    www:lenstr \\$0:n \\$0:r
.    if (\\n[\\$0:n] <= 1) \{\
.      break
.    \}
.    substring \\$0:r 1 -1\"
.  \}
.  if !'\\*[\\$0:s]'' \
.    substring \\$0:s 1 -1 
.  ds \\$1 \\*[\\$0:s]
.  rm \\$0:c
.  rr \\$0:n
.  rm \\$0:r
.  rm \\$0:s
..
.\" --------------------------------------------------------------------
.\" www:url_breaks (<string_name>)
.\"
.\" Add `\:' (possible break point) within URL strings after `/'.
.\"
.\" Smart about multiple `/', existing `\:', and space characters;
.\" does not set a break point if less than 5 characters would go to
.\" the next line.
.\"
.de www:url_breaks
.  if !(\\n[.$] == 1) \
.    www:error .\\$0 expects 1 argument.
.  if !\n[www:substring_ok] \
.    return
.  ds \\$0:s "\\*[\\$1]\""
.  www:splitstr \\$0:s
.  www:url_breaks_splitted \\$0:s \\*[\\$0:s]
.  ds \\$1 "\\*[\\$0:s]\""
.  rm \\$0:s
..
.\" --------------------------------------------------------------------
.\" www:url_breaks_splitted (<result> <char> [<char>...])
.\"
.\" Add `\:' within URL strings, but arguments are a splitted string.
.\"
.\" Arguments: >=2: <result> <char> [<char>...]
.\"
.de www:url_breaks_splitted
.  nr \\$0:min 5             \" minimal number of characters for next line
.  if (\\n[.$] < 2) \
.    www:error .\\$0 expects at least 2 arguments.
.  ds \\$0:res \\$1\"
.  shift
.  ds \\$0:s\"
.  nr \\$0:done 0
.  while !\\n[\\$0:done] \{\
.    if (\\n[.$] <= 0) \{\
.      nr \\$0:done 1
.      break
.    \}
.    if '\\$1'space' \{\
.      as \\$0:s " \""
.      shift
.      continue
.    \}
.    if (\\n[.$] < \\n[\\$0:min]) \{\
.      as \\$0:s "\\$1\""
.      shift
.      continue
.    \}
.    if !'\\$1'/' \{\
.      as \\$0:s "\\$1\""
.      shift
.      continue
.    \}
.    \" we are at a `/' character
.    while '\\$1'/' \{\
.      as \\$0:s /\"
.      if (\\n[.$] == 0) \{\
.        nr \\$0:done 1
.        break
.      \}
.      shift
.    \}
.    if \\n[\\$0:done] \
.      break
.    if (\\n[.$] < \\n[\\$0:min]) \
.      continue
.    if '\\$1'\:' \
.      shift
.    as \\$0:s \:\"
.  \}
.  ds \\*[\\$0:res] \\*[\\$0:s]\"
.  rm \\$0:res
.  rm \\$0:s
..
.\" --------------------------------------------------------------------
.\" User Interface
.\" --------------------------------------------------------------------
.
.\" --------------------------------------------------------------------
.\" HTML
.\"
.\" the main auxiliary macro for the HTML interface
.\"
.de HTML
.  if \\n[www-html] \{\
.    \" was implemented via .nop \&\X^html:\\$*^ but
.    \" is now implemented using HTML-NS to utilize code factoring.
.    \"
.    \" the `\&' makes the vertical mode leave, so to say
.    \"
.    nop \&\c
.    HTML-NS \\$*
.    nop \&
.  \}
..
.\"
.\" an auxiliary macro for HTML (without following space)
.\"
.de HTML-NS
.  nop \X^html:\\$*^\c
..
.\"
.\" emit a HTML tag after shutting down a (possibly open) paragraph
.\"
.de HTML</p>
.  if \\n[www-html] \{\
.    \" the `\&' makes the vertical mode leave, so to say
.    nop \&\X^html</p>:\\$*^
.  \}
..
.\" --------------------------------------------------------------------
.\" HX n
.\"
.\"   Automatic heading level cut off.
.\"
.\"   N is the depth limit of automatically linked headings.  So a depth
.\"   of 2 would cause grohtml to generate a list of links for `.NH 1'
.\"   and `.NH 2' but not for `.NH 3'.
.\"
.de HX
.  if \\n[www-html] \
.    nop \X^index:\\$*^
..
.\" --------------------------------------------------------------------
.\" BCL foreground background active not-visited visited
.\"
.de BCL
.  HTML <body text=\\$1 bgcolor=\\$2 link=\\$3 alink=\\$4 vlink=\\$5>
..
.\" --------------------------------------------------------------------
.\" BGIMG imagefile
.\"
.de BGIMG
.  HTML <body background=\\$1>
..
.\" --------------------------------------------------------------------
.\" URL url [description] [after]
.\"     if description is absent then the url becomes the anchor text
.\"
.de URL
.  ds \\$0:adr \\$1\"
.  www:url_breaks \\$0:adr
.  ie \\n[www-html] \{\
.    ie '\\$3'' \
.      ds \\$0:after \&
.    el \
.      ds \\$0:after \&\\$3
.    ie '\\$2'' \
.       HTML-NS <a href="\\$1">\\$1</a>
.    el \
.       HTML-NS <a href="\\$1">\\$2</a>
.    nop \\*[\\$0:after]
.    rm \\$0:after
.  \}
.  el \{\
.    if !r ps4html .ad l
.    ie '\\$2'' \
.       nop \%\[la]\m[blue]\f[C]\\*[\\$0:adr]\f[]\m[]\[ra]\\$3
.    el \
.       nop \m[blue]\\$2\m[] \%\[la]\f[C]\\*[\\$0:adr]\f[]\[ra]\\$3
.    if !r ps4html .ad
.  \}
.  rm \\$0:adr
..
.\" --------------------------------------------------------------------
.\" FTP url description [after]
.\"
.\"   Same as URL.
.\"
.als FTP URL
.\" --------------------------------------------------------------------
.\" MTO address description [after]
.\"
.\"   ADDRESS is the email address (without the `mailto:' prefix).
.\"
.\"   DESCRIPTION is the optional name.  If an empty argument is given,
.\"   ADDRESS is used instead.
.\"
.\"   AFTER is optional stuff printed immediately after ADDRESS
.\"   (resp. DESCRIPTION).
.\"
.\"     Example:
.\"
.\"       Foobar has been written by
.\"       .MTO fred@foo.bar "Fredrick Bloggs" .
.\"
.de MTO
.  ie \\n[www-html] \{\
.    ie '\\$2'' \
.      URL mailto:\\$1 \\$1 "\\$3"
.    el \
.      URL mailto:\\$1 "\\$2" "\\$3"
.  \}
.  el \{\
.    ie '\\$2'' \
.      nop \%\m[blue]\f[C]\\$1\f[]\m[]\\$3
.    el \
.      nop \m[blue]\\$2\m[] \%\[la]\f[C]\\$1\f[]\[ra]\\$3
.  \}
..
.\" --------------------------------------------------------------------
.\" TAG name
.\"
.\"   Generate an html name NAME.
.\"
.de TAG
.  HTML <a name="\\$1"></a>
..
.\" --------------------------------------------------------------------
.\" IMG [-R|-L|-C] filename [width] [height]
.\"
.\"   Include an image of any type (will only work for -Thtml).
.\"
.\"   Alignment is centered by default (-C).
.\"   Default value for WIDTH is 1i.
.\"   If HEIGHT is not given, WIDTH is used as the height.
.\"
.de IMG
.  ie \\n[www-html] \{\
.    ie '\\$2'-R' \
.      DEVTAG ".right-image"
.    el \{\
.      ie '\\$2'-L' \
.        DEVTAG ".left-image"
.      el \
.        DEVTAG ".centered-image"
.    \}
.    nr www-width 100
.    if !'\\$3'' \
.      nr www-width \\$3
.    nr www-height \\n[www-width]
.    if !'\\$4'' \
.      nr www-height \\$4
.    HTML <img src="\\$1" alt="Image \\$1" \
           width=\\n[www-width] height=\\n[www-height]>
.  \}
.  el \
.    nop \[la]\f[C]\\$1\f[]\[ra]
..
.\" --------------------------------------------------------------------
.\" PIMG  [-R|-L|-C] filename [width] [height]
.\"
.\"   Include a png image.  It will work for -Tps and -Thtml.
.\"   The default value for WIDTH and HEIGHT is zero; the default
.\"   alignment is centering (-C).
.\"
.\" Note: This macro can only be used with the `-U' option of groff,
.\"       activating unsafe mode, if not used with -Thtml; the PNG image
.\"       is then converted to the EPS format using netpbm utilities.
.\"
.de PIMG
.  ie \\n[www-html] \{\
.    ie '\\$1'-R' \
.      DEVTAG ".right-image"
.    el \{\
.      ie '\\$1'-L' \
.        DEVTAG ".left-image"
.      el \
.        DEVTAG ".centered-image"
.    \}
.    nr www-width 0
.    nr www-height 0
.    if !'\\$3'' \
.      nr www-width (\\$3 * 100 / 240)
.    if !'\\$4'' \
.      nr www-height (\\$4 * 100 / 240)
.    ie (\\n[www-width] == 0) \{\
.      ie (\\n[www-height] == 0) \
.        HTML <img src="\\$2" alt="Image \\$2">
.      el \
.        HTML <img src="\\$1" alt="Image \\$2" height=\\n[www-height]>
.    \}
.    el \{\
.      ie (\\n[www-height] == 0) \
.        HTML <img src="\\$2" alt="Image \\$2" width=\\n[www-width]>
.      el \
.        HTML <img src="\\$2" alt="Image \\$2" width=\\n[www-width] \
               height=\\n[www-height]>
.    \}
.  \}
.  el \{\
.    if !r ps4html \{\
.      www-make-unique-name
.      sy pngtopnm \\$2 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps
.      ie '\\$1'-C' \
.        PSPIC \\*[www-unique-name].eps \\$3 \\$4
.      el \
.        PSPIC \\$1 \\*[www-unique-name].eps \\$3 \\$4
.    \}
.  \}
..
.
.\" --------------------------------------------------------------------
.\" auxiliary definitions for MPIMG
.\"
.nr www-left-ll-trap 0
.nr www-left-po-trap 0
.nr www-right-ll-trap 0
.
.de www-finish-left-po
.  po -(\\n[www-left-indent]u + \\n[www-image-gap]u)
.  wh \\n[www-left-po-trap]u
.  nr www-left-indent 0
..
.
.\" called when the -R picture is finished
.de www-finish-right-ll
.  ll +(\\n[www-right-indent]u + \\n[www-image-gap]u)
.  \" now see whether we need to inline www-finish-left-ll
.  if (\\n[www-left-ll-trap]u > 0) \
.    if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-ll-trap]u) \{\
.      mk www-left-po-trap
.      nr www-left-po-trap +1v
.      wh \\n[www-left-po-trap]u www-finish-left-po
.      ll +\\n[www-left-indent]u
.      wh \\n[www-left-ll-trap]u
.      nr www-left-ll-trap 0
.    \}
.  \" and see whether we need to inline www-finish-left-po
.  if (\\n[www-left-po-trap]u > 0) \
.    if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-po-trap]u) \{\
.      po -\\n[www-left-indent]u
.      wh \\n[www-left-po-trap]u
.      nr www-left-indent 0
.    \}
.  wh \\n[www-right-ll-trap]u
.  nr www-right-ll-trap 0
..
.
.de www-finish-left-ll
.  if (\\n[www-right-ll-trap] > 0) \
.    if ((\\n[www-left-ll-trap] + 1v) >= \\n[www-right-ll-trap]) \{\
.      ll +\\n[www-right-indent]u
.      nr www-right-ll-trap 0
.    \}
.  mk www-left-po-trap
.  nr www-left-po-trap +1v
.  wh \\n[www-left-po-trap]u www-finish-left-po
.  ll +(\\n[www-left-indent]u + \\n[www-image-gap]u)
.  wh \\n[www-left-ll-trap]u
.  nr www-left-ll-trap 0
..
.\" --------------------------------------------------------------------
.\" MPIMG [-R|-L] [-G gap] filename [width [height]]
.\"
.\"   Include a png image and wrap text around it.  It will work for
.\"   -Tps and -Thtml.  The default value for WIDTH is 1i; default value
.\"   for HEIGHT is WIDTH; the default alignment is left (-L).
.\"   -G is used to insert a gap between the text and the image.
.\"
.\" Note: This macro can only be used with the `-U' option of groff,
.\"       activating unsafe mode, if not used with -Thtml; the PNG image
.\"       is then converted to the EPS format using netpbm utilities.
.\"
.
.nr www-htmlimage-gap 0
.
.de MPIMG
.  nr www-image-just 1
.  nr www-image-gap 0
.  while (\\n[.$] > 0) \{\
.    if '-L'\\$1' \{\
.      nr www-image-just 1
.      shift
.      continue
.    \}
.    if '-R'\\$1' \{\
.      nr www-image-just 0
.      shift
.      continue
.    \}
.    if '-G'\\$1' \{\
.      nr www-image-gap \\$2
.      nr www-htmlimage-gap (\\$2 * 100 / 240)
.      shift 2
.      continue
.    \}
.    break
.  \}
.  nr www-width 1i
.  if !'\\$2'' \
.    nr www-width \\$2
.  nr www-height \\n[www-width]
.  if !'\\$3'' \
.    nr www-height \\$3
.  nr www-width (\\n[www-width] * 100 / 240)
.  nr www-height (\\n[www-height] * 100 / 240)
.
.  ie \\n[www-html] \{\
.    ie !\\n[www-image-just] \
.      HTML <img src="\\$1" alt="Image \\$1" hspace=\\n[www-htmlimage-gap] \
             align=right width=\\n[www-width] height=\\n[www-height]>
.    el \
.      HTML <img src="\\$1" alt="Image \\$1" hspace=\\n[www-htmlimage-gap] \
             align=left width=\\n[www-width] height=\\n[www-height]>
.  \}
.  el \{\
.    if !r ps4html \{\
.      www-make-unique-name
.      sy pngtopnm \\$1 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps
.      ie !\\n[www-image-just] \{\
.        \" we must now disable a possible left image trap
.        sp -1
.        if (\\n[www-left-ll-trap] > 0) \
.          wh \\n[www-left-ll-trap]u
.        if (\\n[www-left-po-trap] > 0) \
.          wh \\n[www-left-po-trap]u
.        PSPIC -R \\*[www-unique-name].eps \\$2 \\$3
.        sp -\\n[ps-desht]u
.        nr www-right-indent \\n[ps-deswid]u
.        \" we want to have some space between text and image,
.        \" so the line length must be shorter
.        ll -(\\n[www-right-indent]u + \\n[www-image-gap]u)
.        mk www-right-ll-trap
.        nr www-right-ll-trap +(\\n[ps-desht]u - 1v)
.        wh \\n[www-right-ll-trap]u www-finish-right-ll
.        \" now restore possible left trap
.        if (\\n[www-left-ll-trap] > 0) \
.          wh \\n[www-left-ll-trap]u www-finish-left-ll
.        if (\\n[www-left-po-trap] > 0) \
.          wh \\n[www-left-po-trap]u
.      \}
.      el \{\
.        \" we must now disable a possible right image trap
.        if (\\n[www-right-ll-trap] > 0) \
.          wh \\n[www-right-ll-trap]u
.        PSPIC -L \\*[www-unique-name].eps \\$2 \\$3
.        sp -\\n[ps-desht]u
.        nr www-left-indent \\n[ps-deswid]u
.        \" increase offset by gap
.        po +(\\n[www-left-indent]u + \\n[www-image-gap]u)
.        \" decrease line length by gap
.        ll -(\\n[www-left-indent]u + \\n[www-image-gap]u)
.        mk www-left-ll-trap
.        nr www-left-ll-trap +(\\n[ps-desht]u - 1v)
.        wh \\n[www-left-ll-trap]u www-finish-left-ll
.        \" now restore possible right trap
.        if (\\n[www-right-ll-trap] > 0) \
.          wh \\n[www-right-ll-trap]u www-finish-right-ll
.      \}
.    \}
.  \}
..
.\" --------------------------------------------------------------------
.\" HnS n
.\"
.\"   Begin heading.  Heading level is N.
.\"
.\" HnE
.\"
.\"   End heading.
.\"
.\" If your heading contains URL, FTP, MTO macros you might wish to
.\" disable automatic links to headings.  This can be done via `-P-l'
.\" from the command line or by using a cakk to `.HX 0'.
.\"
.nr www-heading-no -1
.
.de HnS
.  ie '\\$1'' \
.    nr www-heading-no 1
.  el \
.    nr www-heading-no \\$1
.  DEVTAG-NH \\n[www-heading-no]
..
.
.de HnE
.  if (\\n[www-heading-no] == -1) \
.    www-error "HnE found without a corresponding HnS"
.  DEVTAG-EO-H
..
.\" --------------------------------------------------------------------
.\" LK
.\"
.\"   Emit the automatically collected links derived from
.\"   section/numbered headings at this position.
.\"
.de LK
.  DEVTAG ".links"
..
.\" --------------------------------------------------------------------
.\" HR
.\"
.\"   Produce a horizontal line.
.\"
.de HR
.  HTML</p> "<hr>"
..
.\" --------------------------------------------------------------------
.\" NHR
.\"
.\"  Suppresses the generation of the top and bottom rules which grohtml
.\"  emits by default.
.\"
.de NHR
.  DEVTAG ".no-auto-rule"
..
.\"
.\" www-end-nowhere - end of input trap called to finish diversion.
.\"
.de www-end-nowhere
.  if !\\n[www-html] \
.    di
.  DEVTAG-EO-TL
..
.\" --------------------------------------------------------------------
.\" HTL
.\"
.\"   Generate an HTML title only.  This differs from the -ms .TL macro
.\"   which generates both an HTML title and an H1 heading.
.\"
.\"   This is useful when an author wishes to use a HTML title as search
.\"   engine fodder but a graphic title in the document.
.\"
.\"   The macro terminates when a space or break is seen (.sp, .br).
.\"
.de HTL
.  DEVTAG ".html-tl"
.  if !\\n[www-html] \
.    di www-nowhere
.  it 2 www-end-nowhere
..
.
.\" --------------------------------------------------------------------
.\" auxiliary definitions for ULS / ULE
.\"
.ds www-level1 \[bu]\ \ \"
.ds www-level2 \[sq]\ \ \"
.ds www-level3 \[ci]\ \ \"
.nr www-level 0
.nr www-depth 0
.
.\"
.\" Auxiliary macro for ULS.
.\"
.de www-push-level
.  nr www-level +1
.  if (\\n[www-level] > 3) \
.    www-error "too many levels of indentation (\\n[www-level])"
..
.\"
.\" Auxiliary macro for ULE.
.\"
.de www-pop-level
.  if !\\n[www-level] \
.    www-error "trying to terminate a list which does not exist"
.  nr www-level -1
..
.\" --------------------------------------------------------------------
.\" ULS
.\"
.\"   Start an unordered list.
.\"
.de ULS
.  www-push-level
.  ie \\n[www-html] \
.    HTML</p> "<ul>"
.  el \{\
.    if (\\n[www-level] == 1) \
.      nr www-depth \\n[.i]
.    nr www-depth +\w'\\*[www-level\\n[www-level]]'u
.  \}
..
.\" --------------------------------------------------------------------
.\" ULE
.\"
.\"   End an unordered list.
.\"
.de ULE
.  ie \\n[www-html] \
.    HTML</p> "</ul>"
.  el \{\
.    nr www-depth -\w'\\*[www-level\\n[www-level]]'u
.    in \\n[www-depth]u
.  \}
.  www-pop-level
..
.\" --------------------------------------------------------------------
.\" LI
.\"
.\"   Insert a list item.
.\"
.de LI
.  ie \\n[www-html] \
.    HTML</p> "<li>"
.  el \{\
.    www:paraspace
.    in \\n[www-depth]u
.    ti -\w'\\*[www-level\\n[www-level]]'u
.    nop \\*[www-level\\n[www-level]]\c
.  \}
..
.\" --------------------------------------------------------------------
.\" DC l text [color]
.\"
.\"   L is the letter to be dropped and enlarged.
.\"
.\"   TEXT is the following text whose height the first letter should not
.\"   exceed.
.\"
.\"   COLOR is the optional color of the dropped letter (default black).
.\"
.de DC
.  ds www-dropcolor black
.  if !'\\$3'' \
.    ds www-dropcolor \\$3
.  ie '\*(.T'html' \{\
.    www-make-unique-name
.    MPIMG -L \\*[www-unique-name].png "(\\n[.v] * 2u)"
.  \}
.  el \{\
.    ie r ps4html \{\
.      www-make-unique-name
.      \" To avoid interferences with another DC macro call which is located
.      \" very near to the current one, we draw the glyph on a separate page.
.      \" Otherwise it could theoretically happen that the dropped capital
.      \" glyphs overlap.
.      bp
.      ev www-DC
.      vs 80p
.      nop \O[5i\\*[www-unique-name].png]\O[1]
.      nop \m[\\*[www-dropcolor]]\s[40]\O[3]\\$1\O[4]
.      nop \O[2]\O[0]
.      br
.      ev
.      bp
.    \}
.    el \{\
.      ie n \
.        nop \\$1\c
.      el \{\
.        nr dummy \w'\\$1'u
.        nr dcht ((\\n[.v] + \\n[rst]) * \\n[.ps] / \\n[rst])
.        char \[dcap] \m[\\*[www-dropcolor]]\s'\\n[dcht]u'\\$1
.        nop \v'\\n[.v]u'\\[dcap]\v'-\\n[.v]u'\c
'        ti \w'\\[dcap]'u
.      \}
.    \}
.  \}
.  nop \\$2
..
.\" --------------------------------------------------------------------
.\" Setup around HTML-IMAGE and friends
.\"
.\" now set up TS, TE, EQ, EN default macros
.\"
.do if !d TS .do ds TS HTML-IMAGE
.do if !d TE .do ds TE HTML-IMAGE-END
.do if !d EQ .do ds EQ HTML-IMAGE
.do if !d EN .do ds EN HTML-IMAGE-END
.\"
.\" supplementary macros used by other macro sets
.\"
.\" here are some tags specially for -Tps or -Thtml when invoked by
.\" pre-html to generate png images from postscript.
.
.\" --------------------------------------------------------------------
.\" HTML-DO-IMAGE - tells troff to issue an image marker which can be
.\"                 read back by pre-html
.\"
.de HTML-DO-IMAGE
.  if r ps4html \
.    nop \O[5\\$2\\$1.png]\O[1]\O[3]
.  if \\n[www-html] \
.    nop \O[5\\$2\\$1.png]\O[0]\O[3]
..
.\" --------------------------------------------------------------------
.\" HTML-IMAGE-END - terminates an image for html
.\"
.de HTML-IMAGE-END
.  if r ps4html \
.    nop \O[4]\O[2]\O[0]
.  if \\n[www-html] \
.    nop \O[4]\O[2]\O[1]
..
.
.nr www-png-no 0
.
.\" --------------------------------------------------------------------
.\" www-make-unique-name - generates another unique name in string
.\"                        `www-unique-name'
.\"
.de www-make-unique-name
.  nr www-png-no +1
.  ds www-unique-name \\*[www-image-template]\\n[www-png-no]
..
.\" --------------------------------------------------------------------
.\" HTML-IMAGE and friends tell grohtml that this region of text needs
.\"            to be rendered as an image.
.\"
.de HTML-IMAGE
.  \" generates a centered image
.  www-make-unique-name
.  HTML-DO-IMAGE \\*[www-unique-name] c
..
.
.de HTML-IMAGE-RIGHT
.  www-make-unique-name
.  HTML-DO-IMAGE \\*[www-unique-name] r
..
.
.de HTML-IMAGE-LEFT
.  www-make-unique-name
.  HTML-DO-IMAGE \\*[www-unique-name] l
..
.
.de HTML-IMAGE-INLINE
.  www-make-unique-name
.  HTML-DO-IMAGE \\*[www-unique-name] i
..
.
.\" --------------------------------------------------------------------
.\" JOBNAME
.\"
.\"   Generate multiple output files containing the html.
.\"   A file is split whenever a .SH or .NH 1 is encountered.
.\"   The argument to JOBNAME is the file stem for future output files.
.\"
.de JOBNAME
.  DEVTAG .job-name \\$1
..
.\" --------------------------------------------------------------------
.\" HEAD
.\"
.\"   Adds information to the <head> </head> section of the html
.\"   document
.\" --------------------------------------------------------------------
.de HEAD
.  DEVTAG .head "\\$*"
..
.\" --------------------------------------------------------------------
.\" Final Setup
.\" --------------------------------------------------------------------
.
.if \n[www-html] \{\
.   nh
.   nr HY 0
.\}
.
.\"
.\" start of some code
.\"
.
.de CDS
.ft C
.nf
..
.\"
.\" end of some code
.\"
.
.de CDE
.fi
.ft P
..
.
.if r ps4html .nop \O[0]
.cp \n(_C
.
.\" now set
.
.\" --------------------------------------------------------------------
.\" Emacs settings
.\" --------------------------------------------------------------------
.
.\" Local Variables:
.\" mode: nroff
.\" End:
.\" EOF