PageRenderTime 64ms CodeModel.GetById 15ms app.highlight 30ms RepoModel.GetById 1ms app.codeStats 1ms

/contrib/groff/tmac/s.tmac

https://bitbucket.org/freebsd/freebsd-head/
Unknown | 2076 lines | 2070 code | 6 blank | 0 comment | 0 complexity | f141370e1b588a7602258040637edd41 MD5 | raw file
   1.\" -*- nroff -*-
   2.ig
   3
   4s.tmac
   5
   6Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004
   7  Free Software Foundation, Inc.
   8     Written by James Clark (jjc@jclark.com)
   9
  10This file is part of groff.
  11
  12groff is free software; you can redistribute it and/or modify it under
  13the terms of the GNU General Public License as published by the Free
  14Software Foundation; either version 2, or (at your option) any later
  15version.
  16
  17groff is distributed in the hope that it will be useful, but WITHOUT ANY
  18WARRANTY; without even the implied warranty of MERCHANTABILITY or
  19FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  20for more details.
  21
  22You should have received a copy of the GNU General Public License along
  23with groff; see the file COPYING.  If not, write to the Free Software
  24Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
  25..
  26.if !\n(.g .ab These ms macros require groff.
  27.if \n(.C \
  28.	ab The groff ms macros do not work in compatibility mode.
  29.\" Enable warnings (only if none are given on the command line).
  30.\" You can delete this if you want.
  31.if (\n[.warn] == 65543) .warn
  32.\" See if already loaded.
  33.if r GS .nx
  34.mso devtag.tmac
  35.nr GS 1
  36.nr need_eo_h 0
  37.nr need_eo_tl 0
  38.de @error
  39.tm \\n(.F:\\n(.c: macro error: \\$*
  40..
  41.de @warning
  42.tm \\n(.F:\\n(.c: macro warning: \\$*
  43..
  44.de @fatal
  45.ab \\n(.F:\\n(.c: fatal macro error: \\$*
  46..
  47.de @not-implemented
  48.@error sorry, \\$0 not implemented
  49.als \\$0 @nop
  50..
  51.als TM @not-implemented
  52.als CT @not-implemented
  53.de @nop
  54..
  55.de @init
  56.if !rPO .nr PO \\n(.o
  57.\" a non-empty environment
  58.ev ne
  59\c
  60.ev
  61.ev nf
  62'nf
  63.ev
  64..
  65.ds REFERENCES References
  66.ds ABSTRACT ABSTRACT
  67.ds TOC Table of Contents
  68.ds MONTH1 January
  69.ds MONTH2 February
  70.ds MONTH3 March
  71.ds MONTH4 April
  72.ds MONTH5 May
  73.ds MONTH6 June
  74.ds MONTH7 July
  75.ds MONTH8 August
  76.ds MONTH9 September
  77.ds MONTH10 October
  78.ds MONTH11 November
  79.ds MONTH12 December
  80.ds MO \\*[MONTH\n[mo]]
  81.ds DY \n[dy] \*[MO] \n[year]
  82.de ND
  83.if \\n[.$] .ds DY "\\$*
  84..
  85.de DA
  86.if \\n[.$] .ds DY "\\$*
  87.ds CF \\*[DY]
  88..
  89.\" indexing
  90.de IX
  91.tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[PN]
  92..
  93.\" print an error message and then try to recover
  94.de @error-recover
  95.@error \\$@ (recovering)
  96.nr *pop-count 0
  97.while !'\\n(.z'' \{\
  98.	\"@warning automatically terminating diversion \\n(.z
  99.	ie d @div-end!\\n(.z .@div-end!\\n(.z
 100.	el .*div-end-default
 101.	nr *pop-count +1
 102.	\" ensure that we don't loop forever
 103.	if \\n[*pop-count]>20 .@fatal recovery failed
 104.\}
 105.while !'\\n[.ev]'0' .ev
 106.par@reset-env
 107.par@reset
 108..
 109.de *div-end-default
 110.ds *last-div \\n(.z
 111.br
 112.di
 113.ev nf
 114.\\*[*last-div]
 115.ev
 116..
 117.\" ****************************
 118.\" ******** module cov ********
 119.\" ****************************
 120.\" Cover sheet and first page.
 121.de cov*err-not-after-first-page
 122.@error \\$0 is not allowed after the first page has started
 123..
 124.de cov*err-not-before-tl
 125.@error \\$0 is not allowed before TL
 126..
 127.de cov*err-not-again
 128.@error \\$0 is not allowed more than once
 129..
 130.de cov*err-not-after-ab
 131.@error \\$0 is not allowed after first AB, LP, PP, IP, SH or NH
 132..
 133.als AU cov*err-not-before-tl
 134.als AI cov*err-not-before-tl
 135.als AB cov*err-not-before-tl
 136.de cov*first-page-init
 137.rm cov*first-page-init
 138.par@init
 139.als RP cov*err-not-after-first-page
 140.@init
 141.ie \\n[cov*rp-format] \{\
 142.	pg@cs-top
 143.	als FS cov*FS
 144.	als FE cov*FE
 145.\}
 146.el \{\
 147.	pg@top
 148.	als FS @FS
 149.	als FE @FE
 150.\}
 151.wh 0 pg@top
 152.CHECK-FOOTER-AND-KEEP
 153..
 154.wh 0 cov*first-page-init
 155.\" This handles the case where FS occurs before TL or LP.
 156.de FS
 157.br
 158\\*[FS]\\
 159..
 160.nr cov*rp-format 0
 161.nr cov*rp-no 0
 162.\" released paper format
 163.de RP
 164.nr cov*rp-format 1
 165.if \\n[.$] .if '\\$1'no' .nr cov*rp-no 1
 166.if rPO .po \\n(POu
 167.pn 0
 168..
 169.de TL
 170.br
 171.als TL cov*err-not-again
 172.rn @AB AB
 173.rn @AU AU
 174.rn @AI AI
 175.di cov*tl-div
 176.par@reset
 177.ft B
 178.ps +2
 179.vs +3p
 180.ll (u;\\n[LL]*5/6)
 181.nr cov*n-au 0
 182.DEVTAG-TL
 183..
 184.de @AU
 185.par@reset
 186.if !'\\n(.z'' \{\
 187.	br
 188.	di
 189.\}
 190.nr cov*n-au +1
 191.di cov*au-div!\\n[cov*n-au]
 192.nf
 193.ft I
 194.ie (\\n[PS] >= 1000) \
 195.	ps (\\n[PS]z / 1000u)
 196.el \
 197.	ps \\n[PS]
 198..
 199.de @AI
 200.par@reset
 201.if !'\\n(.z'' \{\
 202.	br
 203.	di
 204.\}
 205.ie !\\n[cov*n-au] .@error AI before AU
 206.el \{\
 207.	di cov*ai-div!\\n[cov*n-au]
 208.	nf
 209.	ft R
 210.	ie (\\n[PS] >= 1000) \
 211.		ps (\\n[PS]z / 1000u)
 212.	el \
 213.		ps \\n[PS]
 214.\}
 215..
 216.de LP
 217.if !'\\n[.z]'' \{\
 218.	br
 219.	di
 220.\}
 221.br
 222.cov*ab-init
 223.cov*print
 224\\*[\\$0]\\
 225..
 226.als IP LP
 227.als PP LP
 228.als XP LP
 229.als QP LP
 230.als RS LP
 231.als NH LP
 232.als SH LP
 233.als MC LP
 234.als RT LP
 235.als XS LP
 236.de cov*ab-init
 237.als cov*ab-init @nop
 238.als LP @LP
 239.als IP @IP
 240.als PP @PP
 241.als XP @XP
 242.als RT @RT
 243.als XS @XS
 244.als SH @SH
 245.als NH @NH
 246.als QP @QP
 247.als RS @RS
 248.als RE @RE
 249.als QS @QS
 250.als QE @QE
 251.als MC @MC
 252.als EQ @EQ
 253.als EN @EN
 254.als TS @TS
 255.als AB cov*err-not-after-ab
 256.als AU par@AU
 257.als AI par@AI
 258.als TL par@TL
 259..
 260.de @AB
 261.if !'\\n(.z'' \{\
 262.	br
 263.	di
 264.\}
 265.cov*ab-init
 266.ie '\*(.T'html' \{\
 267.	cov*tl-au-print
 268.	als cov*tl-au-print @nop
 269.\}
 270.el .di cov*ab-div
 271.par@ab-indent
 272.par@reset
 273.if !'\\$1'no' \{\
 274.       if '\*(.T'html'  \{\
 275.              nf
 276.              sp
 277.       \}
 278.	ft I
 279.	ce 1
 280\\*[ABSTRACT]
 281.	sp
 282.	ft R
 283.\}
 284.ns
 285.@PP
 286.if '\*(.T'html' \{\
 287.	cov*tl-au-print
 288.	als cov*tl-au-print @nop
 289.	par@reset-env
 290.	par@reset
 291.	cov*print
 292.\}
 293..
 294.de AE
 295.ie '\*(.T'html' \{\
 296.	als AE cov*err-not-again
 297.\}
 298.el \{\
 299.  ie '\\n(.z'cov*ab-div' \{\
 300.	als AE cov*err-not-again
 301.	br
 302.	di
 303.\"	nr cov*ab-height \\n[dn]
 304.	par@reset-env
 305.	par@reset
 306.	cov*print
 307.  \}
 308.  el .@error AE without AB
 309.\}
 310..
 311.de @div-end!cov*ab-div
 312.AE
 313..
 314.de cov*print
 315.als cov*print @nop
 316.ie d cov*tl-div \{\
 317.	ie \\n[cov*rp-format] .cov*rp-print
 318.	el .cov*draft-print
 319.\}
 320.el \{\
 321.	if \\n[cov*rp-format] \{\
 322.		@warning RP format but no TL
 323.		bp 1
 324.		als FS @FS
 325.		als FE @FE
 326.		CHECK-FOOTER-AND-KEEP
 327.	\}
 328.	br
 329.\}
 330..
 331.de cov*rp-print
 332.nr cov*page-length \\n[.p]
 333.pl 1000i
 334.cov*tl-au-print
 335.sp 3
 336.if d cov*ab-div \{\
 337.  if !'\*(.T'html'  .	nf
 338.       cov*ab-div
 339.\}
 340.sp 3
 341.par@reset
 342\\*[DY]
 343.br
 344.if \\n[cov*fn-height] \{\
 345.	sp |(u;\\n[cov*page-length]-\\n[FM]\
 346-\\n[cov*fn-height]-\\n[fn@sep-dist]>?\\n[nl])
 347.	fn@print-sep
 348.	ev nf
 349.	cov*fn-div
 350.	ev
 351.	ie \\n[cov*rp-no] .rm cov*fn-div
 352.	el \{\
 353.		rn cov*fn-div fn@overflow-div
 354.		nr fn@have-overflow 1
 355.	\}
 356.\}
 357.als FS @FS
 358.als FE @FE
 359.CHECK-FOOTER-AND-KEEP
 360.\" If anything was printed below where the footer line is normally printed,
 361.\" then that's an overflow.
 362.if -\\n[FM]/2+1v+\\n[cov*page-length]<\\n[nl] .@error cover sheet overflow
 363.pl \\n[cov*page-length]u
 364.bp 1
 365.if !\\n[cov*rp-no] .cov*tl-au-print
 366.rs
 367.sp 1
 368..
 369.de cov*draft-print
 370.cov*tl-au-print
 371.if d cov*ab-div \{\
 372.	nf
 373.	sp 2
 374.	cov*ab-div
 375.\}
 376.sp 1
 377..
 378.de cov*tl-au-print
 379.par@reset
 380.nf
 381.rs
 382.sp 3
 383.ce 9999
 384.if d cov*tl-div \{\
 385.    cov*tl-div
 386.    DEVTAG-EO-TL
 387.\}
 388.nr cov*i 1
 389.nr cov*sp 1v
 390.while \\n[cov*i]<=\\n[cov*n-au] \{\
 391.       ie '\*(.T'html' .br
 392.	el .sp \\n[cov*sp]u
 393.	cov*au-div!\\n[cov*i]
 394.	ie d cov*ai-div!\\n[cov*i] \{\
 395.		sp .5v	
 396.		cov*ai-div!\\n[cov*i]
 397.		nr cov*sp 1v
 398.	\}
 399.	el .nr cov*sp .5v
 400.	nr cov*i +1
 401.\}
 402.ce 0
 403..
 404.nr cov*fn-height 0
 405.nr cov*in-fn 0
 406.\" start of footnote on cover
 407.de cov*FS
 408.if \\n[cov*in-fn] \{\
 409.	@error nested FS
 410.	FE
 411.\}
 412.nr cov*in-fn 1
 413.ev fn
 414.par@reset-env
 415.da cov*fn-div
 416.if !\\n[cov*fn-height] .ns
 417.ie \\n[.$] .FP "\\$1" no
 418.el .@LP
 419..
 420.de @div-end!cov*fn-div
 421.cov*FE
 422..
 423.\" end of footnote on cover
 424.de cov*FE
 425.ie '\\n(.z'cov*fn-div' \{\
 426.	br
 427.	ev
 428.	di
 429.	nr cov*in-fn 0
 430.	nr cov*fn-height +\\n[dn]
 431.\}
 432.el .@error FE without matching FS
 433..
 434.\" ***************************
 435.\" ******** module pg ********
 436.\" ***************************
 437.\" Page-level formatting.
 438.\" > 0 if we have a footnote on the current page
 439.nr pg@fn-flag 0
 440.nr pg@colw 0
 441.nr pg@fn-colw 0
 442.nr HM 1i
 443.nr FM 1i
 444.ds LF
 445.ds CF
 446.ds RF
 447.ds LH
 448.ds CH -\\n[PN]-
 449.ds RH
 450.ds pg*OH '\\*[LH]'\\*[CH]'\\*[RH]'
 451.ds pg*EH '\\*[LH]'\\*[CH]'\\*[RH]'
 452.ds pg*OF '\\*[LF]'\\*[CF]'\\*[RF]'
 453.ds pg*EF '\\*[LF]'\\*[CF]'\\*[RF]'
 454.de OH
 455.ds pg*\\$0 "\\$*
 456..
 457.als EH OH
 458.als OF OH
 459.als EF OH
 460.de PT
 461.ie \\n%=1 .if \\n[pg*P1] .tl \\*[pg*OH]
 462.el \{\
 463.	ie o .tl \\*[pg*OH]
 464.	el .tl \\*[pg*EH]
 465.\}
 466..
 467.de BT
 468.ie o .tl \\*[pg*OF]
 469.el .tl \\*[pg*EF]
 470..
 471.nr pg*P1 0
 472.de P1
 473.nr pg*P1 1
 474..
 475.wh -\n[FM]u pg@bottom
 476.wh -\n[FM]u/2u pg*footer
 477.nr MINGW 2n
 478.nr pg@ncols 1
 479.de @MC
 480.if !'\\n(.z'' .error-recover MC while diversion open
 481.br
 482.ie \\n[pg@ncols]>1 .pg@super-eject
 483.el \{\
 484.	\" flush out any floating keeps
 485.	while \\n[kp@tail]>\\n[kp@head] \{\
 486.		rs
 487.		bp
 488.	\}
 489.\}
 490.ie !\\n(.$ \{\
 491.	nr pg@colw \\n[LL]*7/15
 492.	nr pg*gutw \\n[LL]-(2*\\n[pg@colw])
 493.	nr pg@ncols 2
 494.\}
 495.el \{\
 496.	nr pg@colw (n;\\$1)<?\\n[LL]
 497.	ie \\n[.$]<2 .nr pg*gutw \\n[MINGW]
 498.	el .nr pg*gutw (n;\\$2)
 499.	nr pg@ncols \\n[LL]-\\n[pg@colw]/(\\n[pg@colw]+\\n[pg*gutw])+1
 500.	ie \\n[pg@ncols]>1 \
 501.		nr pg*gutw \\n[LL]-(\\n[pg@ncols]*\\n[pg@colw])/(\\n[pg@ncols]-1)
 502.	el .nr pg*gutw 0
 503.\}
 504.DEVTAG ".mc \\n[pg@ncols] \\n[pg@colw] \\n[pg*gutw]"
 505.mk pg*col-top
 506.ns
 507.nr pg*col-num 0
 508.nr pg@fn-colw \\n[pg@colw]*5/6
 509.par@reset
 510..
 511.de 2C
 512.MC
 513..
 514.de 1C
 515.MC \\n[LL]u
 516..
 517.\" top of page macro
 518.de pg@top
 519.ch pg*footer -\\n[FM]u/2u
 520.nr PN \\n%
 521.nr pg*col-num 0
 522.nr pg@fn-bottom-margin 0
 523.po \\n[PO]u
 524.ev h
 525.par@reset
 526.sp (u;\\n[HM]/2)
 527.PT
 528.sp |\\n[HM]u
 529.if d HD .HD
 530.mk pg@header-bottom
 531.ev
 532.mk pg*col-top
 533.pg*start-col
 534..
 535.de pg*start-col
 536.\" Handle footnote overflow before floating keeps, because the keep
 537.\" might contain an embedded footnote.
 538.fn@top-hook
 539.kp@top-hook
 540.tbl@top-hook
 541.ns
 542..
 543.de pg@cs-top
 544.sp \\n[HM]u
 545.\" move pg@bottom and pg*footer out of the way
 546.ch pg@bottom \\n[.p]u*2u
 547.ch pg*footer \\n[.p]u*2u
 548.ns
 549..
 550.de pg@bottom
 551.tbl@bottom-hook
 552.if \\n[pg@fn-flag] .fn@bottom-hook
 553.nr pg*col-num +1
 554.ie \\n[pg*col-num]<\\n[pg@ncols] .pg*end-col
 555.el .pg*end-page
 556..
 557.de pg*end-col
 558'sp |\\n[pg*col-top]u
 559.po (u;\\n[PO]+(\\n[pg@colw]+\\n[pg*gutw]*\\n[pg*col-num]))
 560.\"po +(u;\\n[pg@colw]+\\n[pg*gutw])
 561.pg*start-col
 562..
 563.de pg*end-page
 564.po \\n[PO]u
 565.\" Make sure we don't exit if there are still floats or footnotes left-over.
 566.ie \\n[kp@head]<\\n[kp@tail]:\\n[fn@have-overflow] \{\
 567.	\" Switching environments ensures that we don't get an unnecessary
 568.	\" blank line at the top of the page.
 569.	ev ne
 570'	bp
 571.	ev
 572.\}
 573.el \{\
 574.	\" If the text has ended and there are no more footnotes or keeps, exit.
 575.	if \\n[pg@text-ended] .ex
 576.	if r pg*next-number \{\
 577.		pn \\n[pg*next-number]
 578.		rr pg*next-number
 579.		if d pg*next-format \{\
 580.			af PN \\*[pg*next-format]
 581.			rm pg*next-format
 582.		\}
 583.	\}
 584'	bp
 585.\}
 586..
 587.\" pg@begin number format
 588.de pg@begin
 589.ie \\n[.$]>0 \{\
 590.	nr pg*next-number (;\\$1)
 591.	ie \\n[.$]>1 .ds pg*next-format \\$2
 592.	el .rm pg*next-format
 593.\}
 594.el .rr pg*next-number
 595.pg@super-eject
 596..
 597.\" print the footer line
 598.de pg*footer
 599.ev h
 600.par@reset
 601.BT
 602.ev
 603..
 604.\" flush out any keeps or footnotes
 605.de pg@super-eject
 606.br
 607.if !'\\n(.z'' .@error-recover diversion open while ejecting page
 608.\" Make sure we stay in the end macro while there is still footnote overflow
 609.\" left, or floating keeps.
 610.while \\n[kp@tail]>\\n[kp@head]:\\n[pg@fn-flag] \{\
 611.	rs
 612.	bp
 613.\}
 614.bp
 615..
 616.nr pg@text-ended 0
 617.de pg@end-text
 618.br
 619.nr pg@text-ended 1
 620.pg@super-eject
 621..
 622.em pg@end-text
 623.\" ***************************
 624.\" ******** module fn ********
 625.\" ***************************
 626.\" Footnotes.
 627.nr fn@sep-dist 8p
 628.ev fn
 629.\" Round it vertically
 630.vs \n[fn@sep-dist]u
 631.nr fn@sep-dist \n[.v]
 632.ev
 633.nr fn*text-num 0 1
 634.nr fn*note-num 0 1
 635.ds * \\*[par@sup-start]\En+[fn*text-num]\\*[par@sup-end]
 636.nr fn*open 0
 637.\" normal FS
 638.de @FS
 639.ie \\n[.$] .fn*do-FS "\\$1" no
 640.el \{\
 641.	ie \\n[fn*text-num]>\\n[fn*note-num] .fn*do-FS \\n+[fn*note-num]
 642.	el .fn*do-FS
 643.\}
 644..
 645.\" Second argument of `no' means don't embellish the first argument.
 646.de fn*do-FS
 647.if \\n[fn*open] .@error-recover nested FS
 648.nr fn*open 1
 649.if \\n[.u] \{\
 650.	\" Ensure that the first line of the footnote is on the same page
 651.	\" as the reference.  I think this is minimal.
 652.	ev fn
 653.	nr fn*need 1v
 654.	ev
 655.	ie \\n[pg@fn-flag] .nr fn*need +\\n[fn:PD]
 656.	el .nr fn*need +\\n[fn@sep-dist]
 657.	ne \\n[fn*need]u+\\n[.V]u>?0
 658.\}
 659.ev fn
 660.par@reset-env
 661.fn*start-div
 662.par@reset
 663.ie \\n[.$] .FP \\$@
 664.el .@LP
 665..
 666.de @FE
 667.ie !\\n[fn*open] .@error FE without FS
 668.el \{\
 669.	nr fn*open 0
 670.	br
 671.	ev
 672.	fn*end-div
 673.\}
 674..
 675.nr fn@have-overflow 0
 676.\" called at the top of each column
 677.de fn@top-hook
 678.nr fn*max-width 0
 679.nr fn*page-bottom-pos 0-\\n[FM]-\\n[pg@fn-bottom-margin]
 680.ch pg@bottom \\n[fn*page-bottom-pos]u
 681.if \\n[fn@have-overflow] \{\
 682.	nr fn@have-overflow 0
 683.	fn*start-div
 684.	ev nf
 685.	fn@overflow-div
 686.	ev
 687.	fn*end-div
 688.\}
 689..
 690.\" This is called at the bottom of the column if pg@fn-flag is set.
 691.de fn@bottom-hook
 692.nr pg@fn-flag 0
 693.nr fn@have-overflow 0
 694.nr fn@bottom-pos \\n[.p]-\\n[FM]-\\n[pg@fn-bottom-margin]+\\n[.v]
 695.ev fn
 696.nr fn@bottom-pos -\\n[.v]
 697.ev
 698.ie \\n[nl]+\\n[fn@sep-dist]+\n[.V]>\\n[fn@bottom-pos] \{\
 699.	rn fn@div fn@overflow-div
 700.	nr fn@have-overflow 1
 701.\}
 702.el \{\
 703.	if \\n[pg@ncols]>1 \
 704.		if \\n[fn*max-width]>\\n[pg@fn-colw] \
 705.			nr pg@fn-bottom-margin \\n[.p]-\\n[FM]-\\n[nl]+1v
 706.	wh \\n[fn@bottom-pos]u fn*catch-overflow
 707.	fn@print-sep
 708.	ev nf
 709.	fn@div
 710.	rm fn@div
 711.	ev
 712.	if '\\n(.z'fn@overflow-div' \{\
 713.		di
 714.		nr fn@have-overflow \\n[dn]>0
 715.	\}
 716.	ch fn*catch-overflow
 717.\}
 718..
 719.de fn*catch-overflow
 720.di fn@overflow-div
 721..
 722.nr fn*embed-count 0
 723.de @div-end!fn@div
 724.br
 725.if '\\n[.ev]'fn' .ev
 726.fn*end-div
 727.nr fn*open 0
 728..
 729.als @div-end!fn*embed-div @div-end!fn@div
 730.de fn*start-div
 731.ie '\\n(.z'' \{\
 732.	da fn@div
 733.	if !\\n[pg@fn-flag] .ns
 734.\}
 735.el .di fn*embed-div
 736..
 737.de fn*end-div
 738.ie '\\n(.z'fn@div' \{\
 739.	di
 740.	nr fn*page-bottom-pos -\\n[dn]
 741.	nr fn*max-width \\n[fn*max-width]>?\\n[dl]
 742.	if !\\n[pg@fn-flag] .nr fn*page-bottom-pos -\\n[fn@sep-dist]
 743.	nr pg@fn-flag 1
 744.	nr fn*page-bottom-pos \\n[nl]-\\n[.p]+\n[.V]>?\\n[fn*page-bottom-pos]
 745.	ch pg@bottom \\n[fn*page-bottom-pos]u
 746.\}
 747.el \{\
 748.	ie '\\n(.z'fn*embed-div' \{\
 749.	di
 750.		rn fn*embed-div fn*embed-div!\\n[fn*embed-count]
 751\!.		fn*embed-start \\n[fn*embed-count]
 752.		rs
 753'		sp (u;\\n[dn]+\\n[fn@sep-dist]+\\n[.V])
 754\!.		fn*embed-end
 755.		nr fn*embed-count +1
 756.	\}
 757.	el \{\
 758.		ev fn
 759.		@error-recover unclosed diversion within footnote
 760.	\}
 761.\}
 762..
 763.de fn*embed-start
 764.ie '\\n(.z'' \{\
 765.	fn*start-div
 766.	ev nf
 767.	fn*embed-div!\\$1
 768.	rm fn*embed-div!\\$1
 769.	ev
 770.	fn*end-div
 771.	di fn*null
 772.\}
 773.el \{\
 774\!.	fn*embed-start \\$1
 775.	rs
 776.\}
 777..
 778.de fn*embed-end
 779.ie '\\n(.z'fn*null' \{\
 780.	di
 781.	rm fn*null
 782.\}
 783.el \!.fn*embed-end
 784..
 785.\" It's important that fn@print-sep use up exactly fn@sep-dist vertical space.
 786.de fn@print-sep
 787.ev fn
 788.in 0
 789.vs \\n[fn@sep-dist]u
 790\D'l 1i 0'
 791.br
 792.ev
 793..
 794.\" ***************************
 795.\" ******** module kp ********
 796.\" ***************************
 797.\" Keeps.
 798.de KS
 799.br
 800.di kp*div
 801..
 802.de KF
 803.if !'\\n(.z'' .@error-recover KF while open diversion
 804.di kp*fdiv
 805.ev k
 806.par@reset-env
 807.par@reset
 808..
 809.de KE
 810.ie '\\n(.z'kp*div' .kp*end
 811.el \{\
 812.	ie '\\n(.z'kp*fdiv' .kp*fend
 813.	el .@error KE without KS or KF
 814.\}
 815..
 816.de @div-end!kp*div
 817.kp*end
 818..
 819.de @div-end!kp*fdiv
 820.kp*fend
 821..
 822.de kp*need
 823.ie '\\n(.z'' .ds@need \\$1
 824.el \!.kp*need \\$1
 825..
 826.\" end non-floating keep
 827.de kp*end
 828.br
 829.di
 830.kp*need \\n[dn]
 831.ev nf
 832.kp*div
 833.ev
 834.rm kp*div
 835..
 836.\" Floating keeps.
 837.nr kp@head 0
 838.nr kp@tail 0
 839.\" end floating keep
 840.de kp*fend
 841.br
 842.ev
 843.di
 844.ie \\n[.t]-(\\n[.k]>0*1v)>\\n[dn] \{\
 845.	br
 846.	ev nf
 847.	kp*fdiv
 848.	rm kp*fdiv
 849.	ev
 850.\}
 851.el \{\
 852.	rn kp*fdiv kp*div!\\n[kp@tail]
 853.	nr kp*ht!\\n[kp@tail] 0\\n[dn]
 854.	nr kp@tail +1
 855.\}
 856..
 857.\" top of page processing for KF
 858.nr kp*doing-top 0
 859.de kp@top-hook
 860.if !\\n[kp*doing-top] \{\
 861.	nr kp*doing-top 1
 862.	kp*do-top
 863.	nr kp*doing-top 0
 864.\}
 865..
 866.de kp*do-top
 867.\" If the first keep won't fit, only force it out if we haven't had a footnote
 868.\" and we're at the top of the page.
 869.nr kp*force \\n[pg@fn-flag]=0&(\\n[nl]<=\\n[pg@header-bottom])
 870.nr kp*fits 1
 871.while \\n[kp@tail]>\\n[kp@head]&\\n[kp*fits] \{\
 872.	ie \\n[.t]>\\n[kp*ht!\\n[kp@head]]:\\n[kp*force] \{\
 873.		nr kp*force 0
 874.		\" It's important to advance kp@head before bringing
 875.		\" back the keep, so that if the last line of the
 876.		\" last keep springs the bottom of page trap, a new
 877.		\" page will not be started unnecessarily.
 878.		rn kp*div!\\n[kp@head] kp*temp
 879.		nr kp@head +1
 880.		ev nf
 881.		kp*temp
 882.		ev
 883.		rm kp*temp
 884.	\}
 885.	el .nr kp*fits 0
 886.\}
 887..
 888.\" ***************************
 889.\" ******** module ds ********
 890.\" ***************************
 891.\" Displays and non-floating keeps.
 892.de DE
 893.ds*end!\\n[\\n[.ev]:ds-type]
 894.nr \\n[.ev]:ds-type 0
 895..
 896.de ds@auto-end
 897.if \\n[\\n[.ev]:ds-type] \{\
 898.	@error automatically terminating display
 899.	DE
 900.\}
 901..
 902.de @div-end!ds*div
 903.ie \\n[\\n[.ev]:ds-type] .DE
 904.el .ds*end!2
 905..
 906.de ds*end!0
 907.@error DE without DS, ID, CD, LD or BD
 908..
 909.de LD
 910.br
 911.nr \\n[.ev]:ds-type 1
 912.par@reset
 913.nf
 914.sp \\n[DD]u
 915..
 916.de ID
 917.LD
 918.ie \\n[.$] .in +(n;\\$1)
 919.el .in +\\n[DI]u
 920..
 921.de CD
 922.LD
 923.ce 9999
 924..
 925.de RD
 926.LD
 927.rj 9999
 928..
 929.de ds*common-end
 930.par@reset
 931.sp \\n[DD]u
 932..
 933.als ds*end!1 ds*common-end
 934.de BD
 935.LD
 936.nr \\n[.ev]:ds-type 2
 937.di ds*div
 938..
 939.de ds*end!2
 940.br
 941.ie '\\n(.z'ds*div' \{\
 942.	di
 943.	nf
 944.	in (u;\\n[.l]-\\n[dl]/2>?0)
 945.	ds*div
 946.	rm ds*div
 947.	ds*common-end
 948.\}
 949.el .@error-recover mismatched DE
 950..
 951.de DS
 952.br
 953.di ds*div
 954.ie '\\$1'B' \{\
 955.	LD
 956.	nr \\n[.ev]:ds-type 4
 957.\}
 958.el \{\
 959.	ie '\\$1'L' .LD
 960.	el \{\
 961.		ie '\\$1'C' .CD
 962.		el \{\
 963.			ie '\\$1'R' .RD
 964.			el \{\
 965.				ie '\\$1'I' .ID \\$2
 966.				el .ID \\$1
 967.			\}
 968.		\}
 969.	\}
 970.	nr \\n[.ev]:ds-type 3
 971.\}
 972..
 973.de ds@need
 974.if '\\n(.z'' \{\
 975.	while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[pg@header-bottom]) \{\
 976.		rs
 977'		sp \\n[.t]u
 978.	\}
 979.\}
 980..
 981.de ds*end!3
 982.br
 983.ie '\\n(.z'ds*div' \{\
 984.	di
 985.	ds@need \\n[dn]
 986.	ev nf
 987.	ds*div
 988.	ev
 989.	rm ds*div
 990.	ds*common-end
 991.\}
 992.el .@error-recover mismatched DE
 993..
 994.de ds*end!4
 995.ie '\\n(.z'ds*div' \{\
 996.	br
 997.	di
 998.	nf
 999.	in (u;\\n[.l]-\\n[dl]/2>?0)
