/contrib/groff/tmac/an-old.tmac

https://bitbucket.org/freebsd/freebsd-head/ · Unknown · 650 lines · 650 code · 0 blank · 0 comment · 0 complexity · 851c5abcf832e98948b47c136eb08bce MD5 · raw file

  1. .\" an-old.tmac
  2. .\"
  3. .\" Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005
  4. .\" Free Software Foundation, Inc.
  5. .\" Written by James Clark (jjc@jclark.com)
  6. .\"
  7. .\" This file is part of groff.
  8. .\"
  9. .\" groff is free software; you can redistribute it and/or modify it under
  10. .\" the terms of the GNU General Public License as published by the Free
  11. .\" Software Foundation; either version 2, or (at your option) any later
  12. .\" version.
  13. .\"
  14. .\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
  15. .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  17. .\" for more details.
  18. .\"
  19. .\" You should have received a copy of the GNU General Public License along
  20. .\" with groff; see the file COPYING. If not, write to the Free Software
  21. .\" Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
  22. .\"
  23. .\" -rcR=1 => Create a single, very long page instead of multiple pages.
  24. .\" Useful for online display. Default in nroff mode.
  25. .\" Desactivate with -rcR=0.
  26. .\" -rC1 => Number pages continuously, rather than start each at 1.
  27. .\" -rD1 => Double-sided printing, ie different odd and even page footers.
  28. .\" -rPnnn => Number first page nnn.
  29. .\" -rSxx => Use size `xx'pt (either 10, 11, or 12) for document rather
  30. .\" than the default size of 10pt.
  31. .\" -rXnnn => Number pages after nnn as nnna, nnnb, nnnc, ...
  32. .\"
  33. .\" The file man.local is loaded at the end. Put local additions there.
  34. .\" If you need to add things to TH, use `.am1 TH'.
  35. .\"
  36. .
  37. .if !\n(.g .ab These man macros work only with groff.
  38. .
  39. .do if d RI .nx
  40. .
  41. .do mso devtag.tmac
  42. .
  43. .nr _C \n(.C
  44. .cp 0
  45. .
  46. .if (\n[.x]\n[.y] < 118) \
  47. . ab You need GNU troff version 1.18 or higher to run this version of man!
  48. .
  49. .if !r D .nr D 0
  50. .if !r C .nr C 0
  51. .if !r S .nr S 10
  52. .\" we must use consecutive page numbers when using postscript to generate
  53. .\" html images, and we must not reset the page number at the beginning
  54. .\" (the `ps4html' register is automatically added to the command line by
  55. .\" the pre-html preprocessor)
  56. .if !r ps4html \
  57. . if r P .pn 0\n[P]
  58. .if !r cR \{\
  59. . ie n .nr cR 1
  60. . el .nr cR 0
  61. .\}
  62. .
  63. .nr need_eo_h 0
  64. .
  65. .\" set up the line length...
  66. .\" giving precedence to any prior assignment to the \n[LL] register.
  67. .if !r LL \{\
  68. .
  69. . \" but if that isn't predefined...
  70. . \" then try to respect any prior `.ll' request.
  71. . nr LL \n[.l]
  72. .
  73. . \" For troff, this is sufficient to give us a default line length of
  74. . \" 6.5i, but for nroff, we prefer a default of 78n to nroff's default
  75. . \" 65n. This has the unfortunate side effect that we will override a
  76. . \" user's `.ll 65n' request, with our preferred 78n default; we can't
  77. . \" possibly know that the 65n came from a `.ll' request, and MUST
  78. . \" assume that it was set by nroff, as its built-in default! If the
  79. . \" user wants to force this setting, then he MUST use the `-rLL=65n'
  80. . \" option, or an equivalent `.nr LL 65n' request.
  81. . if n \
  82. . if (\n[LL] = 65n) \
  83. . nr LL 78n
  84. .\}
  85. .
  86. .if !r LT \
  87. . nr LT \n[LL]
  88. .
  89. .nr FT -.5i
  90. .
  91. .\" Default heading font
  92. .ds HF B
  93. .
  94. .nr an-first 1
  95. .
  96. .nr an-html 0
  97. .if '\*[.T]'html' .nr an-html 1
  98. .if \n[an-html] .nr C 1
  99. .if r ps4html .nr C 1
  100. .
  101. .\" we redefine .ne to avoid page breaks if cR is set; instead, the page
  102. .\" length is increased to the necessary amount (this is needed for tables)
  103. .\"
  104. .\" similarly, we redefine .bp if cR is set, adjusting the page length to
  105. .\" the current position so that no empty lines are inserted
  106. .if \n[cR] \{\
  107. . de1 ne
  108. . ie \\n[.$] \
  109. . nr an-ne (v;\\$*)
  110. . el \
  111. . nr an-ne 1v
  112. . if (\\n[an-ne] >= \\n[.t]) \
  113. . pl +(\\n[an-ne]u - \\n[.t]u + 1v)
  114. . .
  115. .
  116. . rn bp an-bp
  117. . de1 bp
  118. . br
  119. . pl \\n[nl]u
  120. . an-bp \\$*
  121. . .
  122. .\}
  123. .
  124. .de set-an-margin
  125. . nr an-margin \\n[IN]
  126. ..
  127. .
  128. .\" .TH title section extra1 extra2 extra3
  129. .de1 TH
  130. . if \\n[an-html] \{\
  131. . DEVTAG-TL
  132. \\$1
  133. . DEVTAG-EO-TL
  134. . \}
  135. .
  136. . de an-init \" We have to do it like this to get multiple man pages right.
  137. . ds an-title "\\$1
  138. . ds an-section "\\$2
  139. . ds an-extra1 "\\$3
  140. . ie (\\n[.$] > 3) .ds an-extra2 "\\$4
  141. . el .ds an-extra2 \"Sun Release 4.0
  142. . ie (\\n[.$] > 4) .ds an-extra3 "\\$5
  143. . el .ds an-extra3 \"System Programmer's Manual
  144. . ds an-init
  145. \\..
  146. .
  147. . DT
  148. .
  149. . nr PS 10z \" default point size
  150. . nr PS-SS 10z
  151. . nr PS-SH 10.95z
  152. . nr VS 12p
  153. .
  154. . \" use sizes similar to LaTeX
  155. . if t \{\
  156. . ie (\\n[S] == 11) \{\
  157. . nr PS 10.95z
  158. . nr PS-SS 10.95z
  159. . nr PS-SH 12z
  160. . nr VS 13.6p
  161. . \}
  162. . el \{\
  163. . if (\\n[S] == 12) \{\
  164. . nr PS 12z
  165. . nr PS-SS 12z
  166. . nr PS-SH 14.4z
  167. . nr VS 14.5p
  168. . \}
  169. . \}
  170. . \}
  171. .
  172. . ps \\n[PS]u
  173. . vs \\n[VS]u
  174. . ll \\n[LL]u
  175. .
  176. .\" We must select an integer indentation value for nroff;
  177. .\" see comment in an-do-tag.
  178. . if !r IN \{\
  179. . ie t .nr IN 7.2n
  180. . el .nr IN 7n
  181. . \}
  182. . PD
  183. . if !r SN \
  184. . nr SN 3n \" the indentation of sub-sub-headings relative to sub-headings
  185. . nr an-level 1
  186. . set-an-margin
  187. . nr an-prevailing-indent \\n[IN]
  188. . nr an-tag-sep 1n
  189. .
  190. . nr an-no-space-flag 0
  191. . nr an-break-flag 0
  192. . nr an-div? 0
  193. .
  194. . ie \\n[cR] \
  195. . an-header
  196. . el \{\
  197. . wh 0 an-header
  198. . wh -1i an-footer
  199. . wh \\n[FT]u an-p-footer
  200. .
  201. . if (\\n[nl] > 0) \{\
  202. . ie \\n[C] .bp (\\n[%] + 1)
  203. . el .bp 1
  204. . \}
  205. . \}
  206. ..
  207. .
  208. .\" BSD compatibility macros: .AT and .UC
  209. .
  210. .de1 AT
  211. . ds an-extra2 "7th Edition
  212. . if "\\$1"3" .ds an-extra2 "7th Edition
  213. . if "\\$1"4" .ds an-extra2 "System III
  214. . if "\\$1"5" \{\
  215. . ie "\\$2"" .ds an-extra2 "System V
  216. . el .ds an-extra2 "System V Release \\$2
  217. . \}
  218. ..
  219. .
  220. .de1 UC
  221. . ds an-extra2 "3rd Berkeley Distribution
  222. . if "\\$1"3" .ds an-extra2 "3rd Berkeley Distribution
  223. . if "\\$1"4" .ds an-extra2 "4th Berkeley Distribution
  224. . if "\\$1"5" .ds an-extra2 "4.2 Berkeley Distribution
  225. . if "\\$1"6" .ds an-extra2 "4.3 Berkeley Distribution
  226. . if "\\$1"7" .ds an-extra2 "4.4 Berkeley Distribution
  227. ..
  228. .
  229. .de1 DT
  230. . ta T .5i \" This sets tabs every .5 inches
  231. ..
  232. .
  233. .de1 PD
  234. . ie \\n[.$] .nr PD (v;\\$1)
  235. . el .nr PD (.4v >? \n[.V])
  236. ..
  237. .
  238. .\" Redefine these to customize the header & footer
  239. .
  240. .de1 PT
  241. . tl '\\*[an-title](\\*[an-section])'\\*[an-extra3]'\\*[an-title](\\*[an-section])'
  242. ..
  243. .
  244. .de1 BT
  245. . if r ps4html \
  246. . return
  247. . ie \\n[D] \{\
  248. . if o .tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
  249. . if e .tl '\\*[an-page-string]'\\*[an-extra1]'\\*[an-extra2]'
  250. . \}
  251. . el \
  252. . tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
  253. ..
  254. .
  255. .de1 an-header
  256. . an-init
  257. . if \\n[cR] \{\
  258. . ie \\n[an-first] \
  259. . nr an-first 0
  260. . el \
  261. . sp .5i
  262. . \}
  263. . ev 1
  264. . ps \\n[PS]u
  265. . vs \\n[VS]u
  266. . lt \\n[LT]u
  267. . ie \\n[an-html] \
  268. . tl ''''
  269. . el \{\
  270. . if !\\n[cR] \
  271. . sp .5i
  272. . PT
  273. . ie !\\n[cR] \
  274. . sp |1i
  275. . el \
  276. . sp .5i
  277. . \}
  278. . ev
  279. . ns
  280. ..
  281. .
  282. .de1 an-footer
  283. ' bp
  284. ..
  285. .
  286. .af an-page-letter a
  287. .
  288. .de1 an-p-footer
  289. . ev 1
  290. . ps \\n[PS]u
  291. . vs \\n[VS]u
  292. . lt \\n[LT]u
  293. . ie \\n[an-html] \{\
  294. . ds an-page-string
  295. . ds an-extra1
  296. . ds an-extra2
  297. . \}
  298. . el \{\
  299. . ie r X \{\
  300. . if (\\n[%] > \\n[X]) \{\
  301. . nr an-page-letter (\\n[%] - \\n[X])
  302. . ds an-page-string \\n[X]\\n[an-page-letter]
  303. . \}
  304. . \}
  305. . el \{\
  306. . ie \\n[cR] \
  307. . ds an-page-string "\\*[an-title](\\*[an-section])
  308. . el \
  309. . ds an-page-string \\n[%]
  310. . \}
  311. . \}
  312. . BT
  313. . ev
  314. ..
  315. .
  316. .de1 an-end
  317. . nr % 1
  318. . pl +4v
  319. . fl
  320. . sp 3
  321. . an-p-footer
  322. . pl \\n[nl]u
  323. ..
  324. .
  325. .if \n[cR] .em an-end
  326. .
  327. .de1 SH
  328. . sp \\n[PD]u
  329. . nr an-level 1
  330. . set-an-margin
  331. . nr an-prevailing-indent \\n[IN]
  332. . fi
  333. . in \\n[an-margin]u
  334. . ti 0
  335. . nr need_eo_h 1
  336. . DEVTAG-NH \\n[an-level]
  337. . it 1 an-trap
  338. . nr an-no-space-flag 1
  339. . nr an-break-flag 1
  340. . ps \\n[PS-SH]u
  341. . ft \\*[HF]
  342. . ne (2v + 1u)
  343. . if \\n[.$] \&\\$*
  344. ..
  345. .
  346. .de1 SS
  347. . sp \\n[PD]u
  348. . nr an-level 1
  349. . set-an-margin
  350. . nr an-prevailing-indent \\n[IN]
  351. . fi
  352. . in \\n[IN]u
  353. . ti \\n[SN]u
  354. . it 1 an-trap
  355. . nr an-no-space-flag 1
  356. . nr an-break-flag 1
  357. . ps \\n[PS-SS]u
  358. . ft \\*[HF]
  359. . ne (2v + 1u)
  360. . if \\n[.$] \&\\$*
  361. ..
  362. .
  363. .de1 B
  364. . it 1 an-trap
  365. . ft B
  366. . if \\n[.$] \&\\$*
  367. ..
  368. .
  369. .de1 I
  370. . it 1 an-trap
  371. . ft I
  372. . if \\n[.$] \,\\$*\/
  373. ..
  374. .
  375. .de1 SM
  376. . it 1 an-trap
  377. . ps -1
  378. . if \\n[.$] \&\\$*
  379. ..
  380. .
  381. .de1 SB
  382. . it 1 an-trap
  383. . ps -1
  384. . ft B
  385. . if \\n[.$] \&\\$*
  386. ..
  387. .
  388. .de1 TP
  389. . sp \\n[PD]u
  390. . if \\n[.$] .nr an-prevailing-indent (n;\\$1)
  391. . it 1 an-trap
  392. . in 0
  393. . ll -\\n[an-margin]u
  394. . if !\\n[an-div?] .di an-div
  395. . nr an-div? 1
  396. ..
  397. .
  398. .de1 an-trap
  399. . if \\n[need_eo_h]>0 .DEVTAG-EO-H
  400. . nr need_eo_h 0
  401. . ft R
  402. . ps \\n[PS]u
  403. . vs \\n[VS]u
  404. . if \\n[an-break-flag] \{\
  405. . br
  406. . nr an-break-flag 0
  407. . \}
  408. . if \\n[an-no-space-flag] \{\
  409. . ns
  410. . nr an-no-space-flag 0
  411. . \}
  412. . if \\n[an-div?] .an-do-tag
  413. ..
  414. .
  415. .de an-do-tag
  416. . br
  417. . di
  418. . nr an-div? 0
  419. . ll
  420. . ie (\\n[dl] + \\n[an-tag-sep] > \\n[an-prevailing-indent]) \{\
  421. . in \\n[an-margin]u
  422. . ne (2v + 1u)
  423. . an-div
  424. . in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
  425. . \}
  426. . el \{\
  427. . \" In nroff mode, if the indentation value is not an integer multiple
  428. . \" of the character cell, it is possible that the following combination
  429. . \" of .in and .ti yields a different result as the .in request in
  430. . \" the .ie part above.
  431. . in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
  432. . ti -\\n[an-prevailing-indent]u
  433. . chop an-div
  434. . ne (1v + 1u)
  435. . DEVTAG-COL 1
  436. \\*[an-div]\\h'|\\n[an-prevailing-indent]u'\c
  437. . DEVTAG-COL-NEXT 2
  438. . \}
  439. ..
  440. .
  441. .de1 LP
  442. . sp \\n[PD]u
  443. . ps \\n[PS]u
  444. . vs \\n[VS]u
  445. . ft R
  446. . in \\n[an-margin]u
  447. . nr an-prevailing-indent \\n[IN]
  448. ..
  449. .
  450. .als PP LP
  451. .als P LP
  452. .
  453. .de1 IP
  454. . ie !\\n[.$] \{\
  455. . ps \\n[PS]u
  456. . vs \\n[VS]u
  457. . ft R
  458. . sp \\n[PD]u
  459. . ne (1v + 1u)
  460. . in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
  461. . \}
  462. . el \{\
  463. . ie (\\n[.$] - 1) .TP "\\$2"
  464. . el .TP
  465. \&\\$1
  466. . \}
  467. ..
  468. .
  469. .de1 HP
  470. . ps \\n[PS]u
  471. . vs \\n[VS]u
  472. . ft R
  473. . sp \\n[PD]u
  474. . ne (1v + 1u)
  475. . if \\n[.$] .nr an-prevailing-indent (n;\\$1)
  476. . in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
  477. . ti \\n[an-margin]u
  478. ..
  479. .
  480. .ds an-empty \" this is referenced to avoid looping on eg .RB ( \\ )
  481. .
  482. .de1 RI
  483. . if \\n[.$] \{\
  484. . ds an-result \&\f[R]\\$1
  485. . shift
  486. . while (\\n[.$] >= 2) \{\
  487. . as an-result \,\f[I]\\$1\f[R]\/\\$2\\*[an-empty]
  488. . shift 2
  489. . \}
  490. . if \\n[.$] .as an-result \,\f[I]\\$1
  491. \\*[an-result]
  492. . ft R
  493. . \}
  494. ..
  495. .
  496. .de1 IR
  497. . if \\n[.$] \{\
  498. . ds an-result \&\f[I]\\$1\f[R]
  499. . shift
  500. . while (\\n[.$] >= 2) \{\
  501. . as an-result \/\\$1\f[I]\,\\$2\f[R]
  502. . shift 2
  503. . \}
  504. . if \\n[.$] .as an-result \/\\$1
  505. \\*[an-result]
  506. . ft R
  507. . \}
  508. ..
  509. .
  510. .de1 IB
  511. . if \\n[.$] \{\
  512. . ds an-result \&\f[I]\\$1
  513. . shift
  514. . while (\\n[.$] >= 2) \{\
  515. . as an-result \/\f[B]\\$1\f[I]\,\\$2\\*[an-empty]
  516. . shift 2
  517. . \}
  518. . if \\n[.$] .as an-result \/\f[B]\\$1
  519. \\*[an-result]
  520. . ft R
  521. . \}
  522. ..
  523. .
  524. .de1 BI
  525. . if \\n[.$] \{\
  526. . ds an-result \&\f[B]\\$1
  527. . shift
  528. . while (\\n[.$] >= 2) \{\
  529. . as an-result \,\f[I]\\$1\f[B]\/\\$2\\*[an-empty]
  530. . shift 2
  531. . \}
  532. . if \\n[.$] .as an-result \,\f[I]\\$1
  533. \\*[an-result]
  534. . ft R
  535. . \}
  536. ..
  537. .
  538. .de1 RB
  539. . ds an-result \&
  540. . while (\\n[.$] >= 2) \{\
  541. . as an-result \f[R]\\$1\f[B]\\$2\\*[an-empty]
  542. . shift 2
  543. . \}
  544. . if \\n[.$] .as an-result \f[R]\\$1
  545. \\*[an-result]
  546. . ft R
  547. ..
  548. .
  549. .de1 BR
  550. . ds an-result \&
  551. . while (\\n[.$] >= 2) \{\
  552. . as an-result \f[B]\\$1\f[R]\\$2\\*[an-empty]
  553. . shift 2
  554. . \}
  555. . if \\n[.$] .as an-result \f[B]\\$1
  556. \\*[an-result]
  557. . ft R
  558. ..
  559. .
  560. .de1 RS
  561. . nr an-saved-margin\\n[an-level] \\n[an-margin]
  562. . nr an-saved-prevailing-indent\\n[an-level] \\n[an-prevailing-indent]
  563. . ie \\n[.$] .nr an-margin +(n;\\$1)
  564. . el .nr an-margin +\\n[an-prevailing-indent]
  565. . in \\n[an-margin]u
  566. . nr an-prevailing-indent \\n[IN]
  567. . nr an-level +1
  568. ..
  569. .
  570. .de1 RE
  571. . ie \\n[.$] .nr an-level ((;\\$1) <? \\n[an-level])
  572. . el .nr an-level -1
  573. . nr an-level (1 >? \\n[an-level])
  574. . nr an-margin \\n[an-saved-margin\\n[an-level]]
  575. . nr an-prevailing-indent \\n[an-saved-prevailing-indent\\n[an-level]]
  576. . in \\n[an-margin]u
  577. ..
  578. .
  579. .\" table support
  580. .
  581. .de1 TS
  582. . sp \\n[PD]u
  583. . HTML-IMAGE
  584. ..
  585. .
  586. .de1 T&
  587. ..
  588. .
  589. .de1 TE
  590. . HTML-IMAGE-END
  591. ..
  592. .
  593. .\" dummy equation delimiters
  594. .de1 EQ
  595. . HTML-IMAGE
  596. ..
  597. .de1 EN
  598. . HTML-IMAGE-END
  599. ..
  600. .
  601. .de1 R
  602. \c
  603. . ie \\n[.$] \{\
  604. . tm `R' is a string (producing the registered sign), not a macro.
  605. . nop \\$*
  606. . \}
  607. . el \{\
  608. . ie c\[rg] \
  609. . nop \[rg]\c
  610. . el \
  611. . nop (Reg.)\c
  612. . \}
  613. ..
  614. .
  615. .\" these strings must work in compatibility mode also
  616. .
  617. .ds S \s'\\n(PSu'
  618. .ie c\[tm] .ds Tm \(tm
  619. .el .ds Tm (TM)
  620. .ds lq \(lq
  621. .ds rq \(rq
  622. .
  623. .if !\n[an-html] \{\
  624. . if !rHY \{\
  625. . ie \n[cR] \
  626. . nr HY 12
  627. . el \
  628. . nr HY 14
  629. . \}
  630. . hy \n[HY]
  631. .\}
  632. .
  633. .\" For UTF-8, map some characters conservatively for the sake
  634. .\" of easy cut and paste.
  635. .
  636. .if '\*[.T]'utf8' \{\
  637. . rchar \- - ' `
  638. .
  639. . char \- \N'45'
  640. . char - \N'45'
  641. . char ' \N'39'
  642. . char ` \N'96'
  643. .\}
  644. .
  645. .\" Load local modifications.
  646. .mso man.local
  647. .
  648. .cp \n[_C]
  649. .
  650. .\" end of an-old.tmac