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