1000.	ds@need \\n[dn]
1001.	ds*div
1002.	rm ds*div
1003.	ds*common-end
1004.\}
1005.el .@error-recover mismatched DE
1006..
1007.\" ****************************
1008.\" ******** module par ********
1009.\" ****************************
1010.\" Paragraph-level formatting.
1011.\" Load time initialization.
1012.de par@load-init
1013.\" PS and VS might have been set on the command-line
1014.if !rPS .nr PS 10
1015.if !rLL .nr LL 6i
1016.ll \\n[LL]u
1017.\" don't set LT so that it can be defaulted from LL
1018.ie rLT .lt \\n[LT]u
1019.el .lt \\n[LL]u
1020.ie (\\n[PS] >= 1000) \
1021.	ps (\\n[PS]z / 1000u)
1022.el \
1023.	ps \\n[PS]
1024.\" don't set VS so that it can be defaulted from PS
1025.ie rVS \{\
1026.	ie (\\n[VS] >= 1000) \
1027.		par*vs "(\\n[VS]p / 1000u)"
1028.	el \
1029.		par*vs \\n[VS]
1030.\}
1031.el \{\
1032.	ie (\\n[PS] >= 1000) \
1033.		par*vs "((\\n[PS]p / 1000u) + 2p)"
1034.	el \
1035.		par*vs "(\\n[PS] + 2)"
1036.\}
1037.if dFAM .fam \\*[FAM]
1038.if !rHY .nr HY 14
1039.hy \\n[HY]
1040.TA
1041.CHECK-FOOTER-AND-KEEP
1042..
1043.de par*vs
1044.\" If it's too big to be in points, treat it as units.
1045.ie (p;\\$1)>=40p .vs (u;\\$1)
1046.el .vs (p;\\$1)
1047..
1048.de par@ab-indent
1049.nr 0:li (u;\\n[LL]/12)
1050.nr 0:ri \\n[0:li]
1051..
1052.de par*env-init
1053.aln \\n[.ev]:PS PS
1054.aln \\n[.ev]:VS VS
1055.aln \\n[.ev]:LL LL
1056.aln \\n[.ev]:MCLL LL
1057.aln \\n[.ev]:LT LT
1058.aln \\n[.ev]:MCLT LT
1059.aln \\n[.ev]:PI PI
1060.aln \\n[.ev]:PD PD
1061.ad \\n[par*adj]
1062.par@reset-env
1063..
1064.\" happens when the first page begins
1065.de par@init
1066.if !rLT .nr LT \\n[LL]
1067.if !rFL .nr FL \\n[LL]*5/6
1068.if !rVS \{\
1069.	ie (\\n[PS] >= 1000) \
1070.		nr VS (\\n[PS] + 2000)
1071.	el \
1072.		nr VS (\\n[PS] + 2)
1073.\}
1074.if !rDI .nr DI .5i
1075.if !rFPS \{\
1076.	ie (\\n[PS] >= 1000) \
1077.		nr FPS (\\n[PS] - 2000)
1078.	el \
1079.		nr FPS (\\n[PS] - 2)
1080.\}
1081.if !rFVS \{\
1082.	ie (\\n[FPS] >= 1000) \
1083.		nr FVS (\\n[FPS] + 2000)
1084.	el \
1085.		nr FVS (\\n[FPS] + 2)
1086.\}
1087.\" don't change environment 0
1088.ev h
1089.ie (\\n[PS] >= 1000) \
1090.	ps (\\n[PS]z / 1000u)
1091.el \
1092.	ps \\n[PS]
1093.if !rQI .nr QI 5n
1094.if !rPI .nr PI 5n
1095.ie (\\n[VS] >= 1000) \
1096.	par*vs "(\\n[VS]p / 1000u)"
1097.el \
1098.	par*vs \\n[VS]
1099.if !rPD .nr PD .3v>?\n(.V
1100.if !rDD .nr DD .5v>?\n(.V
1101.if !rFI .nr FI 2n
1102.if !rFPD .nr FPD \\n[PD]/2
1103.ev
1104.if !dFAM .ds FAM \\n[.fam]
1105.nr par*adj \\n[.j]
1106.par*env-init
1107.ev h
1108.par*env-init
1109.ev
1110.ev fn
1111.par*env-init
1112.ev
1113.ev k
1114.par*env-init
1115.ev
1116.aln 0:MCLL pg@colw
1117.aln 0:MCLT pg@colw
1118.aln k:MCLL pg@colw
1119.aln k:MCLT pg@colw
1120.aln fn:PS FPS
1121.aln fn:VS FVS
1122.aln fn:LL FL
1123.aln fn:LT FL
1124.aln fn:PI FI
1125.aln fn:PD FPD
1126.aln fn:MCLL pg@fn-colw
1127.aln fn:MCLT pg@fn-colw
1128..
1129.de par@reset-env
1130.nr \\n[.ev]:il 0
1131.nr \\n[.ev]:li 0
1132.nr \\n[.ev]:ri 0
1133.nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1134.nr \\n[.ev]:pli 0
1135.nr \\n[.ev]:pri 0
1136.nr \\n[.ev]:ds-type 0
1137..
1138.\" par@reset
1139.de par@reset
1140.br
1141.if \\n[need_eo_tl]>0 .DEVTAG-EO-TL
1142.nr need_eo_tl 0
1143.if \\n[need_eo_h]>0 .DEVTAG-EO-H
1144.nr need_eo_h 0
1145.ce 0
1146.rj 0
1147.ul 0
1148.fi
1149.ie \\n[pg@ncols]>1 \{\
1150.	ll (u;\\n[\\n[.ev]:MCLL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1151.	lt \\n[\\n[.ev]:MCLT]u
1152.\}
1153.el \{\
1154.	ll (u;\\n[\\n[.ev]:LL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1155.	lt \\n[\\n[.ev]:LT]u
1156.\}
1157.in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
1158.ft 1
1159.fam \\*[FAM]
1160.ie (\\n[\\n[.ev]:PS] >= 1000) \
1161.	ps (\\n[\\n[.ev]:PS]z / 1000u)
1162.el \
1163.	ps \\n[\\n[.ev]:PS]
1164.ie (\\n[\\n[.ev]:VS] >= 1000) \
1165.	par*vs "(\\n[\\n[.ev]:VS]p / 1000u)"
1166.el \
1167.	par*vs \\n[\\n[.ev]:VS]
1168.ls 1
1169.TA
1170.hy \\n[HY]
1171..
1172.de @RT
1173.nr \\n[.ev]:pli 0
1174.nr \\n[.ev]:pri 0
1175.par@reset
1176..
1177.\" This can be redefined by the user.
1178.de TA
1179.ta T 5n
1180..
1181.\" \n[PORPHANS] sets number of initial lines of any paragraph,
1182.\" which must be kept together, without any included page break.
1183.\" Initialise to reproduce original behaviour; user may adjust it.
1184.if !rPORPHANS .nr PORPHANS 1
1185.
1186.de par*start
1187.ds@auto-end
1188.nr \\n[.ev]:pli \\$1
1189.nr \\n[.ev]:pri \\$2
1190.par@reset
1191.sp \\n[\\n[.ev]:PD]u
1192.ne \\n[PORPHANS]v+\\n(.Vu
1193..
1194.de par@finish
1195.nr \\n[.ev]:pli 0
1196.nr \\n[.ev]:pri 0
1197.par@reset
1198..
1199.\" normal LP
1200.de @LP
1201.par*start 0 0
1202.nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1203..
1204.de @PP
1205.par*start 0 0
1206.nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1207.if !'\*(.T'html' .ti +\\n[\\n[.ev]:ai]u
1208..
1209.de @QP
1210.nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1211.par*start \\n[QI] \\n[QI]
1212..
1213.de @XP
1214.par*start \\n[\\n[.ev]:PI] 0
1215.ti -\\n[\\n[.ev]:PI]u
1216..
1217.de @IP
1218.if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1219.par*start \\n[\\n[.ev]:ai] 0
1220.if !'\\$1'' \{\
1221.	\" Divert the label so as to freeze any spaces.
1222.	di par*label
1223.	par*push-tag-env
1224\&\\$1
1225.	par*pop-tag-env
1226.	di
1227.	chop par*label
1228.	ti -\\n[\\n[.ev]:ai]u
1229.	ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \{\
1230.		DEVTAG-COL 1
1231\\*[par*label]\h'|\\n[\\n[.ev]:ai]u'\c
1232.		DEVTAG-COL 2
1233.       \}
1234.	el \{\
1235.		DEVTAG-COL 1
1236\\*[par*label]
1237.		DEVTAG-COL-NEXT 2
1238.		br
1239.	\}
1240.	rm par*label
1241.\}
1242..
1243.\" We don't want margin characters to be attached when we divert
1244.\" the tag.  Since there's no way to save and restore the current
1245.\" margin character, we have to switch to a new environment, taking
1246.\" what we need of the old environment with us.
1247.de par*push-tag-env
1248.nr par*saved-font \\n[.f]
1249.nr par*saved-size \\n[.s]z
1250.nr par*saved-ss \\n[.ss]
1251.ds par*saved-fam \\n[.fam]
1252.ev par
1253.nf
1254.TA
1255.ft \\n[par*saved-font]
1256.ps \\n[par*saved-size]u
1257.ss \\n[par*saved-ss]
1258.fam \\*[par*saved-fam]
1259..
1260.de par*pop-tag-env
1261.ev
1262..
1263.de @RS
1264.br
1265.nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1266.nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1267.nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1268.nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1269.nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1270.nr \\n[.ev]:il +1
1271.nr \\n[.ev]:li +\\n[\\n[.ev]:ai]
1272.nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1273.par@reset
1274..
1275.de @RE
1276.br
1277.ie \\n[\\n[.ev]:il] \{\
1278.	nr \\n[.ev]:il -1
1279.	nr \\n[.ev]:ai \\n[\\n[.ev]:ai!\\n[\\n[.ev]:il]]
1280.	nr \\n[.ev]:li \\n[\\n[.ev]:li!\\n[\\n[.ev]:il]]
1281.	nr \\n[.ev]:ri \\n[\\n[.ev]:ri!\\n[\\n[.ev]:il]]
1282.	nr \\n[.ev]:pli \\n[\\n[.ev]:pli!\\n[\\n[.ev]:il]]
1283.	nr \\n[.ev]:pri \\n[\\n[.ev]:pri!\\n[\\n[.ev]:il]]
1284.\}
1285.el .@error unbalanced \\$0
1286.par@reset
1287..
1288.de @QS
1289.br
1290.nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1291.nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1292.nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1293.nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1294.nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1295.nr \\n[.ev]:il +1
1296.nr \\n[.ev]:li +\\n[QI]
1297.nr \\n[.ev]:ri +\\n[QI]
1298.nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1299.par@reset
1300..
1301.als @QE @RE
1302.\" start boxed text
1303.de B1
1304.br
1305.HTML-IMAGE
1306.di par*box-div
1307.nr \\n[.ev]:li +1n
1308.nr \\n[.ev]:ri +1n
1309.nr par*box-in \\n[.in]
1310.\" remember what 1n is, just in case the point size changes
1311.nr par*box-n 1n
1312.in +1n
1313.ll -1n
1314.lt -1n
1315.ti \\n[par*box-in]u+1n
1316..
1317.de @div-end!par*box-div
1318.B2
1319..
1320.\" end boxed text
1321.\" Postpone the drawing of the box until we're in the top-level diversion,
1322.\" in case there's a footnote inside the box.
1323.de B2
1324.ie '\\n(.z'par*box-div' \{\
1325.	br
1326.	if \n[.V]>.25m .sp
1327.	di
1328.	if \n[.V]>.25m .sp
1329.	ds@need \\n[dn]
1330.	par*box-mark-top
1331.	ev nf
1332.	par*box-div
1333.	ev
1334.	nr \\n[.ev]:ri -\\n[par*box-n]
1335.	nr \\n[.ev]:li -\\n[par*box-n]
1336.	in -\\n[par*box-n]u
1337.	ll +\\n[par*box-n]u
1338.	lt +\\n[par*box-n]u
1339.	par*box-draw \\n[.i]u \\n[.l]u-(\\n[.H]u==1n*1n)
1340.\}
1341.el .@error B2 without B1
1342.HTML-IMAGE-END
1343..
1344.de par*box-mark-top
1345.ie '\\n[.z]'' \{\
1346.	rs
1347.	mk par*box-top
1348.\}
1349.el \!.par*box-mark-top
1350..
1351.de par*box-draw
1352.ie '\\n[.z]'' \{\
1353.	nr par*box-in \\n[.i]
1354.	nr par*box-ll \\n[.l]
1355.	nr par*box-vpt \\n[.vpt]
1356.	nr par*box-ad \\n[.j]
1357.	ad l
1358.	vpt 0
1359.	in \\$1
1360.	ll \\$2
1361\v'-1v+.25m'\
1362\D'l (u;\\n[.l]-\\n[.i]) 0'\
1363\D'l 0 |\\n[par*box-top]u'\
1364\D'l -(u;\\n[.l]-\\n[.i]) 0'\
1365\D'l 0 -|\\n[par*box-top]u'
1366.	br
1367.	sp -1
1368.	in \\n[par*box-in]u
1369.	ll \\n[par*box-ll]u
1370.	vpt \\n[par*box-vpt]
1371.	ad \\n[par*box-ad]
1372.\}
1373.el \!.par*box-draw \\$1 \\$2
1374..
1375.\" \n[HORPHANS] sets how many lines of the following paragraph must be
1376.\" kept together, with a preceding section header.  Initialise it,
1377.\" to reproduce original behaviour; user may change it.
1378.if !rHORPHANS .nr HORPHANS 1
1379.
1380.\" \n[GROWPS] and \n[PSINCR] cause auto-increment of header point size.
1381.\" Initialise them, so they have no effect, unless explicitly set by the user.
1382.if !rGROWPS .nr GROWPS 0
1383.if !rPSINCR .nr PSINCR 1p
1384.
1385.de SH-NO-TAG
1386.par@finish
1387.\" Keep the heading and the first few lines of the next paragraph together.
1388.\" (\n[HORPHANS] defines "first few" -- default = 1; user may redefine it).
1389.nr sh*minvs \\n[HORPHANS]v
1390.if \\n[sh*psincr]<0 .nr sh*psincr 0
1391.ie \\n(VS<1000 .par*vs \\n(VSp+\\n[sh*psincr]u
1392.el .par*vs \\n(VSp/1000u+\\n[sh*psincr]u
1393.ne 2v+\\n[sh*minvs]u+\\n[\\n[.ev]:PD]u+\\n(.Vu
1394.\" Adjust point size for heading text, as specified by \n[GROWPS] and \n[PSINCR].
1395.ie \\n(PS<1000 .ps \\n(PS+\\n[sh*psincr]u
1396.el .ps \\n(PSz/1000u+\\n[sh*psincr]u
1397.sp 1
1398.ft B
1399..
1400.de @SH
1401.\" Standard ms implementation does not expect an argument,
1402.\" but allow ".SH n" to make heading point size match ".NH n",
1403.\" for same "n", when \n[GROWPS] and \n[PSINCR] are set.
1404.  nr sh*psincr 0
1405.  if 0\\$1>0 .nr sh*psincr (\\n[GROWPS]-0\\$1)*\\n[PSINCR]
1406.  SH-NO-TAG
1407.  DEVTAG-SH 1
1408.  if '\*(.T'html' .nr need_eo_h 1
1409..
1410.\" TL, AU, and AI are aliased to these in cov*ab-init.
1411.de par@TL
1412.par@finish
1413.sp 1
1414.ft B
1415.ps +2
1416.vs +3p
1417.ce 9999
1418.DEVTAG-TL
1419.nr need_eo_tl 1
1420..
1421.de par@AU
1422.par@finish
1423.sp 1
1424.ft I
1425.ce 9999
1426..
1427.de par@AI
1428.par@finish
1429.sp .5
1430.ce 9999
1431..
1432.\" In paragraph macros.
1433.de NL
1434.ie (\\n[\\n[.ev]:PS] >= 1000) \
1435.	ps (\\n[\\n[.ev]:PS]z / 1000u)
1436.el \
1437.	ps \\n[\\n[.ev]:PS]
1438..
1439.de SM
1440.ps -2
1441..
1442.de LG
1443.ps +2
1444..
1445.de R
1446.ft R
1447..
1448.\" par*define-font-macro macro font
1449.de par*define-font-macro
1450.de \\$1
1451.ie \\\\n[.$] \{\
1452.	nr par*prev-font \\\\n[.f]
1453\&\\\\$3\f[\\$2]\\\\$1\f[\\\\n[par*prev-font]]\\\\$2
1454.\}
1455.el .ft \\$2
1456\\..
1457..
1458.par*define-font-macro B B
1459.par*define-font-macro I I
1460.par*define-font-macro BI BI
1461.par*define-font-macro CW CR
1462.\" underline a word
1463.de UL
1464\Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m'\\$2
1465..
1466.\" box a word
1467.de BX
1468.nr par*bxw \w'\\$1'+.4m
1469\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
1470\Z'\h'.2m'\\$1'\
1471\h'\\n[par*bxw]u'
1472..
1473.\" The first time UX is used, put a registered mark after it.
1474.ds par*ux-rg \(rg
1475.de UX
1476\s[\\n[.s]*8u/10u]UNIX\s0\\$1\\*[par*ux-rg]
1477.ds par*ux-rg
1478..
1479.ds par@sup-start \v'-.9m\s'\En[.s]*7u/10u'+.7m'
1480.als { par@sup-start
1481.ds par@sup-end \v'-.7m\s0+.9m'
1482.als } par@sup-end
1483.\" footnote paragraphs
1484.\" FF is the footnote format
1485.nr FF 0
1486.\" This can be redefined. It gets a second argument of `no' if the first
1487.\" argument was supplied by the user, rather than automatically.
1488.de FP
1489.br
1490.if !d par*fp!\\n[FF] \{\
1491.	@error unknown footnote format `\\n[FF]'
1492.	nr FF 0
1493.\}
1494.ie '\\$2'no' .par*fp!\\n[FF]-no "\\$1"
1495.el .par*fp!\\n[FF] "\\$1"
1496..
1497.de par*fp!0
1498.@PP
1499\&\\*[par@sup-start]\\$1\\*[par@sup-end]\ \c
1500..
1501.de par*fp!0-no
1502.@PP
1503\&\\$1\ \c
1504..
1505.de par*fp!1
1506.@PP
1507\&\\$1.\ \c
1508..
1509.de par*fp!1-no
1510.@PP
1511\&\\$1\ \c
1512..
1513.de par*fp!2
1514.@LP
1515\&\\$1.\ \c
1516..
1517.de par*fp!2-no
1518.@LP
1519\&\\$1\ \c
1520..
1521.de par*fp!3
1522.@IP "\\$1." (u;\\n[\\n[.ev]:PI]*2)
1523..
1524.de par*fp!3-no
1525.@IP "\\$1" (u;\\n[\\n[.ev]:PI]*2)
1526..
1527.\" ***************************
1528.\" ******** module nh ********
1529.\" ***************************
1530.\" Numbered headings.
1531.\" nh*hl is the level of the last heading
1532.nr nh*hl 0
1533.\" numbered heading
1534.de @NH
1535.ie '\\$1'S' \{\
1536.	shift
1537.	nr nh*hl 0
1538.	while \\n[.$] \{\
1539.		nr nh*hl +1
1540.		nr H\\n[nh*hl] 0\\$1
1541.		shift
1542.	\}
1543.	if !\\n[nh*hl] \{\
1544.		nr H1 1
1545.		nr nh*hl 1
1546.		@error missing arguments to .NH S
1547.	\}
1548.\}
1549.el \{\
1550.	nr nh*ohl \\n[nh*hl]
1551.	ie \\n[.$] \{\
1552.		nr nh*hl 0\\$1
1553.		ie \\n[nh*hl]<=0 \{\
1554.			nr nh*ohl 0
1555.			nr nh*hl 1
1556.		\}
1557.		el \{\
1558.			if \\n[nh*hl]-\\n[nh*ohl]>1 \
1559.				@warning .NH \\n[nh*ohl] followed by .NH \\n[nh*hl]
1560.		\}
1561.	\}
1562.	el .nr nh*hl 1
1563.	while \\n[nh*hl]>\\n[nh*ohl] \{\
1564.		nr nh*ohl +1
1565.		nr H\\n[nh*ohl] 0
1566.	\}
1567.	nr H\\n[nh*hl] +1
1568.\}
1569.ds SN-NO-DOT \\n(H1
1570.nr nh*i 1
1571.while \\n[nh*i]<\\n[nh*hl] \{\
1572.	nr nh*i +1
1573.	as SN-NO-DOT .\\n[H\\n[nh*i]]
1574.\}
1575.ds SN-DOT \\*[SN-NO-DOT].
1576.if !dSN .als SN SN-DOT
1577.nr sh*psincr (\\n[GROWPS]-\\n[nh*hl])*\\n[PSINCR]
1578.SH-NO-TAG
1579.DEVTAG-NH "\\$1"
1580.  if '\*(.T'html' .nr need_eo_h 1
1581\\*[SN-DOT]
1582..
1583.\" ****************************
1584.\" ******** module toc ********
1585.\" ****************************
1586.\" Table of contents generation.
1587.de @XS
1588.da toc*div
1589.ev h
1590.ie \\n[.$] .XA "\\$1"
1591.el .XA
1592..
1593.de @div-end!toc*div
1594.XE
1595..
1596.de XA
1597.ie '\\n(.z'toc*div' \{\
1598.	if d toc*num .toc*end-entry
1599.	ie \\n[.$] \{\
1600.		ie '\\$1'no' .ds toc*num
1601.		el .ds toc*num "\\$1
1602.	\}
1603.	el .ds toc*num \\n[PN]
1604.	br
1605.	par@reset
1606.	na
1607.	ll -8n
1608.	in (n;0\\$2)
1609.\}
1610.el .@error XA without XS
1611..
1612.de XE
1613.ie '\\n(.z'toc*div' \{\
1614.	if d toc*num .toc*end-entry
1615.	ev
1616.	di
1617.\}
1618.el .@error XE without XS
1619..
1620.de toc*end-entry
1621\\a\\t\\*[toc*num]
1622.br
1623.rm toc*num
1624..
1625.de PX
1626.1C
1627.if !'\\$1'no' \{\
1628.	ce 1
1629.	ie (\\n[PS] >= 1000) \
1630.		ps ((\\n[PS]z / 1000u) + 2z)
1631.	el \
1632.		ps \\n[PS]+2
1633.	ft B
1634\\*[TOC]
1635.	ft
1636.	ps
1637.\}
1638.nf
1639.char \[toc*leader-char] .\h'1m'
1640.lc \[toc*leader-char]
1641.ta (u;\\n[.l]-\\n[.i]-\w'000') (u;\\n[.l]-\\n[.i])R
1642.sp 2
1643.toc*div
1644.par@reset
1645..
1646.\" print the table of contents on page i
1647.de TC
1648.P1
1649.pg@begin 1 i
1650.PX \\$1
1651..
1652.\" ****************************
1653.\" ******** module eqn ********
1654.\" ****************************
1655.\" Eqn support.
1656.de EQ
1657..
1658.de EN
1659..
1660.de @EQ
1661.br
1662.ds eqn*num "\\$2
1663.ie '\\$1'L' .nr eqn*type 0
1664.el \{\
1665.	ie '\\$1'I' .nr eqn*type 1
1666.	el \{\
1667.		nr eqn*type 2
1668.		if !'\\$1'C' .ds eqn*num "\\$1
1669.	\}
1670.\}
1671.di eqn*div
1672.in 0
1673.if \\n[eqn*type]=0 .HTML-IMAGE-LEFT
1674.if \\n[eqn*type]=1 \{\
1675.   if '\*(.T'html' .RS
1676.   HTML-IMAGE-INLINE
1677.\}
1678.if \\n[eqn*type]=2 .HTML-IMAGE
1679.nf
1680..
1681.de @div-end!eqn*div
1682.@EN
1683..
1684.\" Note that geqn mark and lineup work correctly in centered equations.
1685.de @EN
1686.ie !'\\n(.z'eqn*div' .@error-recover mismatched EN
1687.el \{\
1688.	br
1689.	di
1690.	nr eqn*have-num 0
1691.	if !'\\*[eqn*num]'' .nr eqn*have-num 1
1692.	ie \\n[dl]:\\n[eqn*have-num] \{\
1693.               sp \\n[DD]u
1694.		par@reset
1695.		ds eqn*tabs \\n[.tabs]
1696.		nf
1697.		ie \\n[dl] \{\
1698.\"                     --fixme-- this really should not be necessary
1699.\"                     and indicates that there is extra space creeping into
1700.\"                     an equation when ps4html is enabled..
1701.                       ie r ps4html .ds@need \\n[dn]u-1v+\n[.V]u+1i
1702.                       el .ds@need \\n[dn]u-1v+\n[.V]u
1703.			chop eqn*div
1704.			ie \\n[eqn*type]=0 \{\
1705.				ta (u;\\n[.l]-\\n[.i])R
1706\\*[eqn*div]\t\\*[eqn*num]
1707.			\}
1708.			el \{\
1709.				ie \\n[eqn*type]=1 .ta \\n[DI]u \
1710(u;\\n[.l]-\\n[.i])R
1711.				el .ta (u;\\n[.l]-\\n[.i]/2)C \
1712(u;\\n[.l]-\\n[.i])R
1713\t\\*[eqn*div]\t\\*[eqn*num]
1714.			\}
1715.		\}
1716.		el \{\
1717.			ta (u;\\n[.l]-\\n[.i])R
1718\t\\*[eqn*num]
1719.		\}
1720.\".               if !'\*(.T'html' .sp \\n[DD]u
1721.               sp \\n[DD]u
1722.		ta \\*[eqn*tabs]
1723.	\}
1724.	el \{
1725.\" must terminate empty equations in html and ps4html as they contain
1726.\" the HTML-IMAGE-END suppression nodes
1727.		if \\n[dl] .chop eqn*div
1728.		if '\*(.T'html' \\*[eqn*div]
1729.		if r ps4html    \\*[eqn*div]
1730.	\}
1731.       if !'\*(.T'html' .fi
1732.	if \\n[eqn*type]=0 .HTML-IMAGE-END
1733.	if \\n[eqn*type]=1 \{\
1734.		HTML-IMAGE-END
1735.		if '\*(.T'html' .RE
1736.	\}
1737.	if \\n[eqn*type]=2 .HTML-IMAGE-END
1738.\}
1739..
1740.\" ****************************
1741.\" ******** module tbl ********
1742.\" ****************************
1743.\" Tbl support.
1744.nr tbl*have-header 0
1745.\" This gets called if TS occurs before the first paragraph.
1746.de TS
1747.LP
1748.\" cov*ab-init aliases TS to @TS
1749\\*[TS]\\
1750..
1751.de @TS
1752.sp \\n[DD]u
1753.if '\\$1'H' .di tbl*header-div
1754.HTML-IMAGE
1755..
1756.de tbl@top-hook
1757.if \\n[tbl*have-header] \{\
1758.	ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl*print-header
1759.	el .sp \\n[.t]u
1760.\}
1761..
1762.de tbl*print-header
1763.ev nf
1764.tbl*header-div
1765.ev
1766.mk #T
1767..
1768.de TH
1769.ie '\\n[.z]'tbl*header-div' \{\
1770.	nr T. 0
1771.	T#
1772.	br
1773.	di
1774.	ie \\n[dn]+\\n[FM]+\\n[HM]+2v>=\\n[.p] \{\
1775.		@error ridiculously long table header
1776.		ds@need \\n[dn]
1777.		tbl*print-header
1778.	\}
1779.	el \{\
1780.		nr tbl*header-ht \\n[dn]
1781.		ds@need \\n[dn]u+1v
1782.		tbl*print-header
1783.		nr tbl*have-header 1
1784.	\}
1785.\}
1786.el .@error-recover .TH without .TS H
1787..
1788.de @div-end!tbl*header-div
1789.TH
1790.TE
1791..
1792.de TE
1793.ie '\\n(.z'tbl*header-div' .@error-recover .TS H but no .TH before .TE
1794.el \{\
1795.	nr tbl*have-header 0
1796.       if !'\*(.T'html' .sp \\n[DD]u
1797.\}
1798.	HTML-IMAGE-END
1799.\" reset tabs
1800.TA
1801..
1802.de tbl@bottom-hook
1803.if \\n[tbl*have-header] \{\
1804.	nr T. 1
1805.	T#
1806.\}
1807..
1808.de T&
1809..
1810.\" ****************************
1811.\" ******** module pic ********
1812.\" ****************************
1813.\" Pic support.
1814.\" PS height width
1815.de PS
1816.br
1817.sp \\n[DD]u
1818.ie \\n[.$]<2 .@error bad arguments to PS (not preprocessed with pic?)
1819.el \{\
1820.	ds@need (u;\\$1)+1v
1821.	in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
1822.\}
1823.HTML-IMAGE
1824..
1825.de PE
1826.HTML-IMAGE-END
1827.par@reset
1828.sp \\n[DD]u+.5m
1829..
1830.\" ****************************
1831.\" ******** module ref ********
1832.\" ****************************
1833.\" Refer support.
1834.de ]-
1835.rm [A [B [C [D [E [G [I [J [N [O [P [Q [R [S [T [V
1836.rm ref*string
1837..
1838.\" Other
1839.ds ref*spec!0 Q A T1 S V N P I C D O
1840.\" Journal article
1841.ds ref*spec!1 Q A T2 J S V N P I C D O
1842.\" Book
1843.ds ref*spec!2 Q A T1 S V P I C D O
1844.\" Article within book
1845.ds ref*spec!3 Q A T2 B E S V P I C D O
1846.\" Tech report
1847.ds ref*spec!4 Q A T2 R G P I C D O
1848.\" ][ type
1849.de ][
1850.if r [T \{\
1851.	als [T1 [T
1852.	als [T2 [T
1853.\}
1854.ie d ref*spec!\\$1 .ref*build \\*[ref*spec!\\$1]
1855.el \{\
1856.	@error unknown reference type `\\$1'
1857.	ref*build \\*[ref*spec!0]
1858.\}
1859.ref*print
1860.rm ref*string
1861.rm [F [T1 [T2
1862..
1863.\" start of reference number
1864.ds [. \\*[par@sup-start]
1865.\" end of reference number
1866.ds .] \\*[par@sup-end]
1867.\" period before reference
1868.ds <. .
1869.\" period after reference
1870.ds >. \" empty
1871.\" comma before reference
1872.ds <, ,
1873.\" comma after reference
1874.ds >, \" empty
1875.\" start collected references
1876.de ]<
1877.als ref*print ref*end-print
1878.SH
1879\&\\*[REFERENCES]
1880.par@reset
1881..
1882.\" end collected references
1883.de ]>
1884.par@finish
1885.als ref*print ref*normal-print
1886..
1887.de ref*normal-print
1888.ie d [F .FS "\\*([.\\*([F\\*(.]"
1889.el .FS \&
1890\\*[ref*string]
1891.FE
1892..
1893.de ref*end-print
1894.ie d [F .IP "\\*([F."
1895.el .XP
1896\\*[ref*string]
1897..
1898.als ref*print ref*normal-print
1899.de ref*build
1900.rm ref*string ref*post-punct
1901.nr ref*suppress-period 1
1902.while \\n[.$] \{\
1903.	if d [\\$1 \{\
1904.		ie d ref*add-\\$1 .ref*add-\\$1
1905.		el .ref*add-dflt \\$1
1906.	\}
1907.	shift
1908.\}
1909.\" now add a final period
1910.ie d ref*string \{\
1911.	if !\\n[ref*suppress-period] .as ref*string .
1912.	if d ref*post-punct \{\
1913.		as ref*string "\\*[ref*post-punct]
1914.		rm ref*post-punct
1915.	\}
1916.\}
1917.el .ds ref*string
1918..
1919.de ref*add-T1
1920.ref*field T , "\fI" "" "\fP"
1921.if r [T .nr ref*suppress-period \\n([T
1922..
1923.de ref*add-T2
1924.ref*field T , "\\*Q" "" "\\*U"
1925.if r [T .nr ref*suppress-period \\n([T
1926..
1927.de ref*add-P
1928.ie \\n([P>0 .ref*field P , "pp. "
1929.el .ref*field P , "p. "
1930..
1931.de ref*add-J
1932.ref*field J , \fI "" \fP
1933..
1934.de ref*add-D
1935.ref*field D "" ( )
1936..
1937.de ref*add-E
1938.ref*field E , "ed. "
1939..
1940.de ref*add-G
1941.ref*field G "" ( )
1942..
1943.de ref*add-B
1944.ref*field B "" "in \fI" "" \fP
1945..
1946.de ref*add-O
1947.ref*field O .
1948.ie r [O .nr ref*suppress-period \\n([O
1949.el .nr ref*suppress-period 1
1950..
1951.de ref*add-A
1952.ref*field A ,
1953.if r [A .nr ref*suppress-period \\n([A
1954..
1955.de ref*add-V
1956.ref*field V "" \fB \fR
1957..
1958.de ref*add-N
1959.ref*field N \z( "" ")"
1960..
1961.de ref*add-dflt
1962.ref*field \\$1 ,
1963..
1964.\" First argument is the field letter.
1965.\" Second argument is the punctuation character to use to separate this field
1966.\" from the previous field.
1967.\" Third argument is a string with which to prefix this field.
1968.\" Fourth argument is a string with which to postfix this field.
1969.\" Fifth argument is a string to add after the punctuation character supplied
1970.\" by the next field.
1971.de ref*field
1972.if d ref*string \{\
1973.	ie d ref*post-punct \{\
1974.		as ref*string "\\$2\\*[ref*post-punct] \"
1975.		rm ref*post-punct
1976.	\}
1977.	el .as ref*string "\\$2 \"
1978.\}
1979.as ref*string "\\$3\\*([\\$1\\$4
1980.if \\n[.$]>4 .ds ref*post-punct "\\$5
1981.nr ref*suppress-period 0
1982..
1983.\" ****************************
1984.\" ******** module acc ********
1985.\" ****************************
1986.\" Accents and special characters.
1987.ds Q \(lq
1988.ds U \(rq
1989.ds - \(em
1990.\" Characters
1991.\" The idea of this definition is for the top of the 3 to be at the x-height.
1992.if !c\[yogh] .char \[yogh] \Z'\v'\w'x'*0-\En[rst]u'\s[\En[.s]*8u/10u]\
1993\v'\w'3'*0+\En[rst]u'3\s0'\h'\w'\s[\En[.s]*8u/10u]3'u'
1994.\" Accents
1995.de acc*over-def
1996.ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
1997\h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
1998..
1999.de acc*under-def
2000.ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
2001..
2002.de acc*slash-def
2003.ds \\$1 \Z'\h'(u;-\En[.w]-\w'\\$2'/2)'\
2004\v'(u;\En[.cdp]-\En[.cht]+\En[rst]+\En[rsb]/2)'\\$2'
2005..
2006.de acc*prefix-def
2007.ds \\$1 \Z'\h'(u;\w'x'-\w'\\$2'/2)'\\$2'
2008..
2009.acc*prefix-def ' \'
2010.acc*prefix-def ` \`
2011.acc*prefix-def ^ ^
2012.acc*prefix-def , \(ac
2013.acc*prefix-def : \(ad
2014.acc*prefix-def ~ ~
2015.\" improved accent marks
2016.de AM
2017.acc*over-def ' \'
2018.acc*over-def ` \`
2019.acc*over-def ^ ^
2020.acc*over-def ~ ~
2021.acc*over-def : \(ad
2022.acc*over-def v \(ah
2023.acc*over-def _ \(a-
2024.acc*over-def o \(ao
2025.acc*under-def , \(ac
2026.acc*under-def . \s[\En[.s]*8u/10u]\v'.2m'.\v'-.2m'\s0
2027.acc*under-def hook \(ho
2028.acc*slash-def / /
2029.char \[hooko] o\\\\*[hook]
2030.ds q \[hooko]
2031.ds 3 \[yogh]
2032.ds D- \(-D\"			Icelandic uppercase eth
2033.ds d- \(Sd\"			Icelandic lowercase eth
2034.ds Th \(TP\"			Icelandic uppercase thorn
2035.ds th \(Tp\"			Icelandic lowercase thorn
2036.ds 8 \(ss\"			German double s
2037.ds Ae \(AE\"			AE ligature
2038.ds ae \(ae\"			ae ligature
2039.ds Oe \(OE\"			OE ligature
2040.ds oe \(oe\"			oe ligature
2041.ds ? \(r?\"			upside down ?
2042.ds ! \(r!\"			upside down !
2043..
2044.de CHECK-FOOTER-AND-KEEP
2045.\" it might be better to als FS -> B1 and FE -> B2
2046.\" however this produced wierd results, so I've moved back to a more reliable
2047.\" but less interesting solution --fixme--
2048.   if '\*(.T'html' \{\
2049.	rm KF
2050.	als KF KS
2051.	rm FS
2052.	de FS
2053.		br
2054.		HTML-IMAGE
2055\\..
2056.	rm FE
2057.	de FE
2058.		br
2059.		HTML-IMAGE-END
2060\\..
2061.   \}
2062.   if r ps4html \{\
2063.	rm FS
2064.	de FS
2065.		br
2066.		HTML-IMAGE
2067\\..
2068.	rm FE
2069.	de FE
2070.		br
2071.		HTML-IMAGE-END
2072\\..
2073.   \}
2074..
2075.par@load-init
2076.\" Make sure that no blank lines creep in at the end of this file.