groff before CVS: release 1.05
[s-roff.git] / macros / tmac.an
blobaca79a621c5502ec18c630881f5be04af994dfc1
1 .\"Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
2 .\"     Written by James Clark (jjc@jclark.uucp)
3 .\"
4 .\"This file is part of groff.
5 .\"
6 .\"groff is free software; you can redistribute it and/or modify it under
7 .\"the terms of the GNU General Public License as published by the Free
8 .\"Software Foundation; either version 1, or (at your option) any later
9 .\"version.
10 .\"
11 .\"groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 .\"WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 .\"FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 .\"for more details.
15 .\"
16 .\"You should have received a copy of the GNU General Public License along
17 .\"with groff; see the file LICENSE.  If not, write to the Free Software
18 .\"Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 .\"
20 .\" -rC1 => number pages continuously, rather than start each at 1
21 .\" -rD1 => double-sided printing, ie different odd and even page footers
22 .\" -rPnnn => number first page nnn
23 .\" -rXnnn => number pages after nnn as nnna, nnnb, nnnc, ...
24 .\"
25 .if !\n(.g .ab These man macros work only with groff.
26 .if \n(.C \{\
27 .       tm Warning: turning off compatibility mode
28 .       cp 0
29 .\}
30 .if !rD .nr D 0
31 .if !rC .nr C 0
32 .if rP .pn 0\nP
33 .\" .TH title section extra1 extra2 extra3
34 .de TH
35 .de an-init \" We have to do it like this to get multiple man pages right.
36 .ds an-title "\\$1
37 .ds an-section "\\$2
38 .ds an-extra1 "\\$3
39 .ie \\n[.$]>3 .ds an-extra2 "\\$4
40 .el .ds an-extra2 \"Sun Release 4.0
41 .ie \\n[.$]>4 .ds an-extra3 "\\$5
42 .el .ds an-extra3 \"UNIX Programmer's Manual
43 .ds an-init
44 \\..
45 .DT
46 .nr IN 7.2n
47 .nr LL 6.5i
48 .PD
49 .nr PS 10 \" normal point-size
50 .nr SN 3n \" the indentation of sub-sub-headings relative to sub-headings
51 .nr an-level 1
52 .nr an-margin \\n[IN]
53 .nr an-prevailing-indent \\n[IN]
54 .nr an-tag-sep 1n
55 .nr an-no-space-flag 0
56 .nr an-break-flag 0
57 .nr an-div? 0
58 .if \\n[nl]>0 \{\
59 .       ie \\nC .bp \\n%+1
60 .       el .bp 1
61 .\}
63 .de DT
64 .ta T .5i \" This sets tabs every .5 inches
66 .de PD
67 .ie \\n[.$] .nr PD (v;\\$1)
68 .el .nr PD .4v>?\n[.V]
70 .wh 0 an-header
71 .de an-header
72 .an-init
73 .ev 1
74 .sp .5i
75 .tl '\\*[an-title](\\*[an-section])'\\*[an-extra3]'\\*[an-title](\\*[an-section])'
76 .sp |1i
77 .ev
78 .ns
80 .wh -1i an-footer
81 .de an-footer
82 'bp
84 .wh -.5i an-p-footer
85 .af an-page-letter a
86 .de an-p-footer
87 .ev 1
88 .ds an-page-string \\n%
89 .if rX \{\
90 .       if \\n%>\\nX \{\
91 .               nr an-page-letter \\n%-\\nX
92 .               ds an-page-string \\nX\\n[an-page-letter]
93 .\}\}
94 .ie \\nD \{\
95 .       if o .tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
96 .       if e .tl '\\*[an-page-string]'\\*[an-extra1]'\\*[an-extra2]'
97 .\}
98 .el .tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
99 .ev
101 .de SH
102 .sp \\n[PD]u
103 .nr an-level 1
104 .nr an-margin \\n[IN]
105 .nr an-prevailing-indent \\n[IN]
107 .in \\n[IN]u
108 .ti 0
109 .it 1 an-trap
110 .nr an-no-space-flag 1
111 .nr an-break-flag 1
112 .ps \\n[PS]-1
113 .ft B
114 .ne 2v+1u
115 .if \\n[.$] \&\\$*
117 .de SS
118 .sp \\n[PD]u
119 .nr an-level 1
120 .nr an-margin \\n[IN]
121 .nr an-prevailing-indent \\n[IN]
123 .in \\n[IN]u
124 .ti \\n[SN]u
125 .it 1 an-trap
126 .nr an-no-space-flag 1
127 .nr an-break-flag 1
128 .ps \\n[PS]
129 .ft B
130 .ne 2v+1u
131 .if \\n[.$] \&\\$*
133 .de R
134 .ft R
135 .if \\n[.$] \&\\$*
137 .de B
138 .it 1 an-trap
139 .ft B
140 .if \\n[.$] \&\\$*
142 .de I
143 .it 1 an-trap
144 .ft I
145 .if \\n[.$] \&\\$*
147 .de SM
148 .it 1 an-trap
149 .ps -1
150 .if \\n[.$] \&\\$*
152 .de SB
153 .it 1 an-trap
154 .ps -1
155 .ft B
156 .if \\n[.$] \&\\$*
158 .de TP
159 .sp \\n[PD]u
160 .if \\n[.$] .nr an-prevailing-indent (n;\\$1)
161 .it 1 an-trap
162 .di an-div
163 .in 0
164 .nr an-div? 1
166 .de an-trap
167 .ft R
168 .ps \\n[PS]
169 .if \\n[an-break-flag] \{\
170 .       br
171 .       nr an-break-flag 0
173 .if \\n[an-no-space-flag] \{\
174 .       ns
175 .       nr an-no-space-flag 0
177 .if \\n[an-div?] .an-do-tag
179 .de an-do-tag
180 .nr an-div? 0
183 .in \\n[an-margin]u+\\n[an-prevailing-indent]u
184 .ti -\\n[an-prevailing-indent]u
185 .ie \\n[dl]+\\n[an-tag-sep]>\\n[an-prevailing-indent] \{\
186 .       ne 2v+1u
187 .       an-div
188 .       br
190 .el \{\
191 .       chop an-div
192 .       ne 1v+1u
193 \\*[an-div]\\h'|\\n[an-prevailing-indent]u'\c
196 .de LP
198 .sp \\n[PD]u
199 .ps \\n[PS]
200 .ft R
201 .in \\n[an-margin]u
202 .nr an-prevailing-indent \\n[IN]
204 .als PP LP
205 .als P LP
206 .de IP
207 .ie !\\n[.$] \{\
208 .       ps \\n[PS]
209 .       ft R
210 .       sp \\n[PD]u
211 .       ne 1v+1u
212 .       in \\n[an-margin]u+\\n[an-prevailing-indent]u
214 .el \{\
215 .       ie \\n[.$]-1 .TP "\\$2"
216 .       el .TP
217 \&\\$1
220 .de HP
221 .ps \\n[PS]
222 .ft R
223 .sp \\n[PD]u
224 .ne 1v+1u
225 .if \\n[.$] .nr an-prevailing-indent (n;\\$1)
226 .in \\n[an-margin]u+\\n[an-prevailing-indent]u
227 .ti \\n[an-margin]u
229 .de RI
230 .if \\n[.$] \{\
231 .       ds an-result \&\\$1
232 .       shift
233 .       while \\n[.$]>=2 \{\
234 .               as an-result \,\fI\\$1\fR\/\\$2
235 .               shift 2
236 .       \}
237 .       if \\n[.$] .as an-result \,\fI\\$1\fR
238 \\*[an-result]
241 .de IR
242 .if \\n[.$] \{\
243 .       ds an-result \&\fI\\$1\fR
244 .       shift
245 .       while \\n[.$]>=2 \{\
246 .               as an-result \/\\$1\fI\,\\$2\fR
247 .               shift 2
248 .       \}
249 .       if \\n[.$] .as an-result \/\\$1
250 \\*[an-result]
253 .de IB
254 .if \\n[.$] \{\
255 .       ds an-result \&\fI\\$1
256 .       shift
257 .       while \\n[.$]>=2 \{\
258 .               as an-result \/\\fB\\$1\fI\,\\$2
259 .               shift 2
260 .       \}
261 .       if \\n[.$] .as an-result \/\\fB\\$1
262 \\*[an-result]
263 .       ft R
266 .de BI
267 .if \\n[.$] \{\
268 .       ds an-result \&\fB\\$1
269 .       shift
270 .       while \\n[.$]>=2 \{\
271 .               as an-result \,\fI\\$1\fB\/\\$2
272 .               shift 2
273 .       \}
274 .       if \\n[.$] .as an-result \,\fI\\$1
275 \\*[an-result]
276 .       ft R
279 .de RB
280 .ds an-result \&
281 .while \\n[.$]>=2 \{\
282 .       as an-result \fR\\$1\fB\\$2
283 .       shift 2
285 .if \\n[.$] .as an-result \fR\\$1
286 \\*[an-result]
287 .ft R
289 .de BR
290 .ds an-result \&
291 .while \\n[.$]>=2 \{\
292 .       as an-result \fB\\$1\fR\\$2
293 .       shift 2
295 .if \\n[.$] .as an-result \fB\\$1
296 \\*[an-result]
297 .ft R
299 .de RS
301 .nr an-saved-margin\\n[an-level] \\n[an-margin]
302 .nr an-saved-prevailing-indent\\n[an-level] \\n[an-prevailing-indent]
303 .ie \\n[.$] .nr an-margin +(n;\\$1)
304 .el .nr an-margin +\\n[an-prevailing-indent]
305 .in \\n[an-margin]u
306 .nr an-prevailing-indent \\n[IN]
307 .nr an-level +1
309 .de RE
311 .ie \\n[.$] .nr an-level (;\\$1)<?\\n[an-level]
312 .el .nr an-level -1
313 .nr an-level 1>?\\n[an-level]
314 .nr an-margin \\n[an-saved-margin\\n[an-level]]
315 .nr an-prevailing-indent \\n[an-saved-prevailing-indent\\n[an-level]]
316 .in \\n[an-margin]u
318 .ds S \s[\\n[PS]]
319 .ie c\[rg] .ds R \[rg]
320 .el .ds R (Reg.)
321 .ie c\[tm] .ds T \[tm]
322 .el .ds T (TM)
323 .als Tm T
324 .hy 14