PageRenderTime 74ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/groff/contrib/mm/m.tmac

https://bitbucket.org/freebsd/freebsd-head/
Unknown | 3536 lines | 3530 code | 6 blank | 0 comment | 0 complexity | bec6fe6abc9267b7102c33c011b42f2f MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, BSD-3-Clause, LGPL-2.0, LGPL-2.1, BSD-2-Clause, 0BSD, JSON, AGPL-1.0, GPL-2.0
  1. .\"
  2. .de @revision
  3. .ds RE \\$2
  4. ..
  5. .\"
  6. .\" $Id: m.tmac,v 2.26 2005/05/26 06:28:38 wl Exp $
  7. .@revision $Revision: 2.26 $
  8. .ig
  9. Copyright (C) 1991-2000, 2001, 2002, 2003, 2004, 2005
  10. Free Software Foundation, Inc.
  11. mgm is written by Jörgen Hägg <jh@axis.com>
  12. mgm is free software; you can redistribute it and/or modify it under
  13. the terms of the GNU General Public License as published by the Free
  14. Software Foundation; either version 2, or (at your option) any later
  15. version.
  16. mgm is distributed in the hope that it will be useful, but WITHOUT ANY
  17. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  18. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  19. for more details.
  20. You should have received a copy of the GNU General Public License along
  21. with groff; see the file COPYING. If not, write to the Free Software
  22. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23. Please send bugreports with examples to jh@axis.com.
  24. Naming convention stolen from mgs.
  25. Local names module*name
  26. Extern names module@name
  27. Env.var environ:name
  28. Index array!index
  29. ..
  30. .if !\n(.g .ab These mm macros require groff.
  31. .do if d PH .nx
  32. .if \n(.C .ab The groff mm macros do not work in compatibility mode.
  33. .if (\n[.warn] == 65543) .warn
  34. .mso devtag.tmac
  35. .\" ######## init #######
  36. .\" Contents level [0:14], contents saved if heading level <= Cl
  37. .nr Cl 2
  38. .\" Eject page between LIST OF XXXX if Cp == 0
  39. .nr Cp 0
  40. .\" Debugflag
  41. .if !r D .nr D 0
  42. .\" Eject after floating display is output [0:1]
  43. .nr De 0
  44. .\" Floating keep output [0;5]
  45. .nr Df 5
  46. .\" space before and after display if == 1 [0:1]
  47. .nr Ds 1
  48. .\" Eject page
  49. .nr Ej 0
  50. .\" Equation label adjust 0=left, 1=right
  51. .nr Eq 0
  52. .\" Em dash string
  53. .ie n .ds EM " --
  54. .el .ds EM \(em
  55. .\" Footnote spacing
  56. .nr Fs 1
  57. .\" H1-H7 heading counters
  58. .nr H1 0 1
  59. .nr H2 0 1
  60. .nr H3 0 1
  61. .nr H4 0 1
  62. .nr H5 0 1
  63. .nr H6 0 1
  64. .nr H7 0 1
  65. .nr H8 0 1
  66. .nr H9 0 1
  67. .nr H10 0 1
  68. .nr H11 0 1
  69. .nr H12 0 1
  70. .nr H13 0 1
  71. .nr H14 0 1
  72. .\" Heading break level [0:14]
  73. .nr Hb 2
  74. .\" heading centering level, [0:14]
  75. .nr Hc 0
  76. .\" header format
  77. .ds HF 2 2 2 2 2 2 2 2 2 2 2 2 2 2
  78. .\" heading temp. indent [0:2]
  79. .\" 0 -> 0 indent, left margin
  80. .\" 1 -> indent to right , like .P 1
  81. .\" 2 -> indent to line up with text part of preceding heading
  82. .nr Hi 1
  83. .\" header pointsize
  84. .ds HP 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  85. .\" heading space level [0:14]
  86. .nr Hs 2
  87. .\" heading numbering type
  88. .\" 0 -> multiple (1.1.1 ...)
  89. .\" 1 -> single
  90. .nr Ht 0
  91. .\" Unnumbered heading level
  92. .nr Hu 2
  93. .\" hyphenation in body
  94. .\" 0 -> no hyphenation
  95. .\" 1 -> hyphenation 14 on
  96. .nr Hy 0
  97. .\" text for toc, selfexplanatory. Look in the new variable section
  98. .ds Lf LIST OF FIGURES
  99. .nr Lf 1
  100. .ds Lt LIST OF TABLES
  101. .nr Lt 1
  102. .ds Lx LIST OF EXHIBITS
  103. .nr Lx 1
  104. .ds Le LIST OF EQUATIONS
  105. .nr Le 0
  106. .\" List indent, used by .AL
  107. .nr Li 6
  108. .\" List space, if listlevel > Ls then no spacing will occur around lists.
  109. .nr Ls 99
  110. .\" Numbering style [0:5]
  111. .if !r N .nr N 0
  112. .\" numbered paragraphs
  113. .\" 0 == not numbered
  114. .\" 1 == numbered in first level headings.
  115. .nr Np 0
  116. .\" Format of figure,table,exhibit,equation titles.
  117. .\" 0= ". ", 1=" - "
  118. .nr Of 0
  119. .\" Table of contents page numbering style
  120. .nr Oc 0
  121. .\" Page-number, normally same as %.
  122. .nr P 0
  123. .\" paragraph indent
  124. .nr Pi 5
  125. .\" paragraph spacing
  126. .nr Ps 1
  127. .\" paragraph type
  128. .\" 0 == left-justified
  129. .\" 1 == indented .P
  130. .\" 2 == indented .P except after .H, .DE or .LE.
  131. .nr Pt 0
  132. .\" Reference title
  133. .ds Rp REFERENCES
  134. .\" Display indent
  135. .nr Si 5
  136. .\"
  137. .\" Current state of TOC, empty outside TC, inside
  138. .\" it will be set to co,fg,tb,ec,ex or ap.
  139. .ds Tcst
  140. .\"
  141. .ds Tm \(tm
  142. .\"
  143. .\"---------------------------------------------
  144. .\" Internal global variables
  145. .\"
  146. .\" This is for cover macro .MT
  147. .\" .ds @language
  148. .\"
  149. .nr @copy_type 0
  150. .if r C .nr @copy_type \n[C]
  151. .\" >0 if Subject/Date/From should be bold, roman otherwise
  152. .ie n .ds @sdf_font R
  153. .el .ds @sdf_font B
  154. .if \n[@copy_type]=4 \{\
  155. . ls 2
  156. . nr Pi 10
  157. . nr Pt 1
  158. .\}
  159. .\"
  160. .\"
  161. .if r E \{\
  162. . ie \n[E] .ds @sdf_font B
  163. . el .ds @sdf_font R
  164. .\}
  165. .\"
  166. .\" Current pointsize and vertical space, always in points.
  167. .if !r S .nr S 10
  168. .ps \n[S]
  169. .vs \n[S]+2
  170. .\"
  171. .nr @ps \n[.ps]
  172. .nr @vs \n[.v]
  173. .if \n[D]>1 .tm @ps=\n[@ps], @vs=\n[@vs]
  174. .if \n[D]>3 .tm INIT: l:\n[.l] p:\n[.p] o:\n[.o]
  175. .\"
  176. .\" Page length
  177. .if r L \{\
  178. . ie n .pl \n[L]u
  179. . el .pl \n[L]u
  180. .\}
  181. .nr @pl \n[.p]
  182. .\"
  183. .\" page width
  184. .ie r W \{\
  185. . ie n .ll \n[W]u
  186. . el .ll \n[W]u
  187. .\}
  188. .el .ll 6i
  189. .nr @ll \n[.l]
  190. .nr @cur-ll \n[@ll]
  191. .lt \n[@ll]u
  192. .\"
  193. .\" page offset
  194. .ie r O .po \n[O]u
  195. .el \{\
  196. . ie n .po .75i
  197. . el .po .963i
  198. .\}
  199. .\"
  200. .nr @po \n[.o]
  201. .\"
  202. .\" non-zero if escape mechanism is turned off. Used by VERBON/OFF
  203. .nr @verbose-flag 0
  204. .\"---------------------------------------------
  205. .\" New variables
  206. .\"
  207. .\" Appendix name
  208. .ds App APPENDIX
  209. .\" print appendixheader, 0 == don't
  210. .nr Aph 1
  211. .\"
  212. .\" Current appendix text
  213. .ds Apptext
  214. .\" Controls the space before and after static displays if defined.
  215. .\" Lsp is used otherwise
  216. .\" .nr Dsp 1v
  217. .\"
  218. .\" Add a dot after level one heading number if >0
  219. .nr H1dot 1
  220. .\"
  221. .\" header prespace level. If level <= Hps, then two lines will be printed
  222. .\" before the header instead of one.
  223. .nr Hps 1
  224. .\"
  225. .\" These variables controls the number of lines preceding .H.
  226. .\" Hps1 is the number of lines when level > Hps
  227. .nr Hps1 0.5v
  228. .if n .nr Hps1 1v
  229. .\"
  230. .\" Hps2 is the number of lines when level <= Hps
  231. .nr Hps2 1v
  232. .if n .nr Hps2 2v
  233. .\"
  234. .\" Hss is the number of lines (Lsp) after the header.
  235. .nr Hss 1
  236. .\"
  237. .\" H1txt will be updated by .H and .HU, containing the heading text.
  238. .\" Will also be updated in table of contents & friends
  239. .\"
  240. .ds H1txt
  241. .\"
  242. .\" header text for the index
  243. .ds Index INDEX
  244. .\" command to sort the index
  245. .ds Indcmd sort
  246. .\"
  247. .\" flag for mkindex
  248. .if !r Idxf .nr Idxf 0
  249. .\" Change these in the national configuration file
  250. .ds Lifg Figure
  251. .ds Litb TABLE
  252. .ds Liex Exhibit
  253. .ds Liec Equation
  254. .ds Licon CONTENTS
  255. .\" Flag for space between mark and prefix 1==space, 0==no space
  256. .\" Can also be controlled by using '.LI mark 2'
  257. .nr Limsp 1
  258. .\"
  259. .\" Lsp controls the height of an empty line. Normally 0.5v
  260. .\" Normally used for nroff compatibility.
  261. .nr Lsp 0.5v
  262. .if n .nr Lsp 1v
  263. .ds MO1 January
  264. .ds MO2 February
  265. .ds MO3 March
  266. .ds MO4 April
  267. .ds MO5 May
  268. .ds MO6 June
  269. .ds MO7 July
  270. .ds MO8 August
  271. .ds MO9 September
  272. .ds MO10 October
  273. .ds MO11 November
  274. .ds MO12 December
  275. .\" for GETR
  276. .ds Qrf See chapter \\*[Qrfh], page \\*[Qrfp].
  277. .\"
  278. .\" header- and footer-size will only change to the current
  279. .\" if Pgps is > 0.
  280. .nr Pgps 1
  281. .\"
  282. .\" section-page if Sectp > 0
  283. .nr Sectp 0
  284. .if (\n[N]=3):(\n[N]=5) \{\
  285. . nr Sectp 1
  286. . nr Ej 1
  287. .\}
  288. .\" section-figure if Sectf > 0
  289. .nr Sectf 0
  290. .if \n[N]=5 .nr Sectf 1
  291. .\"
  292. .\" argument to .nm in .VERBON.
  293. .ds Verbnm "1
  294. .\" indent for VERBON
  295. .nr Verbin 5n
  296. .\"
  297. .\" Letter section
  298. .\" Formal closing (.FC)
  299. .ds Letfc Yours very truly,
  300. .\"
  301. .\" Approval line
  302. .ds Letapp APPROVED:
  303. .\" Approval date-string
  304. .ds Letdate Date
  305. .\"
  306. .ds LetCN CONFIDENTIAL\" Confidential default
  307. .ds LetSA To Whom It May Concern:\" Salutation default
  308. .ds LetAT ATTENTION:\" Attention string
  309. .ds LetSJ SUBJECT:\" Subject string
  310. .ds LetRN In reference to:\" Reference string
  311. .\"
  312. .\" Copy to (.NS)
  313. .ds Letnsdef 0
  314. .ds Letns!copy Copy \" space!
  315. .ds Letns!to " to
  316. .ds Letns!0 Copy to
  317. .ds Letns!1 Copy (with att.) to
  318. .ds Letns!2 Copy (without att.) to
  319. .ds Letns!3 Att.
  320. .ds Letns!4 Atts.
  321. .ds Letns!5 Enc.
  322. .ds Letns!6 Encs.
  323. .ds Letns!7 Under separate cover
  324. .ds Letns!8 Letter to
  325. .ds Letns!9 Memorandum to
  326. .ds Letns!10 Copy (with atts.) to
  327. .ds Letns!11 Copy (without atts.) to
  328. .ds Letns!12 Abstract Only to
  329. .ds Letns!13 Complete Memorandum to
  330. .ds Letns!14 CC:
  331. .\"
  332. .\" Text printed below the footer. Controlled by @copy_type (C).
  333. .ds Pg_type!0
  334. .ds Pg_type!1 OFFICIAL FILE COPY
  335. .ds Pg_type!2 DATE FILE COPY
  336. .ds Pg_type!3 D\ R\ A\ F\ T
  337. .ds Pg_type!4 D\ R\ A\ F\ T
  338. .\" Max lines in return address
  339. .nr Letwam 14
  340. .\"--------------------------
  341. .\" test for mgm macro. This can be used if the text must test
  342. .\" what macros is used.
  343. .nr .mgm 1
  344. .\"
  345. .\" Due to security problems with groff I had to rewrite
  346. .\" the reference system. It's not as elegant as before, you
  347. .\" have to run groff with '-z -rRef=1' and put stderr into the filename
  348. .\" for .INITR
  349. .\"
  350. .\" Output references to stderr if non-zero
  351. .ie !r Ref \{\
  352. . nr Ref 0
  353. .\}
  354. .el .warn 0
  355. .\"
  356. .\"---------------------------------------------
  357. .\" set local variables.
  358. .ie d @language .mso mm/\*[@language]_locale
  359. .el .mso mm/locale
  360. .\"---------------------------------------------
  361. .if \n[D] .tm Groff mm, version \*[RE].
  362. .\" ####### module init ######
  363. .\" reset all things
  364. .de init@reset
  365. .ie \\n[misc@adjust] 'ad
  366. .el 'na
  367. .ie \\n[Hy] 'hy 14
  368. .el 'nh
  369. 'in 0
  370. 'ti 0
  371. .ps \\n[@ps]u
  372. .vs \\n[@vs]u
  373. ..
  374. .de @warning
  375. 'tm WARNING:(\\n[.F]) input line \\n[.c]:\\$*
  376. .if \\n[D] .backtrace
  377. ..
  378. .de @error
  379. 'tm ******************
  380. 'tm ERROR:(\\n[.F]) input line \\n[.c]:\\$*
  381. .if \\n[D] .backtrace
  382. 'tm ******************
  383. .ab "Input aborted, syntax error"
  384. ..
  385. .de misc@toupper
  386. .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
  387. .br
  388. \\$1
  389. .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
  390. .br
  391. ..
  392. .\" ####### module debug #################################
  393. .de debug
  394. 'tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s],\\n[.ps] \
  395. in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
  396. ..
  397. .de debug-all
  398. .nr debug*n 1n
  399. .nr debug*m 1m
  400. 'tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s] in=\\n[.i]\
  401. ad=\\n[.j] fi=\\n[.u] pl=\\n[.p] page=\\n[%] .o=\\n[.o]
  402. 'tm _______ .d=\\n[.d] .f=\\n[.f] .h=\\n[.h] .k=\\n[.k] .n=\\n[.n]\
  403. .p=\\n[.p] .t=\\n[.t] .z=\\n[.z] nl=\\n[nl] dn=\\n[dn] n=\\n[debug*n]
  404. ..
  405. .\" ####### module par #################################
  406. .nr par@ind-flag 1 \" indent on following P if Pt=2
  407. .nr hd*last-pos -1
  408. .nr hd*last-hsize -1
  409. .nr par*number 0 1
  410. .af par*number 01
  411. .nr par*number2 0 1
  412. .af par*number2 01
  413. .nr par*num-count 0 1
  414. .af par*num-count 01
  415. .\" reset numbered paragraphs, arg1 = headerlevel
  416. .de par@reset-num
  417. .if \\$1<3 .nr par*num-count 0
  418. .if (\\$1=1)&(\\n[Np]=1) .nr par*number 0
  419. ..
  420. .\"------------
  421. .\" paragraph
  422. .de P
  423. .\" skip P if previous heading
  424. .if \\n[D]>2 \{\
  425. . tm Paragraph nl=\\n[nl], last=\\n[hd*last-pos]
  426. . tm Paragraph .k=\\n[.k], hsize=\\n[hd*last-hsize]
  427. .\}
  428. .if !((\\n[nl]=\\n[hd*last-pos]):(\\n[hd*last-hsize]=\\n[.k])) \{\
  429. . if \\n[D]>2 .tm Paragraph set ind-flag=1
  430. . nr par@ind-flag 1
  431. .\}
  432. .\" any collected unprinted text?
  433. .par@doit \\$*
  434. .if \\n[Np] \\n[H1].\\n+[par*number]\ \ \c
  435. ..
  436. .\"------------
  437. .de nP
  438. .\" skip P if previous heading
  439. .if \\n[D]>2 \{\
  440. . tm Paragraph nl=\\n[nl], last=\\n[hd*last-pos]
  441. . tm Paragraph .k=\\n[.k], hsize=\\n[hd*last-hsize]
  442. .\}
  443. .if !((\\n[nl]=\\n[hd*last-pos]):(\\n[hd*last-hsize]=\\n[.k])) \{\
  444. . if \\n[D]>2 .tm Paragraph set ind-flag=1
  445. . nr par@ind-flag 1
  446. .\}
  447. .par@doit \\$*
  448. \\n[H2].\\n+[par*number2]\ \ \c
  449. .nr par@ind-flag 1
  450. ..
  451. .\"------------
  452. .de par@doit
  453. .SP (u;\\n[Ps]*\\n[Lsp])
  454. .ie \\n[.$] \{\
  455. . if \\$1=1 .ti +\\n[Pi]n
  456. .\}
  457. .el \{\
  458. . if \\n[Pt]=1 .ti +\\n[Pi]n
  459. . if (\\n[Pt]=2)&\\n[par@ind-flag] .ti +\\n[Pi]n
  460. .\}
  461. ..
  462. .\" ####### module line #######################################
  463. .de SP
  464. .br
  465. .if !r line*lp\\n[.z] .nr line*lp\\n[.z] 0
  466. .if !r line*ac\\n[.z] .nr line*ac\\n[.z] 0
  467. .ie \\n[.$] .nr line*temp (v;\\$1)
  468. .el .nr line*temp 1v
  469. .\"
  470. .ie \\n[line*lp\\n[.z]]=\\n[.d] \{\
  471. . \" go here if no output since the last .SP
  472. . nr line*output \\n[line*temp]-\\n[line*ac\\n[.z]]
  473. . if \\n[line*output]<0 .nr line*output 0
  474. . nr line*ac\\n[.z] +\\n[line*output]
  475. .\}
  476. .el \{\
  477. . nr line*ac\\n[.z] \\n[line*temp]
  478. . nr line*output \\n[line*temp]
  479. . \" no extra space in the beginning of a page
  480. . if (\\n[.d]<0):(\\n[pg*head-mark]=\\n[.d]) .nr line*output 0
  481. .\}
  482. .if \\n[line*output] .sp \\n[line*output]u
  483. .nr line*lp\\n[.z] \\n[.d]
  484. ..
  485. .\" ######## module misc ###############
  486. .nr misc@adjust 14
  487. .de SA
  488. .if \\n[.$] \{\
  489. . if \\$1-1 .@error "SA: bad arg: \\$1"
  490. . nr misc@adjust 0\\$1
  491. .\}
  492. .ie \\n[misc@adjust] 'ad
  493. .el 'na
  494. ..
  495. .\"-------------
  496. .\" switch environment, keep all important settings.
  497. .de misc@ev-keep
  498. .nr misc*ll \\n[.l]
  499. .ev \\$1
  500. .ll \\n[misc*ll]u
  501. .lt \\n[misc*ll]u
  502. ..
  503. .\"-------------
  504. .\" .misc@push stackname value
  505. .de misc@push
  506. .ie d misc*st-\\$1 .ds misc*st-\\$1 \\$2 \\*[misc*st-\\$1]
  507. .el .ds misc*st-\\$1 \\$2
  508. ..
  509. .\"-------------
  510. .\" .misc@pop stackname
  511. .\" value returned in the string misc*pop
  512. .de misc@pop
  513. .misc@pop-set misc*st-\\$1 \\*[misc*st-\\$1]
  514. ..
  515. .\"-------------
  516. .de misc@pop-set
  517. .ds misc*st-name \\$1
  518. .shift
  519. .if \\n[.$]<1 .@error "stack \\*[misc*st-name] empty"
  520. .ds misc*pop \\$1
  521. .shift
  522. .ds \\*[misc*st-name] \\$*
  523. ..
  524. .\"-------------
  525. .\" .misc@pop-nr stackname varname
  526. .de misc@pop-nr
  527. .misc@pop \\$1
  528. .nr \\$2 \\*[misc*pop]
  529. ..
  530. .\"-------------
  531. .\" .misc@pop-ds stackname varname
  532. .de misc@pop-ds
  533. .misc@pop \\$1
  534. .ds \\$2 \\*[misc*pop]
  535. ..
  536. .\"-----------
  537. .\" reset tabs
  538. .de TAB
  539. .ta T 5n
  540. ..
  541. .\"-------------
  542. .\" .PGFORM linelength [ pagelength [ pageoffset [1]]]
  543. .de PGFORM
  544. .\" Break here to avoid problems with new linesetting of the previous line.
  545. .\" Hope this doesn't break anything else :-)
  546. .\" Don't break if arg_4 is a '1'.
  547. .if \\n[D]>2 .tm PGFORM: \\$*
  548. .if ''\\$4' .br
  549. .if \\n[D]>3 .tm PGFORM: IN l:\\n[.l] p:\\n[.p] o:\\n[.o]
  550. .ie !''\\$1' \{\
  551. . ll \\$1
  552. . nr @ll \\n[.l]
  553. . nr @cur-ll \\n[@ll]
  554. . lt \\n[@ll]u
  555. .\}
  556. .el \{\
  557. . ll \\n[@ll]u
  558. . lt \\n[@ll]u
  559. .\}
  560. .\"
  561. .ie !''\\$2' \{\
  562. . pl \\$2
  563. . nr @pl \\n[.p]
  564. .\}
  565. .el .pl \\n[@pl]u
  566. .\"
  567. .ie !''\\$3' \{\
  568. . po \\$3
  569. . nr @po \\n[.o]
  570. .\}
  571. .el .po \\n[@po]u
  572. .if \\n[D]>3 .tm PGFORM: OUT l:\\n[.l] p:\\n[.p] o:\\n[.o]
  573. .if \\n[D]>2 .tm PGFORM: ll=\\n[@ll], pl=\\n[@pl], po=\\n[@po]
  574. 'in 0
  575. .pg@move-trap
  576. .if \\n[D]>2 \{\
  577. . tm Traps:
  578. . ptr
  579. .\}
  580. ..
  581. .\"-------------
  582. .\" .MOVE y [[x] linelength]
  583. .\" move to line y, indent to x
  584. .de MOVE
  585. .if !\\n[.$] .@error "MOVE y [x]: no arguments"
  586. .if \\n[nl]<0 \c
  587. .\" move to Y-pos
  588. .sp |(v;\\$1)
  589. .\" calc linelength
  590. .ie \\n[.$]>2 .nr pg*i (n;\\$3)
  591. .el \{\
  592. . ie \\n[.$]>1 .nr pg*i (n;\\n[@ll]u-\\$2)
  593. . el .nr pg*i \\n[@ll]u
  594. .\}
  595. .\" move to X-pos, if any
  596. .if !''\\$2' .po \\$2
  597. .\" set linelength
  598. .ll \\n[pg*i]u
  599. ..
  600. .\"-------------
  601. .de SM
  602. .if !\\n[.$] .@error "SM: no arguments"
  603. .if \\n[.$]=1 \s-1\\$1\s0
  604. .if \\n[.$]=2 \s-1\\$1\s0\\$2
  605. .if \\n[.$]=3 \\$1\s-1\\$2\s0\\$3
  606. ..
  607. .\"-------------
  608. .nr misc*S-ps \n[@ps]
  609. .nr misc*S-vs \n[@vs]
  610. .nr misc*S-ps1 \n[@ps]
  611. .nr misc*S-vs1 \n[@vs]
  612. .ds misc*a
  613. .ds misc*b
  614. .de S
  615. .ie !\\n[.$] \{\
  616. . ds misc*a P
  617. . ds misc*b P
  618. .\}
  619. .el \{\
  620. . ie \\n[.$]=1 .ds misc*b D
  621. . el \{\
  622. . ie \w@\\$2@=0 .ds misc*b C
  623. . el .ds misc*b \\$2
  624. . \}
  625. . ie \w@\\$1@=0 .ds misc*a C
  626. . el .ds misc*a \\$1
  627. .\}
  628. .\"
  629. .\" set point size
  630. .if !'\\*[misc*a]'C' \{\
  631. . ie '\\*[misc*a]'P' .ps \\n[misc*S-ps]u
  632. . el \{\
  633. . ie '\\*[misc*a]'D' .ps \\n[S]
  634. . el .ps \\*[misc*a]
  635. . if \\n[D]>2 .tm S: .ps \\*[misc*a]
  636. . \}
  637. .\}
  638. .\"
  639. .\" set vertical spacing
  640. .if !'\\*[misc*b]'C' \{\
  641. . ie '\\*[misc*b]'P' .vs \\n[misc*S-vs]u
  642. . el \{\
  643. . ie '\\*[misc*b]'D' .vs \\n[.ps]s+2p
  644. . el .vs \\*[misc*b]
  645. . if \\n[D]>2 .tm S: .vs \\*[misc*b]
  646. . \}
  647. .\}
  648. .nr @ps \\n[.ps]
  649. .nr @psu \\n[.ps]s
  650. .nr @vs \\n[.v]
  651. .nr @vsp \\n[.v]u/1p
  652. .nr @res 1i
  653. .\"
  654. .if \\n[D]>1 \{\
  655. . tmc "S(\\$*): ma:\\*[misc*a], mb:\\*[misc*b]
  656. . tm1 " => ps:\\n[.s]p (\\n[@psu]u), vs:\\n[@vsp]p (\\n[@vs]u) (res:\\n[@res])
  657. .\}
  658. .nr misc*S-ps \\n[misc*S-ps1]
  659. .nr misc*S-vs \\n[misc*S-vs1]
  660. .nr misc*S-ps1 \\n[@ps]
  661. .nr misc*S-vs1 \\n[@vs]
  662. .pg@move-trap
  663. ..
  664. .\"------------
  665. .de HC
  666. .ev 0
  667. .hc \\$1
  668. .ev
  669. .ev 1
  670. .hc \\$1
  671. .ev
  672. .ev 2
  673. .hc \\$1
  674. .ev
  675. ..
  676. .\"------------
  677. .de RD
  678. .di misc*rd
  679. 'fl
  680. .rd \\$1\t
  681. .br
  682. .di
  683. .ie !''\\$3' \{\
  684. . di misc*rd2
  685. . ds \\$3 "\\*[misc*rd]
  686. . br
  687. . di
  688. .\}
  689. .if !''\\$2' .rn misc*rd \\$2
  690. .rm misc*rd misc*rd2
  691. ..
  692. .\"------------
  693. .\" VERBON [flag [pointsize [font]]]
  694. .\" flag
  695. .\" bit function
  696. .\" 0 escape on
  697. .\" 1 add an empty line before verbose text
  698. .\" 2 add an empty line after verbose text
  699. .\" 3 numbered lines (controlled by the string Verbnm)
  700. .\" 4 indent text by the numbervariable Verbin.
  701. .de VERBON
  702. .br
  703. .nr misc*verb 0\\$1
  704. .if (0\\n[misc*verb]%4)/2 .SP \\n[Lsp]u
  705. .misc@ev-keep misc*verb-ev
  706. .nf
  707. .if (0\\n[misc*verb]%16)/8 .nm \\*[Verbnm]
  708. .ie !'\\$3'' .ft \\$3
  709. .el .ft CR
  710. .ie 0\\$2 \{\
  711. . ss \\$2
  712. . ps \\$2
  713. . vs \\$2
  714. .\}
  715. .el .ss 12
  716. .ta T 8u*\w@n@u
  717. .if (0\\n[misc*verb]%32)/16 .in +\\n[Verbin]u
  718. .if 0\\n[misc*verb]%2 \{\
  719. . eo
  720. . nr @verbose-flag 1 \" tell pageheader to set ec/eo
  721. .\}
  722. ..
  723. .de VERBOFF
  724. .ec
  725. .br
  726. .if (0\\n[misc*verb]%8)/4 .SP \\n[Lsp]u
  727. .if (0\\n[misc*verb]%16)/8 .nm
  728. .if (0\\n[misc*verb]%32)/16 .in
  729. .ev
  730. .nr @verbose-flag 0
  731. ..
  732. .\" ######## module pict #################
  733. .nr pict*width 0
  734. .nr pict*height 0
  735. .nr pict*mode 0
  736. .nr pict*ind 0
  737. .nr pict*id 0 1
  738. .\" I assume that the number variable pict*id is the same
  739. .\" between two runs.
  740. .de PIC
  741. .br
  742. .nr pict*ind 0
  743. .nr pict*box 0
  744. .while \\n[.$]>0 \{\
  745. . if '-B'\\$1' \{\
  746. . nr pict*box 1
  747. . shift
  748. . continue
  749. . \}
  750. . if '-L'\\$1' \{\
  751. . nr pict*mode 0
  752. . shift
  753. . continue
  754. . \}
  755. . if '-R'\\$1' \{\
  756. . nr pict*mode 1
  757. . shift
  758. . continue
  759. . \}
  760. . if '-I'\\$1' \{\
  761. . nr pict*ind (m;\\$2)
  762. . nr pict*mode 2
  763. . shift 2
  764. . continue
  765. . \}
  766. . if '-C'\\$1' \{\
  767. . nr pict*mode 3
  768. . shift
  769. . continue
  770. . \}
  771. . ds pict*f \\$1
  772. . nr pict*id +1
  773. . shift
  774. . if \\n[.$]>0 \{\
  775. . nr pict*width (i;\\$1)
  776. . shift
  777. . \}
  778. . if \\n[.$]>0 \{\
  779. . nr pict*height (i;\\$1)
  780. . shift
  781. . \}
  782. .\}
  783. .\" let mmroff know the filename and id
  784. .if \\n[Ref]>0 \{\
  785. . tm .\\\\" PIC id \\n[pict*id]
  786. . tm .\\\\" PIC file \\*[pict*f]
  787. .\}
  788. .\" these are defined by mmroff in the second pass
  789. .if d pict*file!\\n[pict*id] \{\
  790. . ds pict*f \\*[pict*file!\\n[pict*id]]
  791. . nr pict*llx \\n[pict*llx!\\n[pict*id]]
  792. . nr pict*lly \\n[pict*lly!\\n[pict*id]]
  793. . nr pict*urx \\n[pict*urx!\\n[pict*id]]
  794. . nr pict*ury \\n[pict*ury!\\n[pict*id]]
  795. . \"
  796. . nr pict*w (p;\\n[pict*urx]-\\n[pict*llx])
  797. . if \\n[pict*w]<0 .nr pict*w 0-\\n[pict*w]
  798. . nr pict*h (p;\\n[pict*ury]-\\n[pict*lly])
  799. . if \\n[pict*h]<0 .nr pict*h 0-\\n[pict*h]
  800. . if \\n[pict*width]>0 \{\
  801. . nr pict*rs (u;1000*\\n[pict*width]/\\n[pict*w])
  802. . nr pict*w (u;\\n[pict*w]*\\n[pict*rs]/1000)
  803. . nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
  804. . \}
  805. . if \\n[pict*height]>0 \{\
  806. . nr pict*rs (u;1000*\\n[pict*height]/\\n[pict*h])
  807. . nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
  808. . \}
  809. . if '0'\\n[pict*mode]' \{\
  810. . nr pict*in \\n[.i]u
  811. . \}
  812. . if '1'\\n[pict*mode]' \{\
  813. . nr pict*in (u;\\n[.l]-\\n[.i]-\\n[pict*w])
  814. . \}
  815. . if '2'\\n[pict*mode]' \{\
  816. . nr pict*in \\n[pict*ind]u
  817. . \}
  818. . if '3'\\n[pict*mode]' \{\
  819. . nr pict*in (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
  820. . \}
  821. . ds pict*h "
  822. . if \\n[pict*h]>0 .ds pict*h \\n[pict*h]
  823. . \"
  824. . ne \\n[pict*h]u-1v
  825. . \"
  826. . \" these lines are copied and modified from tmac.pspic.
  827. . \" Originally written by James Clark
  828. . br
  829. . ie \\n[pict*box]>0 \{\
  830. \v'-1v'\h'\\n[pict*in]u'\
  831. \Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
  832. \v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
  833. \\n[pict*llx] \\n[pict*lly] \
  834. \\n[pict*urx] \\n[pict*ury] \
  835. \\n[pict*w] \\n[pict*h]'
  836. .\}
  837. . el \{\
  838. \v'-1v'\h'\\n[pict*in]u'\
  839. \X'ps: invis'\
  840. \Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
  841. \X'ps: endinvis'\
  842. \v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
  843. \\n[pict*llx] \\n[pict*lly] \
  844. \\n[pict*urx] \\n[pict*ury] \
  845. \\n[pict*w] \\n[pict*h]'
  846. . \}
  847. . br
  848. . sp \\n[pict*h]u-1v
  849. .\}
  850. ..
  851. .\" external picture
  852. .\" -L left adjust
  853. .de EPIC
  854. .if \\n[.$]<2 .@error "EPIC: Not enough arguments"
  855. .nr pict*adj 0 \" centered
  856. .if '\\$1'-L' \{\
  857. . shift 1 \" left adjust
  858. . nr pict*adj 1
  859. .\}
  860. .if \\n[nl]<0 \&
  861. .nr pict*w \\$1
  862. .nr pict*h \\$2
  863. .ds pict*name "External picture
  864. .if !''$3' .ds pict*name \\$3
  865. .ne \\n[pict*h]u
  866. .sp \\n[pict*h]u-1v
  867. .nr pict*ind 0
  868. .if !\\n[pict*adj] .nr pict*ind (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
  869. .mk
  870. .in +\\n[pict*ind]u
  871. \D'l \\n[pict*w]u 0'\
  872. \D'l 0 -\\n[pict*h]u'\
  873. \D'l -\\n[pict*w]u 0'\
  874. \D'l 0 \\n[pict*h]u'\
  875. \v'-(u;\\n[pict*h]/2)'\
  876. \h'(u;(\\n[pict*w]-\w'\\*[pict*name]'/2))'\\*[pict*name]
  877. .in
  878. .rt
  879. .sp 1v
  880. ..
  881. .\" ######## module acc #################
  882. .\"-----------
  883. .\" accents. These are copied from mgs, written by James Clark.
  884. .de acc@over-def
  885. .ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
  886. \h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
  887. ..
  888. .de acc@under-def
  889. .ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
  890. ..
  891. .acc@over-def ` \`
  892. .acc@over-def ' \'
  893. .acc@over-def ^ ^
  894. .acc@over-def ~ ~
  895. .acc@over-def : \(ad
  896. .acc@over-def ; \(ad
  897. .acc@under-def , \(ac
  898. .\" ######## module uni #################
  899. .\" unimplemented macros
  900. .de OK
  901. 'tm "OK: not implemented"
  902. ..
  903. .de PM
  904. 'tm "PM: not implemented"
  905. ..
  906. .\" ######## module hd #################
  907. .\" support for usermacro
  908. .nr hd*h1-page 1 \" last page-number for level 1 header.
  909. .nr hd*htype 0
  910. .ds hd*sect-pg
  911. .ds hd*mark
  912. .ds hd*suf-space
  913. .nr hd*need 0
  914. .aln ;0 hd*htype
  915. .als }0 hd*mark
  916. .als }2 hd*suf-space
  917. .aln ;3 hd*need
  918. .\"-------------
  919. .\" .hd@split varable index name val1 val2 ...
  920. .de hd@split
  921. .if \\$2>(\\n[.$]-3) .@error "\\$3 must have at least \\$2 values (\\*[\\$3]).
  922. .nr hd*sp-tmp \\$2+3
  923. .ds \\$1 \\$[\\n[hd*sp-tmp]]
  924. ..
  925. .de HU
  926. .H 0 "\\$1"
  927. ..
  928. .\"-------------
  929. .de H
  930. .if !r hd*cur-bline .nr hd*cur-bline \\n[nl]
  931. .br
  932. .df@print-float 2\" $$$ could be wrong...
  933. .\" terminate all lists
  934. .LC
  935. .init@reset
  936. .nr hd*level 0\\$1
  937. .nr hd*arg1 0\\$1
  938. .if !\\n[hd*level] .nr hd*level \\n[Hu]
  939. .\"
  940. .\" clear lower counters
  941. .nr hd*i 1 1
  942. .while \\n+[hd*i]<15 .if \\n[hd*level]<\\n[hd*i] .nr H\\n[hd*i] 0 1
  943. .\"
  944. .\" save last text for use in TP
  945. .if \\n[hd*level]=1 .ds H1txt \\$2\\$3
  946. .\"
  947. .\" This is a little fix to be able to get correct H1 heading number
  948. .\" in page headers. Special attention was needed when other formats are used.
  949. .ie !''\\g[H1]' \{\
  950. . ds hd*format \\g[H1]
  951. . af H1 0
  952. . nr H1h \\n[H1] 1
  953. . af H1 \\*[hd*format]
  954. .\}
  955. .el .nr H1h \\n[H1] 1
  956. .if \\n[hd*level]=1 .nr H1h +1
  957. .\"
  958. .\" Check if it's time for new page. Only if text has
  959. .\" appeared before.
  960. .if \\n[Ej]&(\\n[Ej]>=\\n[hd*level])&(\\n[nl]>\\n[hd*cur-bline]) .pg@next-page
  961. .\"
  962. .\" increment current counter
  963. .nr H\\n[hd*level] +1
  964. .\"
  965. .\" update pagenumber if section-page is used
  966. .if (\\n[hd*level]=1)&(\\n[Sectp]>0) .hd@set-page 1
  967. .\"
  968. .\" hd*mark is the text written to the left of the header.
  969. .ds hd*mark \\n[H1].
  970. .\"
  971. .if \\n[hd*level]>1 .as hd*mark \\n[H2]
  972. .\"
  973. .nr hd*i 2 1
  974. .while \\n+[hd*i]<15 .if \\n[hd*level]>(\\n[hd*i]-1) .as hd*mark .\\n[H\\n[hd*i]]
  975. .if \\n[Ht] .ds hd*mark \\n[H\\n[hd*level]].
  976. .\"
  977. .\" special case, no dot after level one heading if not H1dot true
  978. .if (\\n[hd*level]=1)&(\\n[H1dot]=0) .ds hd*mark \\n[H1]
  979. .\"
  980. .as hd*mark \ \ \" add spaces between mark and heading
  981. .if !\\n[hd*arg1] .ds hd*mark\" no mark for unnumbered
  982. .\"
  983. .if \\n[D]>1 .tm At header \\*[hd*mark] "\\$2"
  984. .nr hd*htype 0 \" hd*htype = check break and space
  985. . \" 0 = run-in, 1 = break only, 2 = space
  986. .if \\n[hd*level]<=\\n[Hb] .nr hd*htype 1
  987. .if \\n[hd*level]<=\\n[Hs] .nr hd*htype 2
  988. . \" two spaces if hd*htype == 0
  989. .ie (\\n[hd*htype]=0)&(\w@\\$2@) .ds hd*suf-space " \"
  990. .el .ds hd*suf-space
  991. .nr hd*need 2v \" hd*need = header need space
  992. .\"---------- user macro HX ------------
  993. .\" User exit macro to override numbering.
  994. .\" May change hd*mark (}0), hd*suf-space (}2) and hd*need (;3)
  995. .\" Can also change Hps1/2.
  996. .if d HX .HX \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
  997. .\"--------------------------------------
  998. .\" pre-space
  999. .ie \\n[hd*level]<=\\n[Hps] .SP (u;\\n[Hps2])
  1000. .el .SP (u;\\n[Hps1])
  1001. .\"
  1002. .par@reset-num \\n[hd*level]\" reset numbered paragraph
  1003. .\" start diversion to measure size of header
  1004. .di hd*div
  1005. \\*[hd*mark]\\$2\\$3\\*[hd*suf-space]
  1006. .br
  1007. .di
  1008. .rm hd*div
  1009. .if \\n[hd*htype] .na \" no adjust if run-in
  1010. .if \\n[hd*htype]<2 .nr hd*need +\\n[Lsp]u \" add some extra space
  1011. .ne \\n[hd*need]u+\\n[dn]u+.5p-1v \" this is the needed space for a header
  1012. .\"
  1013. .\" size and font calculations
  1014. .hd@split hd*font \\n[hd*level] HF \\*[HF]\" get font for this level
  1015. .ft \\*[hd*font]\" set new font
  1016. .hd@split hd*new-ps \\n[hd*level] HP \\*[HP]\" get point size
  1017. .ie (\\*[hd*new-ps]=0):(\w@\\*[hd*new-ps]@=0) \{\
  1018. . if \\n[hd*htype] \{\
  1019. . if '\\*[hd*font]'3' \{\
  1020. . ps -1
  1021. . vs -1
  1022. . \}
  1023. . if '\\*[hd*font]'B' \{\
  1024. . ps -1
  1025. . vs -1
  1026. . \}
  1027. . \}
  1028. .\}
  1029. .el \{\
  1030. . ps \\*[hd*new-ps]
  1031. . vs \\*[hd*new-ps]+2
  1032. .\}
  1033. .\"
  1034. .\"---------- user macro HY -------------
  1035. .\" user macro to reset indents
  1036. .if d HY .HY \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
  1037. .DEVTAG-NH \\n[hd*level] \" HTML: mark beginning of heading
  1038. .\"--------------------------------------
  1039. .nr hd*mark-size \w@\\*[hd*mark]@
  1040. .if (\\n[hd*level]<=\\n[Hc])&\\n[hd*htype] .ce\" center if level<=Hc
  1041. .\"
  1042. .\" finally, output the header
  1043. \\*[hd*mark]\&\c
  1044. .\" and the rest of the header
  1045. .ie \\n[hd*htype] \{\
  1046. \\$2\\$3
  1047. . br
  1048. .\}
  1049. .el \\$2\\$3\\*[hd*suf-space]\&\c
  1050. .ft 1
  1051. .\" restore pointsize and vertical size.
  1052. .ps \\n[@ps]u
  1053. .vs \\n[@vs]u
  1054. .\"
  1055. .\" table of contents
  1056. .if (\\n[hd*level]<=\\n[Cl])&\w@\\$2@ .toc@entry \\n[hd*level] "\\$2"
  1057. .\" set adjust to previous value
  1058. .SA
  1059. .\" do break or space
  1060. .if \\n[hd*htype] .br
  1061. .if \\n[hd*htype]>1 .SP (u;\\n[Lsp]*\\n[Hss])
  1062. .if \\n[hd*htype] \{\
  1063. . \" indent if Hi=1 and Pt=1
  1064. . if (\\n[Hi]=1)&(\\n[Pt]=1) .ti +\\n[Pi]n
  1065. . \" indent size of mark if Hi=2
  1066. . if \\n[hd*htype]&(\\n[Hi]>1) .ti +\\n[hd*mark-size]u
  1067. .\}
  1068. .nr par@ind-flag 0 \" no indent on .P if Pt=2
  1069. .\"
  1070. .\" check if it is time to reset footnotes
  1071. .if (\\n[hd*level]=1)&\\n[ft*clear-at-header] .nr ft*nr 0 1
  1072. .\"
  1073. .\" check if it is time to reset indexes
  1074. .if (\\n[hd*level]=1)&\\n[Sectf] \{\
  1075. . nr lix*fg-nr 0 1
  1076. . nr lix*tb-nr 0 1
  1077. . nr lix*ec-nr 0 1
  1078. . nr lix*ex-nr 0 1
  1079. .\}
  1080. .\"---------- user macro HZ ----------
  1081. .if d HZ .HZ \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
  1082. .nr hd*last-pos \\n[nl]
  1083. .nr hd*last-hsize \\n[.k]
  1084. .nr par@ind-flag 0
  1085. .DEVTAG-EO-H \" HTML: end of heading
  1086. ..
  1087. .\"--------
  1088. .de HM
  1089. .nr hd*i 0 1
  1090. .while \\n+[hd*i]<15 .af H\\n[hd*i] \\$[\\n[hd*i]] 1
  1091. ..
  1092. .\"----------------------
  1093. .\" set page-nr, called from header
  1094. .\"
  1095. .de hd@set-page
  1096. .\"
  1097. .ie \\n[.$]>0 .nr P \\$1
  1098. .el .nr P +1
  1099. .\" Set section-page-string
  1100. .ds hd*sect-pg \\n[H1]-\\n[P]
  1101. .if \\n[Sectp]>1 .if '\\n[H1]'0' .ds hd*sect-pg "
  1102. ..
  1103. .\"########### module pg ####################
  1104. .\" set end of text trap
  1105. .wh 0 pg@header
  1106. .em pg@end-of-text
  1107. .\"
  1108. .ds pg*header ''- \\nP -''
  1109. .ds pg*footer
  1110. .if \n[N]=4 .ds pg*header ''''
  1111. .if (\n[N]=3):(\n[N]=5) \{\
  1112. . ds pg*header ''''
  1113. . ds pg*footer ''\\*[hd*sect-pg]''
  1114. .\}
  1115. .ds pg*even-footer
  1116. .ds pg*odd-footer
  1117. .ds pg*even-header
  1118. .ds pg*odd-header
  1119. .\"
  1120. .nr pg*top-margin 0
  1121. .nr pg*foot-margin 0
  1122. .nr pg*block-size 0
  1123. .nr pg*footer-size 5v\" 1v+footer+even/odd footer+2v
  1124. .nr pg*header-size 7v\" 3v+header+even/odd header+2v
  1125. .nr pg*extra-footer-size 0
  1126. .nr pg*extra-header-size 0
  1127. .nr ft*note-size 0
  1128. .nr pg*cur-column 0
  1129. .nr pg*cols-per-page 1
  1130. .nr pg*cur-po \n[@po]
  1131. .nr pg*head-mark 0
  1132. .\"
  1133. .nr pg*ps \n[@ps]
  1134. .nr pg*vs \n[@vs]
  1135. .\"-------------------------
  1136. .\" footer TRAPS: set, enable and disable
  1137. .de pg@set-new-trap
  1138. .nr pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u+\\n[pg*extra-footer-size]u)
  1139. .\"
  1140. .if \\n[D]>2 .tm pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u+\\n[pg*extra-footer-size]u) = \\n[pg*foot-trap]
  1141. .\"
  1142. .\" last-pos points to the position of the footer and bottom
  1143. .\" block below foot-notes.
  1144. .nr pg*last-pos \\n[@pl]u-(\\n[pg*block-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u+\\n[pg*extra-footer-size]u)
  1145. .if \\n[D]>2 .tm pg*last-pos \\n[@pl]u-(\\n[pg*block-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u+\\n[pg*extra-footer-size]u) = \\n[pg*last-pos]
  1146. ..
  1147. .de pg@enable-trap
  1148. .\" Disable in HTML mode
  1149. .if !'\*[.T]'html' \{\
  1150. .wh \\n[pg*foot-trap]u pg@footer
  1151. .if \\n[D]>2 .tm pg@enable-trap .t=\\n[.t] nl=\\n[nl]
  1152. .if \\n[D]>2 .ptr
  1153. .\}
  1154. ..
  1155. .de pg@disable-trap
  1156. .ch pg@footer
  1157. ..
  1158. .\" move to new trap (if changed).
  1159. .de pg@move-trap
  1160. .pg@disable-trap
  1161. .pg@set-new-trap
  1162. .pg@enable-trap
  1163. ..
  1164. .de pg@enable-top-trap
  1165. .\" set trap for pageheader.
  1166. .nr pg*top-enabled 1
  1167. ..
  1168. .de pg@disable-top-trap
  1169. .\" remove trap for pageheader.
  1170. .nr pg*top-enabled 0
  1171. ..
  1172. .\" no header on the next page
  1173. .de PGNH
  1174. .nr pg*top-enabled (-1)
  1175. ..
  1176. .\" set first trap for pagefooter
  1177. .pg@enable-top-trap
  1178. .pg@set-new-trap
  1179. .pg@enable-trap
  1180. .\"-------------------------
  1181. .\" stop output and begin on next page. Fix footnotes and all that.
  1182. .de pg@next-page
  1183. .\".debug next-page
  1184. .ne 999i \" activate trap
  1185. .\" .pg@footer
  1186. ..
  1187. .\"-------------------------
  1188. .\" support for PX, TP and EOP.
  1189. .als }t pg*header
  1190. .als }e pg*even-header
  1191. .als }o pg*odd-header
  1192. .als TPh pg*header
  1193. .als TPeh pg*even-header
  1194. .als TPoh pg*odd-header
  1195. .\"
  1196. .als EOPf pg*footer
  1197. .als EOPef pg*even-footer
  1198. .als EOPof pg*odd-footer
  1199. .\"------------------------------------------------------------
  1200. .\" HEADER
  1201. .de pg@header
  1202. .\" Disable in HTML mode
  1203. .if !'\*[.T]'html' \{\
  1204. .if \\n[D]>1 .tm Page# \\n[%] (\\n[.F]:\\n[c.])
  1205. .\" check if Hy has been changed
  1206. .ie \\n[Hy] 'hy 14
  1207. .el 'nh
  1208. .if \\n[Idxf] \{\
  1209. .tl '<pagenr\ \\n[%]>'''
  1210. .\}
  1211. .\" assign current page-number to P
  1212. .hd@set-page
  1213. .\" reset spacing
  1214. .nr line*lp\\n[.z] 0
  1215. .nr line*ac\\n[.z] 0
  1216. .\"
  1217. .\" suppress pageheader if pagenumber == 1 and N == [124]
  1218. .if \\n[pg*top-enabled] \{\
  1219. .\" must be fixed!!
  1220. .\". pg@disable-top-trap
  1221. . if \\n[pg*extra-header-size] 'sp \\n[pg*extra-header-size]u
  1222. . if \\n[pg*top-margin] 'sp \\n[pg*top-margin]u
  1223. . ev pg*tl-ev
  1224. . pg@set-env
  1225. . ie d let@header .let@header
  1226. . el \{\
  1227. . ie d TP .TP
  1228. . el \{\
  1229. ' sp 3
  1230. . ie ((\\n[%]=1)&((\\n[N]=1):(\\n[N]=2))) .sp
  1231. . el .tl \\*[pg*header]
  1232. . ie o .tl \\*[pg*odd-header]
  1233. . el .tl \\*[pg*even-header]
  1234. ' sp 2
  1235. . \}
  1236. . \}
  1237. . ev
  1238. . \" why no-space??
  1239. . if d PX \{\
  1240. . ns
  1241. . PX
  1242. . rs
  1243. . \}
  1244. . \" check for pending footnotes
  1245. . ft@check-old
  1246. . \"
  1247. . \" back to normal text processing
  1248. . pg@enable-trap
  1249. . \" mark for multicolumn
  1250. . nr pg*head-mark \\n[nl]u
  1251. . \" reset NCOL pointer at each new page.
  1252. . nr pg*last-ncol 0
  1253. . \" set multicolumn
  1254. . \"
  1255. . pg@set-po
  1256. . \" print floating displays
  1257. . df@print-float 4
  1258. . tbl@top-hook
  1259. . ns
  1260. .\}
  1261. .if \\n[pg*top-enabled]<0 .nr pg*top-enabled 1
  1262. .nr hd*cur-bline \\n[nl] \" .H needs to know if output has occured
  1263. .\}
  1264. ..
  1265. .\"---------------------------------------------------------
  1266. .\" FOOTER
  1267. .de pg@footer
  1268. .ec
  1269. .if \\n[D]>2 .tm Footer# \\n[%] (\\n[.F]:\\n[c.]) nl=\\n[nl]
  1270. .pg@disable-trap
  1271. .\".debug footer
  1272. .tbl@bottom-hook
  1273. .\" increment pageoffset for MC
  1274. .\" move to the exact start of footer.
  1275. 'sp |\\n[pg*foot-trap]u+1v
  1276. .\"
  1277. .if \\n[D]>3 .tm FOOTER after .sp, nl=\\n[nl]
  1278. .\" print footnotes
  1279. .if d ft*div .ft@print
  1280. .\"
  1281. .pg@inc-po
  1282. .if !\\n[pg*cur-column] .pg@print-footer
  1283. .\" next column
  1284. .pg@set-po
  1285. .pg@enable-trap
  1286. .if \\n[@verbose-flag] .eo \" to help VERBON/VERBOFF
  1287. ..
  1288. .\"-------------------------
  1289. .de pg@print-footer
  1290. .\" jump to the position just below the foot-notes.
  1291. 'sp |\\n[pg*last-pos]u+1v
  1292. .if \\n[D]>3 .tm print-footer nl=\\n[nl]
  1293. .\" check if there are any bottom block
  1294. .if d pg*block-div .pg@block
  1295. .\"
  1296. .\" print the footer and eject new page
  1297. .ev pg*tl-ev
  1298. .pg@set-env
  1299. .\" user defined end-of-page macro
  1300. .ie d EOP .EOP
  1301. .el \{\
  1302. . ie o .tl \\*[pg*odd-footer]
  1303. . el .tl \\*[pg*even-footer]
  1304. . ie (\\n[%]=1)&(\\n[N]=1) .tl \\*[pg*header]
  1305. . el .tl \\*[pg*footer]
  1306. . tl ''\\*[Pg_type!\\n[@copy_type]]''
  1307. .\}
  1308. .ev
  1309. .\" be sure that floating displays and footnotes will be
  1310. .\" printed at the end of the document.
  1311. .ie (\\n[df*fnr]>=\\n[df*o-fnr]):\\n[ft*exist] \{\
  1312. . ev ne
  1313. ' bp
  1314. . ev
  1315. .\}
  1316. .el 'bp
  1317. ..
  1318. .\"-------------------------
  1319. .\"
  1320. .\" Initialize the title environment
  1321. .de pg@set-env
  1322. 'na
  1323. 'nh
  1324. 'in 0
  1325. 'ti 0
  1326. .ie \\n[Pgps] \{\
  1327. . ps \\n[@ps]u
  1328. . vs \\n[@vs]u
  1329. .\}
  1330. .el \{\
  1331. . ps \\n[pg*ps]u
  1332. . vs \\n[pg*vs]u
  1333. .\}
  1334. .lt \\n[@ll]u
  1335. .ll \\n[@ll]u
  1336. ..
  1337. .\"-------------------------
  1338. .de PH
  1339. .ds pg*header "\\$1
  1340. .pg@set-new-size
  1341. ..
  1342. .de PF
  1343. .ds pg*footer "\\$1
  1344. .pg@set-new-size
  1345. ..
  1346. .de OH
  1347. .ds pg*odd-header "\\$1
  1348. .pg@set-new-size
  1349. ..
  1350. .de EH
  1351. .ds pg*even-header "\\$1
  1352. .pg@set-new-size
  1353. ..
  1354. .de OF
  1355. .ds pg*odd-footer "\\$1
  1356. .pg@set-new-size
  1357. ..
  1358. .de EF
  1359. .ds pg*even-footer "\\$1
  1360. .pg@set-new-size
  1361. ..
  1362. .de pg@clear-hd
  1363. .ds pg*even-header
  1364. .ds pg*odd-header
  1365. .ds pg*header
  1366. ..
  1367. .de pg@clear-ft
  1368. .ds pg*even-footer
  1369. .ds pg*odd-footer
  1370. .ds pg*footer
  1371. ..
  1372. .de pg@set-new-size
  1373. .nr pg*ps \\n[@ps]
  1374. .nr pg*vs \\n[@vs]
  1375. .pg@move-trap
  1376. ..
  1377. .\"-------------------------
  1378. .\" end of page processing
  1379. .de pg@footnotes
  1380. .\".debug footnotes
  1381. .\" output footnotes. set trap for block
  1382. .\"
  1383. ..
  1384. .\"-------------------------
  1385. .\" print bottom block
  1386. .de pg@block
  1387. .ev pg*block-ev
  1388. 'nf
  1389. 'in 0
  1390. .ll 100i
  1391. .pg*block-div
  1392. .br
  1393. .ev
  1394. ..
  1395. .\"-------------------------
  1396. .\" define bottom block
  1397. .de BS
  1398. .misc@ev-keep pg*block-ev
  1399. .init@reset
  1400. .br
  1401. .di pg*block-div
  1402. ..
  1403. .\"-------------------------
  1404. .de BE
  1405. .br
  1406. .di
  1407. .nr pg*block-size \\n[dn]u
  1408. .ev
  1409. .pg@move-trap
  1410. ..
  1411. .\"-------------------------
  1412. .\" print out all pending text
  1413. .de pg@end-of-text
  1414. .if \\n[D]>2 .tm ---------- End of text processing ----------------
  1415. .df@eot-print
  1416. .ref@eot-print
  1417. ..
  1418. .\"-------------------------
  1419. .\" set top and bottom margins
  1420. .\" -T sets pg*footer-size and pg*header-size instead
  1421. .de VM
  1422. .ie '\\$1'-T' \{\
  1423. . shift
  1424. . if \\n[.$]=0 \{\
  1425. . nr pg*footer-size 5v
  1426. . nr pg*header-size 7v
  1427. . \}
  1428. . if \\n[.$]>0 .nr pg*header-size (v;\\$1)
  1429. . if \\n[.$]>1 .nr pg*footer-size (v;\\$2)
  1430. .\}
  1431. .el \{\
  1432. . if \\n[.$]=0 \{\
  1433. . nr pg*extra-footer-size 0
  1434. . nr pg*extra-header-size 0
  1435. . \}
  1436. . if \\n[.$]>0 .nr pg*extra-header-size (v;\\$1)
  1437. . if \\n[.$]>1 .nr pg*extra-footer-size (v;\\$2)
  1438. . if \\n[D]>2 \{\
  1439. . tm extra top \\n[pg*extra-footer-size]
  1440. . tm extra bottom \\n[pg*extra-header-size]
  1441. . \}
  1442. .\}
  1443. .pg@move-trap
  1444. ..
  1445. .\"---------------------
  1446. .\" multicolumn output.
  1447. .de pg@set-po
  1448. .if \\n[pg*cols-per-page]>1 \{\
  1449. . ll \\n[pg*column-size]u
  1450. .\}
  1451. ..
  1452. .de pg@inc-po
  1453. .if \\n[pg*cols-per-page]>1 \{\
  1454. . ie \\n+[pg*cur-column]>=\\n[pg*cols-per-page] \{\
  1455. . nr pg*cur-column 0 1
  1456. . nr pg*cur-po \\n[@po]u
  1457. . po \\n[@po]u
  1458. . ll \\n[@ll]u
  1459. . \}
  1460. . el \{\
  1461. . nr pg*cur-po +(\\n[pg*column-size]u+\\n[pg*column-sep]u)
  1462. . po \\n[pg*cur-po]u
  1463. ' sp |\\n[pg*head-mark]u
  1464. . tbl@top-hook
  1465. . \}
  1466. .\}
  1467. ..
  1468. .\" An argument disables the page-break.
  1469. .de 1C
  1470. .br
  1471. .if \\n[pg*cols-per-page]<=1 .@error "1C: multicolumn mode not active"
  1472. .nr pg*cols-per-page 1
  1473. .nr pg*column-sep 0
  1474. .nr pg*column-size \\n[@ll]
  1475. .nr pg*ncol-i \\n[pg*cur-column]\" temp variable
  1476. .nr pg*cur-column 0 1
  1477. .nr pg*cur-po \\n[@po]u
  1478. .PGFORM
  1479. .ie !'\\$1'1' .SK
  1480. .el \{\
  1481. . if d ft*div \{\
  1482. . if \\n[pg*ncol-i]>0 \{\
  1483. . @warning 1C: footnotes will be messy
  1484. . \}
  1485. . \}
  1486. . if \\n[pg*last-ncol]>0 \{\
  1487. . sp |\\n[pg*last-ncol]u
  1488. . nr pg*last-ncol 0
  1489. . \}
  1490. .\}
  1491. ..
  1492. .de 2C
  1493. .br
  1494. .nr pg*head-mark \\n[nl]u
  1495. .if \\n[pg*cols-per-page]>1 .@error "2C: multicolumn mode already active"
  1496. .nr pg*cols-per-page 2
  1497. .nr pg*column-sep \\n[@ll]/15
  1498. .nr pg*column-size (\\n[@ll]u*7)/15
  1499. .nr pg*cur-column 0 1
  1500. .nr pg*cur-po \\n[@po]u
  1501. .ll \\n[pg*column-size]u
  1502. .\" .lt \\n[pg*column-size]u
  1503. ..
  1504. .\" MC column-size [ column-separation ]
  1505. .de MC
  1506. .br
  1507. .nr pg*head-mark \\n[nl]u
  1508. .if \\n[pg*cols-per-page]>1 .@error "MC: multicolumn mode already active"
  1509. .ie ''\\$1' .nr pg*column-size \\n[.l]
  1510. .el .nr pg*column-size (n;\\$1)
  1511. .ie ''\\$2' .nr pg*column-sep \\n[pg*column-size]/15
  1512. .el .nr pg*column-sep (n;\\$2)
  1513. .\"
  1514. .\" calculate the number of columns/page
  1515. .nr pg*cols-per-page 0
  1516. .nr pg*i \\n[pg*column-size]
  1517. .while \\n[pg*i]<=\\n[.l] \{\
  1518. . nr pg*cols-per-page \\n[pg*cols-per-page]+1
  1519. . nr pg*i \\n[pg*i]+\\n[pg*column-sep]+\\n[pg*column-size]
  1520. .\}
  1521. .nr pg*cur-column 0 1
  1522. .nr pg*cur-po \\n[@po]u
  1523. .ll \\n[pg*column-size]u
  1524. .\" .lt \\n[pg*column-size]u
  1525. ..
  1526. .\" begin a new column
  1527. .de NCOL
  1528. .br
  1529. .if \\n[nl]>\\n[pg*last-ncol] .nr pg*last-ncol \\n[nl]
  1530. .pg@footer
  1531. ..
  1532. .\" skip pages
  1533. .de SK
  1534. .br
  1535. .bp
  1536. .nr pg*i 0 1
  1537. .\" force new page by writing something invisible.
  1538. .while \\n+[pg*i]<=(0\\$1) \{\
  1539. \&
  1540. . bp
  1541. .\}
  1542. ..
  1543. .\"-------------------------------
  1544. .\" MULB width1 space1 width2 space2 width3 space3 ...
  1545. .de MULB
  1546. .br
  1547. .nr pg*i 0 1
  1548. .nr pg*mul-x 0 1
  1549. .nr pg*mul-ind 0
  1550. .nr pg*mul-last 0
  1551. .while \\n[.$] \{\
  1552. . nr pg*mul!\\n+[pg*i] (n;0\\$1)
  1553. . nr pg*muls!\\n[pg*i] (n;0\\$2)
  1554. . shift 2
  1555. .\}
  1556. .nr pg*mul-max-col \\n[pg*i]
  1557. .ds pg*mul-fam \\n[.fam]
  1558. .nr pg*mul-font \\n[.f]
  1559. .ev pg*mul-ev
  1560. .ps \\n[@ps]u
  1561. .vs \\n[@vs]u
  1562. .fam \\*[pg*mul-fam]
  1563. .ft \\n[pg*mul-font]
  1564. .fi
  1565. .hy 14
  1566. .di pg*mul-div
  1567. .MULN
  1568. ..
  1569. .\"-----------
  1570. .de MULN
  1571. .if \\n[pg*mul-x]>=\\n[pg*mul-max-col] .@error "MULN: Undefined columnwidth"
  1572. .br
  1573. .if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
  1574. .rt +0
  1575. .in \\n[pg*mul-ind]u
  1576. .ll (u;\\n[.i]+\\n[pg*mul!\\n+[pg*mul-x]])u
  1577. .nr pg*mul-ind +(u;\\n[pg*mul!\\n[pg*mul-x]]+\\n[pg*muls!\\n[pg*mul-x]])
  1578. ..
  1579. .\"-----------
  1580. .\" MULE
  1581. .de MULE
  1582. .br
  1583. .if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
  1584. .di
  1585. .ev
  1586. .ne \\n[pg*mul-last]u
  1587. .nf
  1588. .mk
  1589. .pg*mul-div
  1590. .rt
  1591. .sp \\n[pg*mul-last]u
  1592. .fi
  1593. ..
  1594. .\"-----------
  1595. .de OP
  1596. .br
  1597. .ie o .if !\\n[pg*head-mark]=\\n[nl] \{\
  1598. . bp +1
  1599. . bp +1
  1600. .\}
  1601. .el .bp
  1602. ..
  1603. .\"########### module footnotes ###################
  1604. .nr ft*note-size 0
  1605. .nr ft*busy 0
  1606. .nr ft*nr 0 1
  1607. .nr ft*wide 0
  1608. .nr ft*hyphen 0\" hyphenation value
  1609. .nr ft*adjust 1\" >0 if adjust true
  1610. .nr ft*indent 1\" >0 if text indent true (not imp. $$$)
  1611. .nr ft*just 0\" 0=left justification, 1=right (not imp. $$$)
  1612. .nr ft*exist 0\" not zero if there are any footnotes to be printed
  1613. .nr ft*clear-at-header 0\" >0 if footnotes should be reset at first level head.
  1614. .\"
  1615. .ds F \v'-.4m'\s-3\\n+[ft*nr]\s0\v'.4m'
  1616. .\"
  1617. .\"-----------------
  1618. .\" init footnote environment
  1619. .de ft@init
  1620. .\" indentcontrol not implemented $$$
  1621. .\" label justification not implemented $$$
  1622. 'in 0
  1623. 'fi
  1624. .ie \\n[ft*adjust] 'ad
  1625. .el 'na
  1626. .ie \\n[ft*hyphen] 'hy 14
  1627. .el 'hy 0
  1628. .ll \\n[@cur-ll]u
  1629. .lt \\n[@cur-ll]u
  1630. .ps (p;\\n[@ps]u-2)
  1631. .vs (p;\\n[@vs]u-1)
  1632. ..
  1633. .\"-----------------
  1634. .\" set footnote format
  1635. .\" no support for two column processing (yet). $$$
  1636. .de FD
  1637. .if \\n[.$]=0 .@error "FD: bad arg \\$1"
  1638. .ie \\n[.$]=2 .nr ft*clear-at-header 1
  1639. .el .nr ft*clear-at-header 0
  1640. .\"
  1641. .if !'\\$1'' \{\
  1642. . ie \\$1>11 .nr ft*format 0
  1643. . el .nr ft*format \\$1
  1644. . \"
  1645. . nr ft*hyphen (\\n[ft*format]%2)*14
  1646. . nr ft*format \\n[ft*format]/2
  1647. . \"
  1648. . nr ft*adjust 1-(\\n[ft*format]%2)
  1649. . nr ft*format \\n[ft*format]/2
  1650. . \"
  1651. . nr ft*indent 1-(\\n[ft*format]%2)
  1652. . nr ft*format \\n[ft*format]/2
  1653. . \"
  1654. . nr ft*just \\n[ft*format]%2
  1655. .\}
  1656. ..
  1657. .\"---------------
  1658. .\" Footnote and display width control $$$
  1659. .de WC
  1660. .nr ft*i 0 1
  1661. .while \\n+[ft*i]<=\\n[.$] \{\
  1662. . ds ft*x \\$[\\n[ft*i]]
  1663. . if '\\*[ft*x]'N' \{\
  1664. . nr ft*wide 0
  1665. . nr ft*first-fn 0
  1666. . nr ds*wide 0
  1667. . nr ds*float-break 1
  1668. . \}
  1669. . if '\\*[ft*x]'-WF' .nr ft*wide 0
  1670. . if '\\*[ft*x]'WF' .nr ft*wide 1
  1671. . if '\\*[ft*x]'-FF' .nr ft*first-fn 0
  1672. . if '\\*[ft*x]'FF' .nr ft*first-fn 1
  1673. . if '\\*[ft*x]'-WD' \{\
  1674. . nr ds*wide 0
  1675. . if r ft*df-save \{\
  1676. . nr Df \\n[ft*df-save]
  1677. . rm ft*df-save
  1678. . \}
  1679. . \}
  1680. . if '\\*[ft*x]'WD' \{\
  1681. . nr ds*wide 1
  1682. . nr ft*df-save \\n[Df]
  1683. . nr Df 4
  1684. . \}
  1685. . if '\\*[ft*x]'-FB' .nr ds*float-break 0
  1686. . if '\\*[ft*x]'FB' .nr ds*float-break 1
  1687. . if \\n[D]>1 .tm WC WF=\\n[ft*wide] WD=\\n[ds*wide]
  1688. .\}
  1689. ..
  1690. .\"-----------------
  1691. .\" begin footnote
  1692. .\" Change environment, switch to diversion and print the foot-note mark.
  1693. .de FS
  1694. .if \\n[ft*busy] .@error "FS: missing FE"
  1695. .nr ft*busy 1
  1696. .ev ft*ev
  1697. .ft@init
  1698. .if !\\n[ft*wide] .pg@set-po
  1699. .di ft*tmp-div
  1700. .nr ft*space (u;\\n[Fs]*\\n[Lsp])
  1701. .sp \\n[ft*space]u
  1702. .\" print mark
  1703. .ie \\n[.$] .ds ft*mark \\$1
  1704. .el .ds ft*mark \\n[ft*nr].
  1705. \\*[ft*mark]
  1706. .in +.75c
  1707. .sp -1
  1708. .nr ft*exist 1
  1709. ..
  1710. .\"-----------------
  1711. .\" init footnote diversion
  1712. .de ft@init-footnote
  1713. .di ft*div
  1714. \l'20n'
  1715. .br
  1716. .di
  1717. .nr ft*note-size \\n[dn]
  1718. ..
  1719. .\"-----------------
  1720. .\" end footnote
  1721. .\" End the diversion, back to previous environment, and adjust
  1722. .\" the trap to the new foot-note size.
  1723. .de FE
  1724. .nr ft*busy 0
  1725. .br
  1726. .di
  1727. 'in 0
  1728. 'nf
  1729. .if \\n[@pl]u<\\n[dn]u .@error "FE: too big footnote"
  1730. .if !d ft*div .nr dn +1v
  1731. .if \\n[D]>3 .tm FE: foot-trap=\\n[pg*foot-trap] .d=\\n[.d] dn=\\n[dn]
  1732. .ie (\\n[pg*foot-trap]u-\\n[.d]u)<\\n[dn]u \{\
  1733. . da ft*next-div
  1734. . ft*tmp-div
  1735. . br
  1736. . di
  1737. .\}
  1738. .el \{\
  1739. . if !d ft*div .ft@init-footnote
  1740. . da ft*div
  1741. . ft*tmp-div
  1742. . di
  1743. . nr ft*note-size +\\n[dn]
  1744. .\}
  1745. .rm ft*tmp-div
  1746. .ev
  1747. .pg@move-trap
  1748. ..
  1749. .\"-----------------
  1750. .\" print footnotes, see pg@footer
  1751. .de ft@print
  1752. .ev ft*print-ev
  1753. 'nf
  1754. 'in 0
  1755. .ll 100i
  1756. .ft*div
  1757. .br
  1758. .ev
  1759. .rm ft*div
  1760. .nr ft*note-size 0
  1761. .pg@move-trap
  1762. ..
  1763. .\"-----------------
  1764. .\" check if any pending footnotes, see pg@header
  1765. .de ft@check-old
  1766. .if d ft*next-div \{\
  1767. . ev ft*ev
  1768. . ft@init
  1769. . ft@init-footnote
  1770. . nf
  1771. . in 0
  1772. . da ft*div
  1773. . ft*next-div
  1774. . di
  1775. . nr ft*note-size +\\n[dn]
  1776. . rm ft*next-div
  1777. . ev
  1778. . nr ft*exist 0
  1779. . pg@move-trap
  1780. .\}
  1781. ..
  1782. .\"########### module display ###################
  1783. .nr ds*wide 0\" >0 if wide displays wanted
  1784. .nr df*fnr 0 1\" floating display counter
  1785. .nr df*o-fnr 1\" floating display counter, already printed
  1786. .nr ds*snr 0 1\" static display counter
  1787. .nr ds*lvl 0 1\" display level
  1788. .nr ds*float-busy 0\" >0 if printing float
  1789. .nr df*float 0 >0 if previous display was floating
  1790. .\"--------------------------------------------
  1791. .de DE
  1792. .ie \\n[df*float] .df@end \\$@
  1793. .el .ds@end \\$@
  1794. ..
  1795. .\"--------------------------------------------
  1796. .\" floating display start
  1797. .\" nested DF/DE is not allowed.
  1798. .de DF
  1799. .if \\n[df*float] .@error "DF:nested floating is not allowed. Use DS."
  1800. .ds@set-format \\$@
  1801. .\"
  1802. .nr df*old-ll \\n[.l]
  1803. .nr ds*ftmp \\n[.f]
  1804. .misc@ev-keep df*ev
  1805. .ft \\n[ds*ftmp]
  1806. .\"
  1807. .init@reset
  1808. .di df*div
  1809. 'in 0
  1810. .\"
  1811. .ds@set-new-ev \\n[df*old-ll]
  1812. .SP \\n[Lsp]u
  1813. .nr df*float 1
  1814. ..
  1815. .\"--------------------------------------------
  1816. .de df@end
  1817. .br
  1818. .SP \\n[Lsp]u
  1819. .di
  1820. .nr df*width!\\n+[df*fnr] \\n[dl]
  1821. .nr df*height!\\n[df*fnr] \\n[dn]
  1822. .nr df*wide!\\n[df*fnr] \\n[ds*wide]
  1823. .nr df*format!\\n[df*fnr] \\n[ds*format]
  1824. .ev
  1825. .if \\n[D]>2 .tm DF:fnr=\\n[df*fnr] w=\\n[dl] h=\\n[dn] wide=\\n[ds*wide] \
  1826. form=\\n[ds*format]
  1827. .\" move div to the floating display list
  1828. .rn df*div df*fdiv!\\n[df*fnr]
  1829. .\"
  1830. .nr par@ind-flag 0
  1831. .\" print float if queue is empty and the display fits into
  1832. .\" the current page
  1833. .if ((\\n[df*fnr]>=\\n[df*o-fnr])&(\\n[dn]<\\n[.t])) .df@print-float 1
  1834. .nr df*float 0
  1835. ..
  1836. .\"-------------
  1837. .\" called by end-of-text
  1838. .de df@eot-print
  1839. .br
  1840. .if \\n[df*o-fnr]<=\\n[df*fnr] \{\
  1841. . if \\n[D]>2 .tm Print remaining displays.
  1842. .\" still some floats left, make non-empty environment
  1843. . misc@ev-keep ne
  1844. . init@reset
  1845. \c
  1846. . df@print-float 3
  1847. . ev
  1848. .\}
  1849. ..
  1850. .\"---------------
  1851. .\" print according to Df and De.
  1852. .\" .df@print-float type
  1853. .\" type called from
  1854. .\" 1 .DE
  1855. .\" 2 end of section
  1856. .\" 3 end of document
  1857. .\" 4 beginning of new page
  1858. .\"
  1859. .de df@print-float
  1860. .if \\n[Df]>5 .@error "Df=\\n[Df], max value is 5"
  1861. .if !\\n[ds*float-busy] \{\
  1862. . nr ds*float-busy 1
  1863. .\" at .DE
  1864. . if \\n[D]>3 .tm print-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
  1865. . \" Df = 1 or 5
  1866. . if (\\$1=1)&((\\n[Df]=1):(\\n[Df]=5)) \{\
  1867. . if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
  1868. . \" Print only new displays.
  1869. . if \\n[df*o-fnr]=\\n[df*fnr] \{\
  1870. . br
  1871. . ds@print-one-float
  1872. . \}
  1873. . \}
  1874. . \}
  1875. . \" Df = 3
  1876. . if (\\$1=1)&(\\n[Df]=3) \{\
  1877. . if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
  1878. . br
  1879. . ds@print-one-float
  1880. . \}
  1881. . \}
  1882. .\" print all if Df<2 and end of section
  1883. . if (\\$1=2)&(\\n[Sectp]>0)&(\\n[Df]<2) \{\
  1884. . br
  1885. . ds@print-all-floats
  1886. . \}
  1887. .\" print all if end of document. Where should they go instead?
  1888. . if \\$1=3 \{\
  1889. . br
  1890. . ds@print-all-floats
  1891. .\}
  1892. .\" new page
  1893. . if (\\$1=4)&(\\n[Df]>1) \{\
  1894. . if \\n[Df]=2 .ds@print-one-float
  1895. . if \\n[Df]=3 .ds@print-one-float
  1896. . if \\n[Df]>3 \{\
  1897. . ie \\n[De] .ds@print-all-floats
  1898. . el .ds@print-this-page
  1899. . \}
  1900. . \}
  1901. . nr ds*float-busy 0
  1902. .\}
  1903. ..
  1904. .\"---------------
  1905. .\" DF out
  1906. .\" print a floating diversion
  1907. .de ds@output-float
  1908. .nr df*old-ll \\n[.l]
  1909. .nr df*old-in \\n[.i]
  1910. .ev ds*fev
  1911. .nf
  1912. .nr df*i \\n[df*o-fnr]
  1913. .nr df*f \\n[df*format!\\n[df*i]]
  1914. .\"
  1915. .in \\n[df*old-in]u
  1916. .if \\n[df*f]=1 'in +\\n[Si]n
  1917. .if \\n[df*f]>=2 'in 0
  1918. .if \\n[df*f]=2 'ce 9999
  1919. .if \\n[df*f]=3 'in (u;(\\n[.l]-\\n[df*width!\\n[df*i]])/2)
  1920. .if \\n[df*f]=4 'rj 9999
  1921. .if \\n[df*f]=5 'in (u;\\n[.l]-\\n[df*width!\\n[df*i]])
  1922. .\"
  1923. .\"
  1924. .df*fdiv!\\n[df*o-fnr]
  1925. .\"
  1926. .if \\n[df*f]=2 'ce 0
  1927. .if \\n[df*f]=4 'rj 0
  1928. .ev
  1929. .rm df*fdiv!\\n[df*i]
  1930. .rm df*height!\\n[df*i]
  1931. .rm df*format!\\n[df*i]
  1932. .if \\n[df*wide!\\n[df*i]] .nr pg*head-mark \\n[nl]u
  1933. .nr df*o-fnr +1
  1934. ..
  1935. .\"---------------
  1936. .\" print one floating display if there is one.
  1937. .de ds@print-one-float
  1938. .if \\n[df*o-fnr]<=\\n[df*fnr] \{\
  1939. . if \\n[D]>3 .tm print-one-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
  1940. . if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
  1941. . ds@output-float
  1942. . if \\n[De] .pg@next-page
  1943. .\}
  1944. ..
  1945. .\"---------------
  1946. .\" print all queued floats.
  1947. .\" if De>0 do a page eject between the floats.
  1948. .de ds@print-all-floats
  1949. .while \\n[df*o-fnr]<=\\n[df*fnr] \{\
  1950. . if \\n[D]>3 .tm print-all-floats: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
  1951. . if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
  1952. . br
  1953. \c
  1954. . ds@output-float
  1955. . if \\n[De] .pg@next-page
  1956. .\}
  1957. ..
  1958. .\"---------------
  1959. .\" print as many floats as will fit on the current page
  1960. .de ds@print-this-page
  1961. .while \\n[df*o-fnr]<=\\n[df*fnr] \{\
  1962. . if \\n[D]>3 .tm print-this-page: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
  1963. . if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .break
  1964. . ds@output-float
  1965. .\}
  1966. ..
  1967. .\"---------------------------------------------------
  1968. .\" get format of the display
  1969. .de ds@set-format
  1970. .ie \\n[.$] \{\
  1971. . ie r ds*format!\\$1 .nr ds*format \\n[ds*format!\\$1]
  1972. . el .@error "DS/DF:wrong format:\\$1"
  1973. .\}
  1974. .el .nr ds*format 0
  1975. .if \\n[D]>2 .tm set format=\\n[ds*format]
  1976. .\" fill or not to fill, that is the...
  1977. .nr ds*fill 0
  1978. .ie \\n[.$]>1 \{\
  1979. . ie r ds*fill!\\$2 .nr ds*fill \\n[ds*fill!\\$2]
  1980. . el .@error "\\*[ds*type]:wrong fill:\\$2"
  1981. .\}
  1982. .if \\n[D]>2 .tm set fill=\\n[ds*fill]
  1983. .nr ds*rindent 0
  1984. .if \\n[.$]>2 .nr ds*rindent \\$3
  1985. .if \\n[D]>2 .tm set indent=\\n[ds*rindent]
  1986. ..
  1987. .\"-----------------------------
  1988. .\" .ds@set-new-ev previous-line-length
  1989. .de ds@set-new-ev
  1990. .ll \\$1u
  1991. .lt \\$1u
  1992. .if \\n[ds*rindent] \{\
  1993. . ll -\\n[ds*rindent]n
  1994. . lt -\\n[ds*rindent]n
  1995. .\}
  1996. .if \\n[ds*wide] \{\
  1997. . ll \\n[@ll]u
  1998. . lt \\n[@ll]u
  1999. .\}
  2000. .\"
  2001. .ie \\n[ds*fill] 'fi
  2002. .el 'nf
  2003. ..
  2004. .\"--------------------------------------------------------
  2005. .nr ds*format 0\" dummy value for .En/.EQ
  2006. .nr ds*format! 0\" no indent
  2007. .nr ds*format!0 0\" no indent
  2008. .nr ds*format!L 0\" no indent
  2009. .nr ds*format!I 1\" indent
  2010. .nr ds*format!1 1\" indent
  2011. .nr ds*format!C 2\" center each line
  2012. .nr ds*format!2 2\" center each line
  2013. .nr ds*format!CB 3\" center as block
  2014. .nr ds*format!3 3\" center as block
  2015. .nr ds*format!R 4\" right justify each line
  2016. .nr ds*format!4 4\" right justify each line
  2017. .nr ds*format!RB 5\" right justify as block
  2018. .nr ds*format!5 5\" right justify as block
  2019. .\"---------------
  2020. .nr ds*fill! 0\" no fill
  2021. .nr ds*fill!N 0\" no fill
  2022. .nr ds*fill!0 0\" no fill
  2023. .nr ds*fill!F 1\" fill on
  2024. .nr ds*fill!1 1\" fill on
  2025. .\"--------------------------------------------
  2026. .\" static display start
  2027. .\" nested DS/DE is allowed. No limit on depth.
  2028. .de DS
  2029. .br
  2030. .nr XXX \\n[nl]
  2031. .nr ds*lvl +1
  2032. .ds@set-format \\$@
  2033. .\"
  2034. .nr ds*old-ll \\n[.l]
  2035. .nr ds*old-in \\n[.i]
  2036. .misc@push ds-ll \\n[.l]
  2037. .misc@push ds-form \\n[ds*format]
  2038. .nr ds*i \\n[.i]
  2039. .nr ds*ftmp \\n[.f]
  2040. .misc@ev-keep ds*ev!\\n+[ds*snr]
  2041. .ft \\n[ds*ftmp]
  2042. .\"
  2043. .init@reset
  2044. .\" indent in a diversion doesn't seem like a good idea.
  2045. 'in 0
  2046. .di ds*div!\\n[ds*snr]
  2047. .\"
  2048. .ds@set-new-ev \\n[ds*old-ll]
  2049. .nr df*float 0
  2050. ..
  2051. .\"--------------------------------------------
  2052. .de ds@end
  2053. .if \\n-[ds*lvl]<0 .@error "DE: no corresponding DS"
  2054. .br
  2055. .di
  2056. .\" **********
  2057. .nr ds*width \\n[dl]
  2058. .nr ds*height \\n[dn]
  2059. .misc@pop-nr ds-ll ds*old-ll
  2060. .misc@pop-nr ds-form ds*format
  2061. .\"
  2062. .\" **********
  2063. 'nf
  2064. .\" calculate needed space
  2065. .nr ds*need \\n[ds*height]
  2066. .nr ds*i \\n[pg*foot-trap]-\\n[pg*header-size]u-\\n[pg*extra-header-size]u
  2067. .if (\\n[ds*height]>\\n[ds*i])&(\\n[.t]<(\\n[ds*i]/2)) .nr ds*need \\n[.t]u+1v
  2068. .if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) .nr ds*need \\n[.t]u+1v
  2069. .\" Eject page if display will fit one page and
  2070. .\" there are less than half of the page left.
  2071. .if \\n[ds*need] .ne \\n[ds*need]u
  2072. .\"
  2073. .\" check if pending equation label
  2074. .eq@check \\n[ds*need]
  2075. 'in \\n[ds*old-in]u
  2076. .if \\n[ds*format]=1 'in \\n[ds*old-in]u+\\n[Si]n
  2077. .if \\n[ds*format]>=2 'in 0
  2078. .if \\n[ds*format]=2 'ce 9999
  2079. .if \\n[ds*format]=3 'in (u;(\\n[.l]-\\n[ds*width])/2)
  2080. .if \\n[ds*format]=4 'rj 9999
  2081. .if \\n[ds*format]=5 'in (u;\\n[.l]-\\n[ds*width])
  2082. .\" **********
  2083. .\"
  2084. .\" Print static display
  2085. .nr ds*i \\n[Lsp]
  2086. .if r Dsp .nr ds*i \\n[Dsp]
  2087. .\"
  2088. .if \\n[Ds] .sp \\n[ds*i]u
  2089. .ds*div!\\n[ds*snr]
  2090. .if \\n[Ds] .sp \\n[ds*i]u
  2091. .\"
  2092. .if \\n[ds*format]=2 'ce 0
  2093. .if \\n[ds*format]=4 'rj 0
  2094. .rm ds*div!\\n[ds*snr]
  2095. .nr ds*snr -1
  2096. .nr par@ind-flag 0
  2097. .ev
  2098. ..
  2099. .\"########### module list ###################
  2100. .\" .LI text-indent mark-indent pad type [mark [LI-space [LB-space] ] ]
  2101. .\"
  2102. .nr li*tind 0
  2103. .nr li*mind 0
  2104. .nr li*pad 0
  2105. .nr li*type 0
  2106. .ds li*mark 0
  2107. .nr li*li-spc 0
  2108. .nr li*lvl 0 1
  2109. .aln :g li*lvl
  2110. .nr li*cur-vpos 0
  2111. .\"--------------------------
  2112. .\" the major list-begin macro.
  2113. .\" If type == -1 a 'break' will occur.
  2114. .de LB
  2115. .if \\n[.$]<4 .@error "LB: not enough arguments, min 4"
  2116. .misc@push cind \\n[.i]
  2117. .misc@push tind \\n[li*tind]
  2118. .misc@push mind \\n[li*mind]
  2119. .misc@push pad \\n[li*pad]
  2120. .misc@push type \\n[li*type]
  2121. .misc@push li-spc \\n[li*li-spc]
  2122. .ds li*mark-list!\\n[li*lvl] \\*[li*mark]
  2123. .nr li*lvl +1
  2124. .\"
  2125. .nr li*tind (n;0\\$1)\" text-indent
  2126. .nr li*mind (n;0\\$2)\" mark-indent
  2127. .nr li*pad (n;0\\$3)\" pad
  2128. .nr li*type 0\\$4\" type
  2129. .ds li*mark \\$5\" mark
  2130. .ie !'\\$6'' .nr li*li-spc \\$6\" LI-space
  2131. .el .nr li*li-spc 1
  2132. .ie !'\\$7'' .nr li*lb-spc \\$7\" LB-space
  2133. .el .nr li*lb-spc 0
  2134. .\" init listcounter
  2135. .nr li*cnt!\\n[li*lvl] 0 1
  2136. .\" assign format
  2137. .af li*cnt!\\n[li*lvl] 1
  2138. .if \\n[li*type] .if !'\\*[li*mark]'' .af li*cnt!\\n[li*lvl] \\*[li*mark]
  2139. .\"
  2140. .if \\n[li*lb-spc] .SP (u;\\n[li*lb-spc]*\\n[Lsp])
  2141. .in +\\n[li*tind]u
  2142. ..
  2143. .\"---------------
  2144. .de LI
  2145. .if \\n[li*lvl]<1 .@error "LI:no lists active"
  2146. .if \\n[li*li-spc]&(\\n[Ls]>=\\n[li*lvl]) .SP (u;\\n[li*li-spc]*\\n[Lsp])
  2147. .ne 2v
  2148. .\"
  2149. .ds li*c-mark \\*[li*mark]
  2150. .nr li*cnt!\\n[li*lvl] +1
  2151. .if \\n[li*type]=1 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]].
  2152. .if \\n[li*type]=2 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]])
  2153. .if \\n[li*type]=3 .ds li*c-mark (\\n[li*cnt!\\n[li*lvl]])
  2154. .if \\n[li*type]=4 .ds li*c-mark [\\n[li*cnt!\\n[li*lvl]]]
  2155. .if \\n[li*type]=5 .ds li*c-mark <\\n[li*cnt!\\n[li*lvl]]>
  2156. .if \\n[li*type]=6 .ds li*c-mark {\\n[li*cnt!\\n[li*lvl]]}
  2157. .if \\n[.$]=1 .ds li*c-mark \\$1
  2158. .ie \\n[.$]=2 \{\
  2159. . ie (\\$2=2):(\\n[Limsp]=0) .ds li*c-mark \\$1\\*[li*c-mark]
  2160. . el .ds li*c-mark \\$1\ \\*[li*c-mark]
  2161. .\}
  2162. .\"
  2163. .\" determine where the text begins
  2164. .nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]\ @
  2165. .nr x \w@\\*[li*c-mark]\ @
  2166. .\"
  2167. .\" determine where the mark begin
  2168. .ie !\\n[li*pad] .nr li*in \\n[li*mind]
  2169. .el .nr li*in \\n[li*text-begin]-\\n[li*pad]-\w@\\*[li*c-mark]@
  2170. .if !\\n[li*in] .nr li*in 0
  2171. .\"
  2172. .ti -\\n[li*tind]u
  2173. .\" no indentation if hanging indent
  2174. .if (\w@\\*[li*c-mark]@=0)&((\\n[.$]=0):(\w@\\$1@=0)) .nr li*text-begin 0
  2175. \Z'\&\h'\\n[li*in]u'\\*[li*c-mark]'\h'\\n[li*text-begin]u'\&\c
  2176. .if \\n[li*type]=-1 .br
  2177. ..
  2178. .\"
  2179. .\"-------------
  2180. .de li@pop
  2181. .nr li*lvl -1
  2182. .misc@pop-nr cind li*tmp
  2183. .in \\n[li*tmp]u
  2184. .misc@pop-nr tind li*tind
  2185. .misc@pop-nr mind li*mind
  2186. .misc@pop-nr pad li*pad
  2187. .misc@pop-nr type li*type
  2188. .misc@pop-nr li-spc li*li-spc
  2189. .ds li*mark \\*[li*mark-list!\\n[li*lvl]]
  2190. ..
  2191. .de LE
  2192. .if \\n[li*lvl]<1 .@error "LE:mismatched"
  2193. .li@pop
  2194. .if '\\$1'1' .SP \\n[Lsp]u
  2195. ..
  2196. .\"-------------
  2197. .\" list status clear.
  2198. .\" terminate all lists to level i
  2199. .de LC
  2200. .ie \\n[.$]<1 .nr li*i 0
  2201. .el .nr li*i \\$1
  2202. .if \\n[li*i]>\\n[li*lvl] .@error "LC: incorrect argument: \\n[li*i] (too big)"
  2203. .while \\n[li*lvl]>\\n[li*i] .li@pop
  2204. .nr par@ind-flag 0
  2205. ..
  2206. .\"-------------
  2207. .de AL
  2208. .if \\n[.$]>3 .@error "AL: too many arguments"
  2209. .if \\n[D]>2 .tm AL $*
  2210. .ie \\n[.$]<=1 .LB \\n[Li] 0 2 1 "\\$1"
  2211. .el \{\
  2212. . ie \\n[.$]=2 .LB 0\\$2 0 2 1 "\\$1"
  2213. . el \{\
  2214. . ie !'\\$2'' .LB \\$2 0 2 1 "\\$1" 0 1
  2215. . el .LB \\n[Li] 0 2 1 "\\$1" 0 1
  2216. . \}
  2217. .\}
  2218. ..
  2219. .de ML
  2220. .if \\n[.$]>3 .@error "ML: too many arguments"
  2221. .if \\n[D]>2 .tm ML $*
  2222. .nr li*ml-width \w@\\$1@u+1n
  2223. .if \\n[.$]<2 .LB \\n[li*ml-width]u 0 1 0 "\\$1"
  2224. .if \\n[.$]=2 .LB 0\\$2 0 1 0 "\\$1"
  2225. .if \\n[.$]=3 \{\
  2226. . ie '\\$2'' .LB \\n[li*ml-width]u 0 1 0 "\\$1" 0 1
  2227. . el .LB \\n[Li] 0 1 0 "\\$1" 0 1
  2228. .\}
  2229. ..
  2230. .de VL
  2231. .if \\n[D]>2 .tm VL $*
  2232. .if \\n[.$]>3 .@error "VL: too many arguments"
  2233. .if \\n[.$]<1 .@error "VL: missing text-indent"
  2234. .ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 0
  2235. .el .LB 0\\$1 0\\$2 0 0 \& 0 1
  2236. ..
  2237. .\" Bullet (for .BL)
  2238. .de BL
  2239. .if \\n[D]>2 .tm BL $*
  2240. .ds BU \s-2\(bu\s0
  2241. .if \\n[.$]>2 .@error "BL: too many arguments"
  2242. .if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \\*[BU]
  2243. .if \\n[.$]=1 .LB 0\\$1 0 1 0 \\*[BU]
  2244. .if \\n[.$]=2 \{\
  2245. . ie '\\$1'' .LB \\n[Pi] 0 1 0 \\*[BU] 0 1
  2246. . el .LB 0\\$1 0 1 0 \\*[BU] 0 1
  2247. .\}
  2248. ..
  2249. .de DL
  2250. .if \\n[D]>2 .tm DL $*
  2251. .if \\n[.$]>2 .@error "DL: too many arguments"
  2252. .if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \(em
  2253. .if \\n[.$]=1 .LB 0\\$1 0 1 0 \(em
  2254. .if \\n[.$]=2 \{\
  2255. . ie '\\$1'' .LB \\n[Pi] 0 1 0 \(em 0 1
  2256. . el .LB 0\\$1 0 1 0 \(em 0 1
  2257. .\}
  2258. ..
  2259. .de RL
  2260. .if \\n[D]>2 .tm RL $*
  2261. .if \\n[.$]>2 .@error "RL: too many arguments"
  2262. .if \\n[.$]<1 .LB 6 0 2 4
  2263. .if \\n[.$]=1 .LB 0\\$1 0 2 4
  2264. .if \\n[.$]=2 \{\
  2265. . ie '\\$1'' .LB 6 0 2 4 1 0 1
  2266. . el .LB 0\\$1 0 2 4 1 0 1
  2267. .\}
  2268. ..
  2269. .\" Broken Variable List. As .VL but text begin on the next line
  2270. .de BVL
  2271. .if \\n[D]>2 .tm BVL $*
  2272. .if \\n[.$]>3 .@error "BVL: too many arguments"
  2273. .if \\n[.$]<1 .@error "BVL: missing text-indent"
  2274. .ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 -1
  2275. .el .LB 0\\$1 0\\$2 0 -1 \& 0 1
  2276. ..
  2277. .\" ####### module tbl #######################################
  2278. .\" This module is copied from groff_ms and modified for mgm.
  2279. .\" Yes, it does not resemble the original anymore :-).
  2280. .\" Don't know if I missed something important.
  2281. .\" Groff_ms is written by James Clark.
  2282. .nr tbl*have-header 0
  2283. .nr tbl*header-written 0
  2284. .de TS
  2285. .br
  2286. .if ''\\n[.z]' .SP
  2287. .if '\\$1'H' .di tbl*header-div
  2288. ..
  2289. .de tbl@top-hook
  2290. .if \\n[tbl*have-header] \{\
  2291. . ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl@print-header
  2292. . el .sp \\n[.t]u
  2293. .\}
  2294. ..
  2295. .de tbl@bottom-hook
  2296. .if \\n[tbl*have-header] \{\
  2297. . nr T. 1
  2298. .\" draw bottom and side lines of boxed tables.
  2299. . T#
  2300. .\}
  2301. .nr tbl*header-written 0
  2302. ..
  2303. .de tbl@print-header
  2304. .ev tbl*ev
  2305. 'nf
  2306. .tbl*header-div
  2307. .ev
  2308. .mk #T
  2309. .nr tbl*header-written 1
  2310. ..
  2311. .de TH
  2312. .ie '\\n[.z]'tbl*header-div' \{\
  2313. . nr T. 0
  2314. . T#
  2315. . br
  2316. . di
  2317. . nr tbl*header-ht \\n[dn]
  2318. . ne \\n[dn]u+1v
  2319. . nr tbl*have-header 1
  2320. . ie '\\$1'N' .if !\\n[tbl*header-written] .tbl@print-header
  2321. . el .tbl@print-header
  2322. .\}
  2323. .el .@error ".TH without .TS H"
  2324. ..
  2325. .de TE
  2326. .ie '\\n(.z'tbl*header-div' .@error ".TS H but no .TH before .TE"
  2327. .el \{\
  2328. . nr tbl*have-header 0
  2329. .\}
  2330. .\" reset tabs
  2331. .TAB
  2332. ..
  2333. .de T&
  2334. ..
  2335. .\" ####### module pic #######################################
  2336. .de PS
  2337. .nr pic*in 0
  2338. .br
  2339. .SP .5
  2340. .ie \\n[.$]<2 .@error "PS: bad arguments. Probably not processed with pic."
  2341. .el \{\
  2342. . if !\\n[ds*lvl] .ne (u;\\$1)+1v
  2343. .\" should be contained between .DS/.DE
  2344. .if r ds*format \{\
  2345. . if \\n[ds*lvl]&((\\n[ds*format]=2):(\\n[ds*format]=3)) \{\
  2346. . nr pic*in \\n[.i]
  2347. .\" . in +(u;\\n[.l]-\\n[.i]-\\$2/2)
  2348. . \}
  2349. . \}
  2350. .\}
  2351. ..
  2352. .de PE
  2353. .init@reset
  2354. .SP .5
  2355. ..
  2356. .\" ####### module eq #######################################
  2357. .\"
  2358. .nr eq*number 0 1
  2359. .ds eq*label
  2360. .de EQ
  2361. .ds eq*label "\\$1
  2362. ..
  2363. .de eq@check
  2364. .if !'\\*[eq*label]'' \{\
  2365. . mk
  2366. . \" space down to middle of equation
  2367. ' sp (u;\\$1/2)
  2368. . ie (\\n[Eq]%2) \{\
  2369. . \" label to the left
  2370. \h'|0'\\*[eq*label]
  2371. . \}
  2372. . el \{\
  2373. . \" label to the right
  2374. \h'|\\n[.l]u'\\*[eq*label]
  2375. . \}
  2376. . rt
  2377. .\}
  2378. .ds eq*label
  2379. ..
  2380. .de EN
  2381. ..
  2382. .\"########### module toc ###################
  2383. .\" table of contents
  2384. .nr toc*slevel 1
  2385. .nr toc*spacing \n[Lsp]u
  2386. .nr toc*tlevel 2
  2387. .nr toc*tab 0
  2388. .\"-----------
  2389. .\" Table of contents with friends (module lix)
  2390. .de TC
  2391. .br
  2392. .\" print any pending displays and references
  2393. .df@print-float 3
  2394. .if \\n[ref*flag] .RP 0 1
  2395. .\"
  2396. .if \w@\\$1@>0 .nr toc*slevel \\$1
  2397. .if \w@\\$2@>0 .nr toc*spacing (u;\\$2*\\n[Lsp])
  2398. .if \w@\\$3@>0 .nr toc*tlevel \\$3
  2399. .if \w@\\$4@>0 .nr toc*tab \\$4
  2400. .if \\n[pg*cols-per-page]>1 .1C
  2401. .ds H1txt \\*[Licon]
  2402. .ds Tcst co
  2403. .pg@clear-hd
  2404. .EF ""
  2405. .OF ""
  2406. .pg@next-page
  2407. .\"-------------
  2408. .if d Ci .toc@read-Ci \\*[Ci]
  2409. .nf
  2410. .in 0
  2411. .ie \\n[Oc] .hd@set-page 1
  2412. .el \{\
  2413. . nr toc*pn 1 1
  2414. . af toc*pn i
  2415. . aln ;g toc*pn
  2416. . PF "''\\\\\\\\n[toc*pn]''"
  2417. . am pg@header
  2418. . nr toc*pn +1
  2419. \\..
  2420. .\}
  2421. .nr toc*i 4 1
  2422. .while \\n+[toc*i]<10 \{\
  2423. . if !'\\$\\n[toc*i]'' \{\
  2424. . ce
  2425. \\$\\n[toc*i]
  2426. . br
  2427. . \}
  2428. .\}
  2429. .if \\n[.$]<=4 .if d TX .TX
  2430. .ie d TY .if \\n[.$]<=4 .TY
  2431. .el \{\
  2432. . ce
  2433. \\*[Licon]
  2434. . br
  2435. . SP 3
  2436. .\}
  2437. .if d toc*list .toc*list
  2438. .br
  2439. .\" print LIST OF XXX
  2440. .if d lix*dsfg .lix@print-ds fg FG "\\*[Lf]" \\n[.$]
  2441. .if d lix*dstb .lix@print-ds tb TB "\\*[Lt]" \\n[.$]
  2442. .if d lix*dsec .lix@print-ds ec EC "\\*[Le]" \\n[.$]
  2443. .if d lix*dsex .lix@print-ds ex EX "\\*[Lx]" \\n[.$]
  2444. ..
  2445. .\"-----------
  2446. .\" .toc@read-Ci lev1 lev2 lev3 lev4 ... lev7
  2447. .de toc@read-Ci
  2448. .nr toc*i 0 1
  2449. .while \\n+[toc*i]<15 \{\
  2450. . nr toc*hl!\\n[toc*i] \\$[\\n[toc*i]]
  2451. .\}
  2452. ..
  2453. .\"-----------
  2454. .de toc@entry
  2455. .ie \\n[Sectp] \{\
  2456. . toc@save \\$1 "\\*[hd*mark]" "\\$2" \\*[hd*sect-pg]
  2457. .\}
  2458. .el .toc@save \\$1 "\\*[hd*mark]" "\\$2" \\n[%]
  2459. ..
  2460. .als )E toc@entry
  2461. .\"-----------
  2462. .de toc@save
  2463. .\" collect maxsize of mark if string Ci don't exist.
  2464. .if !d Ci \{\
  2465. . if !r toc*hl!\\$1 .nr toc*hl!\\$1 0
  2466. . if \\n[toc*hl!\\$1]<=\w@\\$2@ \{\
  2467. . nr toc*hl!\\$1 \w@\\$2@u
  2468. . \}
  2469. .\}
  2470. .am toc*list
  2471. .\" .toc@set level headernumber text pagenr
  2472. .toc@set \\$1 "\\$2" "\\$3" \\$4
  2473. \\..
  2474. ..
  2475. .\"-----------
  2476. .\" level mark text pagenumber
  2477. .de toc@set
  2478. .if \\$1<=\\n[toc*slevel] .SP \\n[toc*spacing]u
  2479. .na
  2480. .fi
  2481. .nr toc*ind 0
  2482. .nr toc*i 0 1
  2483. .ie d Ci \{\
  2484. . nr toc*ind +\\n[toc*hl!\\$1]u
  2485. .\}
  2486. .el \{\
  2487. . while \\n+[toc*i]<\\$1 \{\
  2488. . nr toc*ind +\\n[toc*hl!\\n[toc*i]]u
  2489. . \}
  2490. .\}
  2491. .nr toc*text \\n[toc*ind]u+\\n[toc*hl!\\$1]u
  2492. .in \\n[toc*text]u
  2493. .ti -\\n[toc*hl!\\$1]u
  2494. .\"
  2495. .\" length of headernum space
  2496. .nr toc*i \\n[toc*hl!\\$1]-\w@\\$2@
  2497. .\"
  2498. .ll \\n[@ll]u-\w@\\$4@u-2m
  2499. .ne 2v
  2500. .\" ragged right ---------------------------------
  2501. .ie \\$1>\\n[toc*tlevel] \{\
  2502. \\$2
  2503. . sp -1
  2504. \\$3\ \ \ \\$4
  2505. . br
  2506. .\}
  2507. .el \{\
  2508. . \" unnumbered heading --------------------
  2509. . ie '\\$2'' \{\
  2510. . in \\n[toc*ind]u
  2511. \\$3\h'1m'
  2512. . \}
  2513. . \" normal heading ------------------------
  2514. . el \{\
  2515. \\$2
  2516. . sp -1
  2517. \\$3\h'1m'
  2518. . \}
  2519. . ll \\n[@ll]u
  2520. . sp -1
  2521. . nr toc*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$4@)-1m
  2522. \h'|\\n[.n]u'\l'\\n[toc*sep]u.'\h'1m'\\$4
  2523. .\}
  2524. .ll \\n[@ll]u
  2525. ..
  2526. .\"########################### module lix ############################
  2527. .\" LIST OF figures, tables, exhibits and equations
  2528. .nr lix*fg-nr 0 1
  2529. .nr lix*tb-nr 0 1
  2530. .nr lix*ec-nr 0 1
  2531. .nr lix*ex-nr 0 1
  2532. .aln Fg lix*fg-nr
  2533. .aln Tb lix*tb-nr
  2534. .aln Ec lix*ec-nr
  2535. .aln Ex lix*ex-nr
  2536. .\"------------
  2537. .de FG
  2538. .lix@print-line fg Lf \\n+[lix*fg-nr] "\\$1" "\\$2" "\\$3" "\\$4"
  2539. ..
  2540. .de TB
  2541. .lix@print-line tb Lt \\n+[lix*tb-nr] "\\$1" "\\$2" "\\$3" "\\$4"
  2542. ..
  2543. .de EC
  2544. .lix@print-line ec Le \\n+[lix*ec-nr] "\\$1" "\\$2" "\\$3" "\\$4"
  2545. ..
  2546. .de EX
  2547. .lix@print-line ex Lx \\n+[lix*ex-nr] "\\$1" "\\$2" "\\$3" "\\$4"
  2548. ..
  2549. .\"------------
  2550. .\" print line with 'figure' in the text
  2551. .\" type stringvar number text override flag refname
  2552. .de lix@print-line
  2553. .ds lix*text "\\$4
  2554. .\"
  2555. .ie \\n[Sectf] .ds lix*numb \\n[H1]-\\$3
  2556. .el .ds lix*numb \\$3
  2557. .\"
  2558. .ie !\\n[Of] .ds lix*ds-form .\ \ \"
  2559. .el .ds lix*ds-form "\ \(em\ \"
  2560. .nr lix*in \\n[.i]
  2561. .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\*[lix*ds-form]
  2562. .if !'\\$5'' \{\
  2563. . if !0\\$6 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*numb]\\*[lix*ds-form]
  2564. . if 0\\$6=1 .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\$5\\*[lix*ds-form]
  2565. . if 0\\$6=2 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*ds-form]
  2566. .\}
  2567. .\" print line if not between DS/DE
  2568. .ie \\n[ds*lvl]<1&\\n[df*float]=0 \{\
  2569. . lix@print-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
  2570. .\}
  2571. .el \{\
  2572. . lix@embedded-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
  2573. .\}
  2574. .\"
  2575. ..
  2576. .\"-----------
  2577. .\" label text type stringvar refname
  2578. .de lix@print-text
  2579. .ie \\n[Sectp] .ds lix*pgnr \\*[hd*sect-pg]
  2580. .el .ds lix*pgnr \\n[%]
  2581. .SP \\n[Lsp]u
  2582. .misc@ev-keep lix
  2583. .init@reset
  2584. .br
  2585. .ie (\w@\\$1\\$2@)>(\\n[.l]-\\n[.i]) \{\
  2586. . in +\w@\\$1@u
  2587. . ti 0
  2588. .\}
  2589. .el .ce 1
  2590. \fB\\$1\fP\\$2
  2591. .br
  2592. .ev
  2593. .\" save line for LIST OF XXX, wth is the width of the label
  2594. .if !r lix*wth\\$3 .nr lix*wth\\$3 0
  2595. .\" find the maximum width
  2596. .if \w@\\*[lix*label]@>\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
  2597. .if \\n[\\$4] .lix@ds-save \\$3 \\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
  2598. .\" save reference to the figure
  2599. .if !'\\$5'' .SETR \\$5 \\*[lix*numb]
  2600. ..
  2601. .\" hide printout until diversion is evaluated
  2602. .de lix@embedded-text
  2603. \!.ie \\\\n[Sectp] .ds lix*pgnr \\\\*[hd*sect-pg]
  2604. \!.el .ds lix*pgnr \\\\n[%]
  2605. \!.SP \\\\n[Lsp]u
  2606. \!.misc@ev-keep lix
  2607. \!.ll \\n[.l]u
  2608. \!.init@reset
  2609. \!.fi
  2610. \!.ie (\w@\\$1\\$2@)>(\\\\n[.l]-\\\\n[.i]) \{\
  2611. . in +\w@\\$1@u
  2612. \!. ti 0
  2613. \!\fB\\$1\fP\\$2
  2614. \!.\}
  2615. \!.el \{\
  2616. . ce 1
  2617. \!\fB\\$1\fP\\$2
  2618. \!.\}
  2619. \!.br
  2620. \!.ev
  2621. .\" save line for LIST OF XXX, wth is the width of the label
  2622. \!.if !r lix*wth\\$3 .nr lix*wth\\$3 0
  2623. .\" find the maximum width
  2624. \!.if \w@\\*[lix*label]@>\\\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
  2625. \!.if \\\\n[\\$4] .lix@ds-save \\$3 \\\\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
  2626. .\" save reference to the figure
  2627. \!.if !'\\$5'' .SETR \\$5 \\*[lix*numb]
  2628. ..
  2629. .\"------------
  2630. .\" print complete list of XXXX
  2631. .de lix@print-ds
  2632. .\" arg: fg,tb,ec,ex text
  2633. .ds H1txt \\$3
  2634. .ds Tcst \\$1
  2635. .if !\\n[Cp] .pg@next-page
  2636. .\" print LIST OF XXXX
  2637. .\" execute user-defined macros
  2638. .if \\$4<=4 .if d TX\\$2 .TX\\$2
  2639. .ie d TY\\$2 .if \\$4<=4 .TY\\$2
  2640. .el \{\
  2641. . ce
  2642. \\$3
  2643. . SP 3
  2644. .\}
  2645. .in \\n[lix*wth\\$1]u
  2646. .fi
  2647. .lix*ds\\$1
  2648. ..
  2649. .\"------------
  2650. .\" save line of list in macro
  2651. .de lix@ds-save
  2652. .\" type pagenumber text
  2653. .am lix*ds\\$1
  2654. .lix@dsln \\$1 \\$2 "\\$3" "\\$4" \\$5
  2655. \\..
  2656. ..
  2657. .\"------------
  2658. .\" print appended macro
  2659. .\" lix@dsln type pagenumber text headernr
  2660. .de lix@dsln
  2661. .nr lix*i \\n[lix*wth\\$1]-\w@\\$4@
  2662. .ne 4v
  2663. .ll \\n[@ll]u-\w@\\$4@u-\w@\\$2@u-2m
  2664. .ti -\\n[lix*wth\\$1]u
  2665. \\$4
  2666. .sp -1
  2667. \\$3\h'1m'
  2668. .sp -1
  2669. .ll
  2670. .nr lix*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$2@)-1m
  2671. \h'|\\n[.n]u'\l'\\n[lix*sep]u.'\h'1m'\\$2
  2672. .SP \\n[toc*spacing]u
  2673. ..
  2674. .\"########################### module fnt ############################
  2675. .\" some font macros.
  2676. .de R
  2677. .ft R
  2678. .ul 0
  2679. ..
  2680. .\"-----------
  2681. .de fnt@switch
  2682. .ul 0
  2683. .ds fnt*tmp
  2684. .nr fnt*prev \\n[.f]
  2685. .nr fnt*i 2 1
  2686. .while \\n+[fnt*i]<=\\n[.$] \{\
  2687. . if \\n[fnt*i]>3 .as fnt*tmp \,
  2688. . ie (\\n[fnt*i]%2)=1 .as fnt*tmp \\$1\\$[\\n[fnt*i]]
  2689. . el .as fnt*tmp \\$2\\$[\\n[fnt*i]]
  2690. . if \\n[fnt*i]<\\n[.$] .as fnt*tmp \/
  2691. .\}
  2692. \&\\*[fnt*tmp]\f[\\n[fnt*prev]]
  2693. ..
  2694. .\"-----------
  2695. .de B
  2696. .ie \\n[.$] .fnt@switch \fB \f[\\n[.f]] \\$@
  2697. .el .ft B
  2698. ..
  2699. .de I
  2700. .ie \\n[.$] .fnt@switch \fI \f[\\n[.f]] \\$@
  2701. .el .ft I
  2702. ..
  2703. .de IB
  2704. .if \\n[.$] .fnt@switch \fI \fB \\$@
  2705. ..
  2706. .de BI
  2707. .if \\n[.$] .fnt@switch \fB \fI \\$@
  2708. ..
  2709. .de IR
  2710. .if \\n[.$] .fnt@switch \fI \fR \\$@
  2711. ..
  2712. .de RI
  2713. .if \\n[.$] .fnt@switch \fR \fI \\$@
  2714. ..
  2715. .de RB
  2716. .if \\n[.$] .fnt@switch \fR \fB \\$@
  2717. ..
  2718. .de BR
  2719. .if \\n[.$] .fnt@switch \fB \fR \\$@
  2720. ..
  2721. .\"########################### module box ############################
  2722. .\" draw a box around some text. Text will be kept on the same page.
  2723. .\"
  2724. .nr box*ll 0
  2725. .\" .B1 and .B2 works like .DS
  2726. .de B1
  2727. .if \\n[box*ll] .@error "B1: missing B2"
  2728. .nr box*ll \\n[.l]
  2729. .nr box*ind \\n[.i]
  2730. .nr box*hyp \\n[.hy]
  2731. .nr box*wid \\n[.l]-\\n[.i]
  2732. .\"
  2733. .\" jump to new environment.
  2734. .ev box*ev
  2735. .di box*div
  2736. .ps \\n[@ps]u
  2737. .vs \\n[@vs]u
  2738. .in 1n
  2739. .ll (u;\\n[box*wid]-1n)
  2740. .hy \\n[.hy]
  2741. ..
  2742. .de B2
  2743. .if !\\n[box*ll] .@error "B2: missing B1"
  2744. .br
  2745. .di
  2746. .nr box*height \\n[dn]
  2747. .ne \\n[dn]u+1v
  2748. .ll \\n[box*ll]u
  2749. .in \\n[box*ind]u
  2750. .nr box*y-pos \\n[.d]u
  2751. .nf
  2752. .box*div
  2753. .fi
  2754. \v'-1v+.25m'\
  2755. \D'l \\n[box*wid]u 0'\
  2756. \D'l 0 -\\n[box*height]u'\
  2757. \D'l -\\n[box*wid]u 0'\
  2758. \D'l 0 \\n[box*height]u'
  2759. .br
  2760. .sp -1
  2761. .ev
  2762. .sp .20v
  2763. .in \\n[box*ind]u
  2764. .ll \\n[box*ll]u
  2765. .rm box*div
  2766. .nr box*ll 0
  2767. ..
  2768. .\"########################### module ref ############################
  2769. .nr ref*nr 0 1
  2770. .aln :R ref*nr
  2771. .nr ref*nr-width 5n
  2772. .nr ref*flag 0 \" for end-of-text
  2773. .ds Rf \v'-.4m'\s-3[\\n+[ref*nr]]\s0\v'.4m'
  2774. .\"
  2775. .\" start reference
  2776. .\"------------
  2777. .de RS
  2778. .if !''\\$1' .ds \\$1 \v'-.4m'\s-3[\\n[ref*nr]]\s0\v'.4m'
  2779. .nr ref*flag 1
  2780. .am ref*mac
  2781. .ref@start-print \\n[ref*nr]
  2782. \\..
  2783. .eo
  2784. .am ref*mac RF
  2785. ..
  2786. .\"------------
  2787. .de RF
  2788. .ec
  2789. .am ref*mac
  2790. .ref@stop-print
  2791. \\..
  2792. ..
  2793. .\"------------
  2794. .de ref@start-print
  2795. .di ref*div
  2796. .in \\n[ref*nr-width]u
  2797. .ti -(\w@\\$1.@u+1n)
  2798. \\$1.
  2799. .sp -1
  2800. ..
  2801. .de ref@stop-print
  2802. .br
  2803. .di
  2804. .ne \\n[dn]u
  2805. .ev ref*ev2
  2806. .nf
  2807. .ref*div
  2808. .ev
  2809. .rm ref*div
  2810. .if \\n[Ls] .SP \\n[Lsp]u
  2811. ..
  2812. .\"-----------
  2813. .de RP
  2814. .if !d ref*mac .@error "RP: No references!"
  2815. .nr ref*i 0\\$2
  2816. .if \\n[ref*i]<2 .SK
  2817. .SP 2
  2818. .ref@print-refs
  2819. .if 0\\$1<1 .nr ref*nr 0 1
  2820. .if ((\\n[ref*i]=0):(\\n[ref*i]=2)) .SK
  2821. ..
  2822. .\"-----------
  2823. .\" called by end-of-text!
  2824. .de ref@eot-print
  2825. .\".if \\n[ref*flag] \{
  2826. .if d ref*mac \{\
  2827. . if \\n[D]>2 .tm Print references, called by eot
  2828. . nr ref*flag 0
  2829. . br
  2830. . misc@ev-keep ne
  2831. . init@reset
  2832. \c
  2833. ' bp
  2834. . ev
  2835. . ref@print-refs
  2836. .\}
  2837. ..
  2838. .\"-----------
  2839. .\" prints the references
  2840. .de ref@print-refs
  2841. .toc@save 1 "" "\\*[Rp]" \\n[%]
  2842. .ce
  2843. \fI\\*[Rp]\fP
  2844. .sp
  2845. .nr ref*ll \\n[.l]
  2846. .misc@ev-keep ref*ev
  2847. .ll \\n[ref*ll]u
  2848. .in 0
  2849. .ref*mac
  2850. .in
  2851. .rm ref*mac
  2852. .ev
  2853. .nr ref*flag 0 1
  2854. ..
  2855. .\"########################### module app ############################
  2856. .\"
  2857. .nr app*nr 0 1
  2858. .af app*nr A
  2859. .nr app*dnr 0 1
  2860. .nr app*flag 0
  2861. .\"------------
  2862. .\" .APP name text
  2863. .\" name == "" -> autonumber
  2864. .de APP
  2865. .\" .if \\n[.$]<2 .@error "APP: too few arguments"
  2866. .app@set-ind "\\$1"
  2867. .\"
  2868. .ds Tcst ap
  2869. .ds Apptxt \\$2
  2870. .\"
  2871. .ie \\n[Aph] .app@header \\*[app*ind] "\\$2"
  2872. .el .bp
  2873. .app@index "\\*[app*ind]" "\\$2"
  2874. ..
  2875. .\"------------
  2876. .\" .APPSK name pages text
  2877. .\" name == "" -> autonumber
  2878. .de APPSK
  2879. .if \\n[.$]<2 .@error "APPSK: too few arguments"
  2880. .app@set-ind "\\$1"
  2881. .\"
  2882. .ds Tcst ap
  2883. .ds Apptxt \\$3
  2884. .\"
  2885. .ie \\n[Aph] .app@header \\*[app*ind] "\\$3"
  2886. .el .bp
  2887. .app@index "\\*[app*ind]" "\\$3"
  2888. .pn +\\$2
  2889. ..
  2890. .\"------------
  2891. .de app@set-ind
  2892. .ie \w@\\$1@ .ds app*ind \\$1
  2893. .el \{\
  2894. . if !\\n[app*flag] \{\
  2895. . nr H1 0 1
  2896. . af H1 A
  2897. . af H1h A
  2898. . nr app*flag 1
  2899. . \}
  2900. . ds app*ind \\n+[app*nr]
  2901. . nr H1 \\n+[app*dnr]
  2902. . nr H1h \\n[app*dnr]
  2903. .\}
  2904. .\" clear lower counters
  2905. .nr app*i 1 1
  2906. .while \\n+[app*i]<15 .nr H\\n[app*i] 0 1
  2907. ..
  2908. .\"------------
  2909. .de app@index
  2910. .toc@save 1 "" "\\*[App] \\$1: \\$2" \\n[%]
  2911. ..
  2912. .\"------------
  2913. .\" app@heaer name text
  2914. .de app@header
  2915. .bp
  2916. .SP (u;\\n[Lsp]*4)
  2917. .ce 1
  2918. \s+4\fB\\*[App]\ \\$1\fP\s0
  2919. .SP (u;\\n[Lsp]*2)
  2920. .if \w@\\$2@<\\n[.l] .ce 1
  2921. \fB\s+2\\$2\s0\fP
  2922. .SP (u;\\n[Lsp]*4)
  2923. ..
  2924. .als APPX app@header
  2925. .\"########################### module cov ############################
  2926. .\" title stored in diversion cov*title
  2927. .\" abstract stored in diversion cov*abstract
  2928. .\" arg to abstract stored in cov*abs-arg
  2929. .\" indent stored in cov*abs-ind
  2930. .\" number of authors stored in cov*au
  2931. .\" author(s) stored in cov*au!x!y
  2932. .\" author(s) title stored in cov*at!x!y
  2933. .\" x is the author-index [1-cov*au], y is the argument-index [1-9].
  2934. .\" author(s) firm stored in cov*firm
  2935. .\" new date (if .ND exists) is stored in cov*new-date
  2936. .\"
  2937. .\"
  2938. .ds cov*abs-name ABSTRACT
  2939. .\"
  2940. .nr cov*au 0
  2941. .de TL
  2942. .rm IA IE WA WE LO LT
  2943. .if \\n[.$]>0 .ds cov*title-charge-case \\$1
  2944. .if \\n[.$]>1 .ds cov*title-file-case \\$2
  2945. .pg@disable-top-trap
  2946. .eo
  2947. .de cov*title AU
  2948. ..
  2949. .\"-------------------
  2950. .de cov@title-end
  2951. .ec
  2952. ..
  2953. .\"-------------------
  2954. .\" .AU name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]
  2955. .de AU
  2956. .cov@title-end
  2957. .pg@disable-top-trap
  2958. .nr cov*au +1
  2959. .nr cov*i 0 1
  2960. .ds cov*au!\\n[cov*au]!1
  2961. .while \\n[.$]>=\\n+[cov*i] \{\
  2962. . ds cov*au!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
  2963. .\}
  2964. .if (\\n[.$]>=3)&(\w@\\$3@) \{\
  2965. . if d cov*location-\\$3] \{\
  2966. . ds cov*au!3!\\n[cov*au] \\*[cov*location-\\$3]
  2967. . \}
  2968. .\}
  2969. ..
  2970. .\"-------------------
  2971. .\" .AT title1 [title2 [... [title9] ]]]]
  2972. .\" Well, thats all that COVEND look for.
  2973. .\" Must appear directly after .AU
  2974. .de AT
  2975. .if \\n[.$]<1 .@error "AT: no arguments"
  2976. .nr cov*i 0 1
  2977. .while \\n[.$]>=\\n+[cov*i] \{\
  2978. . ds cov*at!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
  2979. .\}
  2980. ..
  2981. .\"-------------------
  2982. .de AF
  2983. .cov@title-end
  2984. .if !''\\$1' .ds cov*firm \\$1
  2985. ..
  2986. .de AST
  2987. .ds cov*abs-name \\$1
  2988. ..
  2989. .de AS
  2990. .pg@disable-top-trap
  2991. .if d cov*abstract .@error "AS: only one abstract allowed"
  2992. .if !''\\n[.z]' .@error "AS: no diversion allowed (previous .AS?)"
  2993. .nr cov*abs-arg 0\\$1
  2994. .nr cov*abs-ind (n;0\\$2)
  2995. .de cov*abstract AE
  2996. ..
  2997. .de AE
  2998. ..
  2999. .\" fixed for 2000, now uses \n[year].
  3000. .de ISODATE
  3001. . \" support for ISO-date
  3002. . nr cov*mm \\n[mo]
  3003. . nr cov*dd \\n[dy]
  3004. . af cov*mm 01
  3005. . af cov*dd 01
  3006. . ie '0'\\$1' \{\
  3007. . ds cov*new-date \\*[MO\\n[mo]] \\n[dy], \\n[year]
  3008. . \}
  3009. . el \{\
  3010. . ds cov*new-date \\n[year]-\\n[cov*mm]-\\n[cov*dd]
  3011. . \}
  3012. ..
  3013. .ISODATE 0
  3014. .als DT cov*new-date
  3015. .de ND
  3016. .ds cov*new-date \\$1
  3017. ..
  3018. .\" switch to ISO-date if register Iso exist: YYYY-MM-DD
  3019. .if r Iso .ISODATE 1
  3020. .\"-------------------
  3021. .\" save technical numbers.
  3022. .de TM
  3023. .nr cov*i 0 1
  3024. .while \\n[.$]>=\\n+[cov*i] .ds cov*mt-tm!\\n[cov*i] \\$[\\n[cov*i]]
  3025. .nr cov*mt-tm-max \\n[.$]
  3026. ..
  3027. .\"-----------------------
  3028. .\" cover sheet
  3029. .\" the file must have the following last lines (somewhere):
  3030. .\" .pg@enable-top-trap
  3031. .\" .bp 1
  3032. .\" .pg@enable-trap
  3033. .ds cov*mt-file!0 0.MT
  3034. .ds cov*mt-file!1 0.MT
  3035. .ds cov*mt-file!2 0.MT
  3036. .ds cov*mt-file!3 0.MT
  3037. .ds cov*mt-file!4 4.MT
  3038. .ds cov*mt-file!5 5.MT
  3039. .ds cov*mt-file!6 0.MT
  3040. .\"------------
  3041. .de MT
  3042. .ie \\n[.$] \{\
  3043. . ie d cov*mt-file!\\$1 .ds cov*mt-type \\$1
  3044. . el .ds cov*mt-type 6
  3045. .\}
  3046. .el .ds cov*mt-type 1
  3047. .ds cov*mt-addresse "\\$2
  3048. .ds cov*mt-type-text "\\$1
  3049. .ie d @language .ds cov*str mm/\\*[@language]_
  3050. .el .ds cov*str mm/
  3051. .mso \\*[cov*str]\\*[cov*mt-file!\\*[cov*mt-type]]
  3052. ..
  3053. .de COVER
  3054. .ie !\\n[.$] .ds cov*cov-type ms
  3055. .el .ds cov*cov-type \\$1
  3056. .pg@disable-top-trap
  3057. .ie d @language .ds cov*str mm/\\*[@language]_\\*[cov*cov-type].cov
  3058. .el .ds cov*str mm/\\*[cov*cov-type].cov
  3059. .mso \\*[cov*str]
  3060. ..
  3061. .\"########################### module qrf ############################
  3062. .\" forward and backward reference thru special files.
  3063. .\"
  3064. .\" check if stderr-method is wanted
  3065. .\" This was needed when I discovered that groff was considered unsafe
  3066. .\" and groff -U didn't work. It's a workaround like the original
  3067. .\" index method, but not in my view elegant enough.
  3068. .\"
  3069. .\" init reference system
  3070. .de INITR
  3071. .ds qrf*file \\$1.qrf
  3072. .nr qrf*pass 2
  3073. .if \\n[D]>1 .tm INITR: source \\*[qrf*file]
  3074. .ie \\n[Ref] \{\
  3075. . tm .\\\\" Rfilename: \\*[qrf*file]
  3076. .\}
  3077. .el 'so \\*[qrf*file]
  3078. ..
  3079. .\"---------------
  3080. .\" set a reference.
  3081. .de SETR
  3082. .if \\n[.$]<1 .@error "SETR:reference name missing"
  3083. .if !r qrf*pass .tm "SETR: No .INITR in this file"
  3084. .if \\n[Ref] \{\
  3085. . ds qrf*name qrf*ref-\\$1
  3086. . if \\n[D]>2 .tm SETR: ref \\*[qrf*name]=\\*[hd*mark],\\n[%]
  3087. . \" heading-number
  3088. . ds \\*[qrf*name]-hn \\*[hd*mark]
  3089. . \" page-number
  3090. . ds \\*[qrf*name]-pn \\n[%]
  3091. . \"
  3092. . if \\n[Ref] \{\
  3093. . tm .ds \\*[qrf*name]-hn \\*[hd*mark]
  3094. . tm .ds \\*[qrf*name]-pn \\n[%]
  3095. . if !'\\$2'' .tm .ds \\*[qrf*name]-xx \\$2
  3096. . \}
  3097. .\}
  3098. ..
  3099. .\"---------------
  3100. .\" get misc-string
  3101. .\" If two arg -> set var. arg to misc-string.
  3102. .de GETST
  3103. .if \\n[.$]<1 .@error "GETST:reference name missing"
  3104. .if !r qrf*pass .tm "GETST: No .INITR in this file"
  3105. .ds qrf*name qrf*ref-\\$1
  3106. . if d \\*[qrf*name]-xx \{\
  3107. . ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-xx]
  3108. . el \\*[\\*[qrf*name]-xx]\c
  3109. . \}
  3110. .\}
  3111. ..
  3112. .\"---------------
  3113. .\" get header-number
  3114. .\" If two arg -> set var. arg to header-number.
  3115. .de GETHN
  3116. .if \\n[.$]<1 .@error "GETHN:reference name missing"
  3117. .if !r qrf*pass .tm "GETHN: No .INITR in this file"
  3118. .ds qrf*name qrf*ref-\\$1
  3119. .if d \\*[qrf*name]-hn \{\
  3120. . ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-hn]
  3121. . el \\*[\\*[qrf*name]-hn]\c
  3122. .\}
  3123. ..
  3124. .\"---------------
  3125. .\" get page-number
  3126. .\" If two arg -> set var. arg to page-number.
  3127. .de GETPN
  3128. .if \\n[.$]<1 .@error "GETPN:reference name missing"
  3129. .if !r qrf*pass .tm "GETPN: No .INITR in this file"
  3130. .ds qrf*name qrf*ref-\\$1
  3131. .if d \\*[qrf*name]-pn \{\
  3132. . ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-pn]
  3133. . el \\*[\\*[qrf*name]-pn]\c
  3134. .\}
  3135. ..
  3136. .\"----------
  3137. .de GETR
  3138. .if \\n[.$]<1 .@error "GETR:reference name missing"
  3139. .ie !r qrf*pass \{\
  3140. . tm "GETR: No .INITR in this file"
  3141. .\}
  3142. .el \{\
  3143. . GETHN \\$1 Qrfh
  3144. . GETPN \\$1 Qrfp
  3145. \\*[Qrf]
  3146. .\}
  3147. ..
  3148. .\"########################### module ind ############################
  3149. .\" Support for mgs-style indexing, borrowed from mgs.
  3150. .de IX
  3151. . tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[%]
  3152. ..
  3153. .\"--------------------
  3154. .\" Another type of index system
  3155. .\" INITI type filename [macro]
  3156. .de INITI
  3157. .if \\n[.$]<1 .@error "INITI:type missing"
  3158. .\" ignore if INITI has already been used
  3159. .if \\n[.$]>1 \{\
  3160. . if d ind*file .@error "INITI:file already set"
  3161. . ds ind*file \\$2.ind
  3162. . if \\n[D]>1 .tm INITI: source \\*[ind*file]
  3163. .\}
  3164. .if !d ind*file .@error "INITI:file not specified"
  3165. .ds ind*type \\$1
  3166. .if \\n[Ref] \{\
  3167. . if \\n[.$]>2 .tm .\\\\" Imacro: \\$3
  3168. .\}
  3169. ..
  3170. .\"---------------
  3171. .de IND
  3172. .if !d ind*file .@error "IND: No active INITI"
  3173. .if \\n[D]>1 .tm IND: type=\\*[ind*type]
  3174. .ds ind*ref
  3175. .if '\\*[ind*type]'N' .ds ind*ref \\n[%]
  3176. .if '\\*[ind*type]'H' .ds ind*ref \\*[hd*mark]
  3177. .if '\\*[ind*type]'B' .ds ind*ref \\*[hd*mark]\t\\n[%]
  3178. .if '\\*[ind*ref]'' .@error "IND:wrong index type: \\*[ind*ref]"
  3179. .\"
  3180. .ds ind*line \\$1
  3181. .while \\n[.$]>0 \{\
  3182. . shift
  3183. . as ind*line \t\\$1
  3184. .\}
  3185. .as ind*line \\*[ind*ref]
  3186. .if \\n[Ref] .tm .\\\\" IND \\*[ind*line]
  3187. ..
  3188. .\" print index
  3189. .de INDP
  3190. .ie \\n[Ref] .tm .\\\\" Index: \\*[ind*file]
  3191. .el \{\
  3192. . if !\\n[Cp] .pg@next-page
  3193. . \" print INDEX
  3194. . \" execute user-defined macros
  3195. . if d TXIND .TXIND
  3196. . ie d TYIND .TYIND
  3197. . el \{\
  3198. . SK
  3199. . ce
  3200. \\*[Index]
  3201. . SP 3
  3202. . 2C
  3203. . nf
  3204. . \}
  3205. ' so \\*[ind*file]
  3206. . ie d TZIND .TZIND
  3207. . el \{\
  3208. . fi
  3209. . 1C
  3210. . \}
  3211. .\}
  3212. .rm ind*file
  3213. ..
  3214. .\"########################### module let ############################
  3215. .\" Letter macros
  3216. .\"------------------------
  3217. .\" Formal closing
  3218. .de FC
  3219. .df@print-float 3
  3220. .ie \\n[.$] .ds let*i \\$1
  3221. .el .ds let*i \\*[Letfc]
  3222. .ie d let*type .let@fc_\\*[let*type] "\\*[let*i]" \\$@
  3223. .el .let@mt-closing "\\*[let*i]" \\$@
  3224. ..
  3225. .\"-------
  3226. .de let@mt-closing
  3227. .ne 5v
  3228. .in (u;\\n[.l]/2)
  3229. .sp
  3230. \\$1
  3231. .in
  3232. ..
  3233. .\"------------------------
  3234. .\" Signature line
  3235. .de SG
  3236. .ie d let*type .let*lt-sign \\$@
  3237. .el .let*mt-sign \\$@
  3238. ..
  3239. .\"------------------------
  3240. .de let*lt-sign
  3241. .if !d let@sg_\\*[let*type] .@error "SG: letter type \\*[let*type] undefined"
  3242. .df@print-float 3
  3243. .nr let*i 0 1
  3244. .nr let*j 0
  3245. .while \\n+[let*i]<=\\n[let*wa-n] \{\
  3246. .if \\n[let*i]=\\n[let*wa-n] .nr let*j 1
  3247. .let@sg_\\*[let*type] "\\*[let*wa-name!\\n[let*i]]" "\\*[let*wa-title!\\n[let*i]]" \\n[let*i] \\n[let*j] \\$@
  3248. .\}
  3249. ..
  3250. .\"------------------------
  3251. .\" Memorandum signature
  3252. .de let*mt-sign
  3253. .df@print-float 3
  3254. .ne \\n[cov*au]u*4v
  3255. .ie \\n[.$]>1 .nr let*k 1
  3256. .el .nr let*k \\n[cov*au]
  3257. .ds let*tmp \\*[cov*au!\\n[let*k]!3]-\\*[cov*au!\\n[let*k]!4]-
  3258. .nr let*i 0 1
  3259. .while \\n+[let*i]<=\\n[cov*au] \{\
  3260. . if \\n[let*i]>1 .as let*tmp /
  3261. . as let*tmp \\*[cov*au!\\n[let*k]!2]
  3262. .\}
  3263. .if !''\\$1' .as let*tmp -\\$1
  3264. .in (u;\\n[.l]/2)
  3265. .nf
  3266. .nr let*i 0 1
  3267. .while \\n+[let*i]<=\\n[cov*au] \{\
  3268. . SP 3v
  3269. . if \\n[let*i]=\\n[let*k] \{\
  3270. \Z'\h'-(u;\\n[.l]/2)'\\*[let*tmp]'\c
  3271. . \}
  3272. \\*[cov*au!\\n[let*i]!1]
  3273. .\}
  3274. .fi
  3275. .in
  3276. ..
  3277. .\"------------------------
  3278. .\" Approval signature
  3279. .de AV
  3280. .ne 6v
  3281. .nf
  3282. .sp
  3283. .ie \\n[.$]<2 \\*[Letapp]
  3284. .el .sp
  3285. .sp 2
  3286. .ie n ______________________________ ______________
  3287. .el \D'l 25m 0'\h'4m'\D'l 12m 0'
  3288. \Z'\\$1'\h'29m'\f[\\*[@sdf_font]]\\*[Letdate]\fP
  3289. .fi
  3290. ..
  3291. .\"------------------------
  3292. .\" Letter signature
  3293. .de AVL
  3294. .ne 6v
  3295. .nf
  3296. .sp 3
  3297. .ie n ______________________________
  3298. .el \D'l 25m 0'
  3299. \Z'\\$1'
  3300. .fi
  3301. ..
  3302. .\"------------------------
  3303. .\" Letter type
  3304. .\" let@header is called from the header. It is supposed
  3305. .\" to remove the alias itself.
  3306. .de LT
  3307. .rm AF AS AE AT AU CS OK TL MT
  3308. .ds let*type BL
  3309. .nr Pi 5
  3310. .nr Pt 0
  3311. .if !''\\$1' .ds let*type \\$1
  3312. .if !d let@head_\\*[let*type] .@error "LT: unknown letter type \\$1"
  3313. .shift
  3314. .als let@header let@head_\\*[let*type]
  3315. .let@init_\\*[let*type] \\$@
  3316. .if \n[D]>1 .tm Letter type \\*[let*type]
  3317. ..
  3318. .\"-----------
  3319. .\" Blocked letter
  3320. .de let@init_BL
  3321. ..
  3322. .de let@head_BL
  3323. .rm let@header
  3324. .let@print-head 1
  3325. ..
  3326. .de let@sg_BL
  3327. .ne 5v
  3328. .nf
  3329. .in (u;\\n[.l]/2)
  3330. .sp 3v
  3331. \\$1
  3332. \\$2
  3333. .in
  3334. .if \\$4 .sp
  3335. .if \w'\\$5'&\\$4 \\$5
  3336. .fi
  3337. ..
  3338. .als let@fc_BL let@mt-closing
  3339. .\"-----------
  3340. .\" Semiblocked letter
  3341. .de let@init_SB
  3342. .nr Pt 1
  3343. ..
  3344. .de let@head_SB
  3345. .rm let@header
  3346. .let@print-head 1
  3347. ..
  3348. .als let@sg_SB let@sg_BL
  3349. .als let@fc_SB let@mt-closing
  3350. .\"-----------
  3351. .\" Full-blocked letter
  3352. .de let@init_FB
  3353. ..
  3354. .de let@head_FB
  3355. .rm let@header
  3356. .let@print-head
  3357. ..
  3358. .de let@sg_FB
  3359. .ne 5v
  3360. .nf
  3361. .sp 3v
  3362. \\$1
  3363. \\$2
  3364. .if \\$4 .sp
  3365. .if \w'\\$5'&\\$4 \\$5
  3366. .fi
  3367. ..
  3368. .de let@fc_FB
  3369. .ne 5v
  3370. .sp
  3371. \\$1
  3372. ..
  3373. .\"-----------
  3374. .\" Simplified letter
  3375. .de let@init_SP
  3376. ..
  3377. .de let@head_SP
  3378. .rm let@header
  3379. .let@print-head
  3380. ..
  3381. .de let@sg_SP
  3382. .nf
  3383. .if \\$3=1 .sp
  3384. .sp
  3385. .misc@toupper "\\$1, \\$2"
  3386. .if \\$4 .sp
  3387. .if \w'\\$5'&\\$4 \\$5
  3388. .fi
  3389. ..
  3390. .de let@fc_SP
  3391. .sp 2
  3392. ..
  3393. .\"--------------------------------------
  3394. .\" Print the letter-head
  3395. .de let@print-head
  3396. .nf
  3397. .sp |11
  3398. .if '1'\\$1' .in (u;\\n[.l]/2)
  3399. .\" ---- WA
  3400. .ie d let@wa-div .let@wa-div
  3401. .el .sp 3
  3402. .\" ---- datum
  3403. \\*[cov*new-date]
  3404. .sp
  3405. .if '1'\\$1' .if !d let*lo-CN .if !d let*lo-RN .sp 2
  3406. .\" ---- Confidential
  3407. .if d let*lo-CN \{\
  3408. . ti 0
  3409. . ie !''\\*[let*lo-CN]' \\*[let*lo-CN]
  3410. . el \\*[LetCN]
  3411. . sp
  3412. .\}
  3413. .\" ---- Reference
  3414. .if d let*lo-RN \{\
  3415. \\*[LetRN] \\*[let*lo-RN]
  3416. . sp
  3417. .\}
  3418. .\" ---- IA
  3419. .sp
  3420. .in 0
  3421. .nr let*i 0 1
  3422. .while \\n+[let*i]<=\\n[let*ia-n] \{\
  3423. \\*[let*ia-name!\\n[let*i]]
  3424. \\*[let*ia-title!\\n[let*i]]
  3425. .\}
  3426. .if d let@ia-div .let@ia-div
  3427. .\" ---- Attention
  3428. .if d let*lo-AT \{\
  3429. . sp
  3430. \\*[LetAT] \\*[let*lo-AT]
  3431. .\}
  3432. .\" ---- Salutation
  3433. .if !'\\*[let*type]'SP' .if d let*lo-SA \{\
  3434. . sp
  3435. . ti 0
  3436. . ie !''\\*[let*lo-SA]' \\*[let*lo-SA]
  3437. . el \\*[LetSA]
  3438. .\}
  3439. .\" ---- Subject
  3440. .if d let*lo-SJ \{\
  3441. . ie '\\*[let*type]'SP' \{\
  3442. . sp 2
  3443. . misc@toupper \\*[let*lo-SJ]
  3444. . sp
  3445. . \}
  3446. . el \{\
  3447. . sp
  3448. . if '\\*[let*type]'SB' .ti +5m
  3449. \\*[LetSJ] \f[\\*[@sdf_font]]\\*[let*lo-SJ]\fP
  3450. . \}
  3451. .\}
  3452. ..
  3453. .\"-------------------
  3454. .\" .IA [name [title]]
  3455. .nr let*ia-n 0 1
  3456. .de IA
  3457. .if \\n[.$] .ds let*ia-name!\\n+[let*ia-n] \\$1
  3458. .if \\n[.$]>1 .ds let*ia-title!\\n[let*ia-n] \\$2
  3459. .ev let@ev
  3460. .init@reset
  3461. 'nf
  3462. .di let@ia-div
  3463. .eo
  3464. ..
  3465. .de IE
  3466. .di
  3467. .ec
  3468. .ev
  3469. ..
  3470. .\"-------------------
  3471. .\" .WA [name [title]]
  3472. .nr let*wa-n 0 1
  3473. .de WA
  3474. .if \\n[.$] .ds let*wa-name!\\n+[let*wa-n] \\$1
  3475. .if \\n[.$]>1 .ds let*wa-title!\\n[let*wa-n] \\$2
  3476. .ev let@ev
  3477. .init@reset
  3478. 'nf
  3479. .di let@wa-div
  3480. .it \\n[Letwam] let@wa-drain
  3481. .eo
  3482. ..
  3483. .\"------
  3484. .de let@wa-drain
  3485. .it
  3486. .di
  3487. .di let@wa-junk
  3488. ..
  3489. .\"------
  3490. .de WE
  3491. .it
  3492. .ec
  3493. .di
  3494. .ev
  3495. .if d let@wa-junk .rm let@wa-junk
  3496. ..
  3497. .\"-------------------
  3498. .\" Copy to
  3499. .de NS
  3500. .sp
  3501. .ie !''\\$2' .ds let*str \\$1
  3502. .el \{\
  3503. . ie \\n[.$]>0 \{\
  3504. . ie !\w'\\$1' .ds let*str \\*[Letns!\\*[Letnsdef]]
  3505. . el \{\
  3506. . ie d Letns!\\$1 .ds let*str \\*[Letns!\\$1]
  3507. . el .ds let*str \\*[Letns!copy](\\$1)\\*[Letns!to]
  3508. . \}
  3509. . \}
  3510. . el .ds let*str \\*[Letns!\\*[Letnsdef]]
  3511. .\}
  3512. .ne 2
  3513. .nf
  3514. \\*[let*str]
  3515. ..
  3516. .de NE
  3517. .fi
  3518. ..
  3519. .\"-------------------
  3520. .\" Letter options
  3521. .de LO
  3522. .rm AF AS AE AT AU CS OK TL MT
  3523. .if ''\\$1' .@error "LO: missing option"
  3524. .if !d Let\\$1 .@error "LO: unknown option (\\$1)"
  3525. .ds let*lo-\\$1 \\$2
  3526. .if \n[D]>1 .tm Letter option \\$1 \\$2
  3527. ..
  3528. .\"--------------------
  3529. .\" Start with a clean slate
  3530. .init@reset