comparison style @ 81:5fb821ed6f3c

style: Refactoring and more comments
author markus schnalke <meillo@marmaro.de>
date Wed, 06 Jun 2012 14:53:16 +0200
parents f3c95ee96cc4
children ff4537327162
comparison
equal deleted inserted replaced
80:be3e09c2181e 81:5fb821ed6f3c
49 .nr LL 13c 49 .nr LL 13c
50 .ll 13c 50 .ll 13c
51 .nr LT \n(LL 51 .nr LT \n(LL
52 .if t .nr PO 3.3c 52 .if t .nr PO 3.3c
53 53
54 .de _M \" change margins for text block on next page 54 . \" _M - change margins for text block on next page
55 .de _M
55 .if t .if o .nr PO +(21c-\n(.lu-(2u*3.3c))c 56 .if t .if o .nr PO +(21c-\n(.lu-(2u*3.3c))c
56 .if t .if e .nr PO -(21c-\n(.lu-(2u*3.3c))c 57 .if t .if e .nr PO -(21c-\n(.lu-(2u*3.3c))c
57 .ds CF " 58 .ds CF "
58 .. 59 ..
59 .wh -1u _M 60 .wh -1u _M
60 61
62 . \" CW - Set text in CW font (similar to .B and .I)
61 .de CW 63 .de CW
62 .nr PQ \\n(.f 64 .nr PQ \\n(.f
63 .if t \{\ 65 .if t \{\
64 . ft CW 66 . ft CW
65 . if !^\\$1^^ \&\\$1\f\\n(PQ\\$2 67 . if !^\\$1^^ \&\\$1\f\\n(PQ\\$2
71 . if \\n(.$>1 \&\\$1\c 73 . if \\n(.$>1 \&\\$1\c
72 . if \\n(.$>1 \&\\$2 74 . if \\n(.$>1 \&\\$2
73 .\} 75 .\}
74 .. 76 ..
75 77
78 . \" refer(1) stuff
76 .ds [. " [ 79 .ds [. " [
77 .ds .] ] 80 .ds .] ]
78 .rm ]< 81 .rm ]<
79 .de ]< 82 .de ]<
80 . LP 83 . LP
82 . IP \\\\$1. 85 . IP \\\\$1.
83 \\.. 86 \\..
84 . rm FS FE 87 . rm FS FE
85 .. 88 ..
86 89
90 . \" PT - page top macro of ms
87 .am PT 91 .am PT
88 . rs 92 . rs
89 .. 93 ..
90 94
91 .de T_ \" add entry to TOC: .T_ pre-space indent-level text 95
96 . \" RN - Reset PN and continue on an odd page ($1=number-format)
97 .de RN
98 .ie e .pn 1
99 .el \{
100 . pn 0
101 . bp
102 .\}
103 .ie \\n(.$=1 .af PN \\$1
104 .el .af PN 1
105 ..
106
107
108 . \" T_ - Add TOC entry ($1=pre-space $2=indent-level $3=text)
109 .de T_
92 .tm TOC____.sp \\$1 110 .tm TOC____.sp \\$1
93 .tm TOC____\&\\h'\\$2u*2u*\\n(PIu'\\$3\0\0\a\t\\n(PN\fR 111 .tm TOC____\&\\h'\\$2u*2u*\\n(PIu'\\$3\0\0\a\t\\n(PN\fR
94 .. 112 ..
95 113
96 .rm NH 114 . \" NH - redefine numbered heading
97 .de NH 115 .de NH
98 .SH 116 .SH
99 .nr NS \\$1 117 .nr NS \\$1
100 .if !\\n(.$ .nr NS 1 118 .if !\\n(.$ .nr NS 1
101 .if !\\n(NS .nr NS 1 119 .if !\\n(NS .nr NS 1
105 .ds SN \\n(H1 123 .ds SN \\n(H1
106 .if \\n(NS>1 .as SN \&.\\n(H2 124 .if \\n(NS>1 .as SN \&.\\n(H2
107 .if \\n(NS>2 .as SN \&.\\n(H3 125 .if \\n(NS>2 .as SN \&.\\n(H3
108 .. 126 ..
109 127
128 . \" H- - Chapter unnumbered and not in TOC ($2=="no" -> no page hdrs)
110 .de H- 129 .de H-
111 .EH " 130 .EH "
112 .OH " 131 .OH "
113 .bp 132 .bp
114 .rs 133 .if e .rs \" move to an odd page
115 .if e .bp 134 .if e .bp
116 .lg 0 135 .lg 0
117 .nr PS +6 136 .nr PS +6
118 .nr VS +6 137 .nr VS +6
119 .SH 138 .SH
123 .br 142 .br
124 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz 143 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
125 .nr PS -6 144 .nr PS -6
126 .nr VS -6 145 .nr VS -6
127 .lg 146 .lg
128 .RT
129 .if !,\\$2,no, \{ 147 .if !,\\$2,no, \{
130 . EH "\\\\*(_E 148 . EH "\\\\*(_E
131 . ie \\n(H1 .OH "\\\\*(_O 149 . ie \\n(H1 .OH "\\\\*(_O
132 . el .OH "\\\\*(_o 150 . el .OH "\\\\*(_o
133 . ds CF \\n(PN 151 . ds CF \\n(PN
134 .\} 152 .\}
153 .RT
135 .sp 4 154 .sp 4
136 .nr PP 0 155 .nr PP 0
137 .. 156 ..
138 157
158 . \" H0 - Chapter ($2=="no" -> not numbered)
139 .de H0 159 .de H0
140 .EH " 160 .EH "
141 .OH " 161 .OH "
142 .bp 162 .bp
143 .rs 163 .if e .rs \" begin chapter on an odd page
144 .if e .bp 164 .if e .bp
145 . lg 0 165 .lg 0
146 . nr PS +6 166 .nr PS +6
147 . nr VS +6 167 .nr VS +6
148 .ie \\n(.$=1 \{\ 168 .ie ,\\$2,no, .SH
169 .el \{\
149 . NH 1 170 . NH 1
150 . ce 1 171 . ce 1
151 Chapter \\*(SN 172 Chapter \\*(SN
152 . sp .5 173 . sp .5
153 .\} 174 .\}
154 .el .if ,\\$2,no, .SH 175 .ce 1
155 . ce 1 176 .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
156 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
157 \&\\$1 177 \&\\$1
158 . br 178 .br
159 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz 179 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
160 . nr PS -6 180 .nr PS -6
161 . nr VS -6 181 .nr VS -6
162 . lg 182 .lg
163 .ds _C "\\$1 183 .\" add to TOC
164 . RT
165 .rm t_ 184 .rm t_
166 .if !,\\$2,no, .ds t_ \\*(SN\0\0 185 .if !,\\$2,no, .ds t_ \\*(SN\0\0
167 .T_ .5v 0 "\fB\\*(t_\\$1 186 .T_ .5v 0 "\fB\\*(t_\\$1
187 .\" set page headers and footers
168 .EH "\\\\*(_E 188 .EH "\\\\*(_E
189 .ds _C "\\$1
169 .ie \\n(H1 .OH "\\\\*(_O 190 .ie \\n(H1 .OH "\\\\*(_O
170 .el .OH "\\\\*(_o 191 .el .OH "\\\\*(_o
171 .ds CF \\n(PN 192 .ds CF \\n(PN
193 .RT
172 .sp 4 194 .sp 4
173 .nr PP 0 195 .nr PP 0
174 .. 196 ..
175 197
176 198
177 .\" Reset page Numbers, set page number format ($1) and move to a right page. 199 . \" H1 - Section ($2=="no" -> not numbered)
178 .de RN
179 .ie e .pn 1
180 .el \{
181 . pn 0
182 . bp
183 .\}
184 .ie \\n(.$=1 .af PN \\$1
185 .el .af PN 1
186 ..
187
188
189 .de H1 200 .de H1
190 .br 201 .br
191 .ne 7 202 .ne 7
192 .sp 203 .sp
193 . nr PS +2 204 .lg 0
194 . nr VS +2 205 .nr PS +2
195 .if '\\$2'no' .SH 206 .nr VS +2
196 .if \\n(.$=1 .NH 2 207 .ie '\\$2'no' .SH
197 . lg 0 208 .el .NH 2
198 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
199 .if !'\\$2'no' \&\\*(SN 209 .if !'\\$2'no' \&\\*(SN
200 \\$1 210 .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
201 . br 211 \&\\$1
202 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz 212 .br
203 . nr PS -2 213 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
204 . nr VS -2 214 .nr PS -2
205 . lg 215 .nr VS -2
206 . RT 216 .lg
207 .if !'\\$2'no' \{\ 217 .if !'\\$2'no' .T_ .3v 1 "\\*(SN\0\0\\$1 \" add to TOC
208 . ds _S "\\$1 218 .RT
209 . T_ .3v 1 "\\*(SN\0\0\\$1 219 .nr PP 0
210 .\} 220 ..
211 .nr PP 0 221
212 .. 222 . \" H2 - Subsection
213
214 .de H2 223 .de H2
215 .br 224 .br
216 .ne 4 225 .ne 4
217 .NH 3 226 .NH 3
218 \&\\*(SN 227 \&\\*(SN \\$1
219 \\$1 228 .T_ 0 2 "\\*(SN\0\0\\$1 \" add to TOC
220 .RT 229 .RT
221 .ds _S "\\$1 230 .nr PP 0
222 .T_ 0 2 "\\*(SN\0\0\\$1 231 ..
223 .nr PP 0 232
224 .. 233 . \" U2 - Subsection unnumbered
225
226 .de U2 234 .de U2
227 .br 235 .br
228 .ne 4 236 .ne 4
229 .SH 237 .SH
230 \\$1 238 \&\\$1
231 .RT 239 .RT
232 .nr PP 0 240 .nr PP 0
233 .. 241 ..
234 242
243 . \" U3 - Subsubsection unnumbered
235 .de U3 244 .de U3
236 .br 245 .br
237 .ne 4 246 .ne 4
238 .RT 247 .RT
239 .sp 248 .sp
240 .I "\\$1 249 .I "\\$1
241 .RT 250 .RT
242 .nr PP 0 251 .nr PP 0
243 .. 252 ..
244 253
254 . \" P - Paragraph (indented unless following a heading)
245 .de P 255 .de P
246 .ie \\n(PP .PP 256 .ie \\n(PP .PP
247 .el .LP 257 .el .LP
248 .nr PP 1 258 .nr PP 1
249 .. 259 ..
250 260
261 . \" IP - Paragraph with hanging label
251 .am IP 262 .am IP
252 .nr PP 0 263 .nr PP 0
253 .. 264 ..
254 265
266 . \" BU - Bulleted paragraph
255 .de BU 267 .de BU
256 .IP \(bu 268 .IP \(bu
257 .. 269 ..
258 270
271 . \" QP - Block quote paragraph
259 .am QP 272 .am QP
260 .ps -1 273 .ps -1
261 .. 274 ..
262 275
276 . \" DS - Code display
263 .am DS 277 .am DS
264 .ft CW 278 .ft CW
265 .ps -1 279 .ps -1
266 .ta T 8n 280 .ta T 8n
267 .. 281 ..
268 282
283 . \" FA - XXX somehow related to footnotes?
269 .am FA 284 .am FA
270 .ps 8 285 .ps 8
271 .vs 9 286 .vs 9
272 .. 287 ..
273 288
295 .. 310 ..
296 .de Pe \" profile entry 311 .de Pe \" profile entry
297 .CW "\\$1" "\\$2 312 .CW "\\$1" "\\$2
298 .. 313 ..
299 314
300 .de Ci \" commit ref 315 .de Ci \" commit hash ref
301 .ds _t \\$1 316 .ds _t \\$1
302 .substring _t 0 6 317 .substring _t 0 6
303 [\(rh 318 [\(rh
304 .CW "\\*(_t" "]\\$2 319 .CW "\\*(_t" "]\\$2
305 .. 320 ..