Debian Codegraph @

doc/sbase/dist/birddoc/groff/mapping

raw
1 % linuxdoc replacement file
2 % translates into nroff, using ms macros
3 % manpages can be processed using the man macros
4 % does not use neqn for math.
5
6 % Based on qwertz replacement file by Tom Gordon
7 % linuxdoc mods by mdw
8
9 % Groff dependencies are few. To port to another roff:
10 % 1. Check and modify, if necessary, font changes. (e.g. In psroff the
11 % same fonts have other names.)
12 % 2. Check the code for including Encapsulated PostScript, generated
13 % for eps elements.
14 % 3. Also make versions of general.grops and math.grops, which are sed
15 % scripts translating character entities into groff character references.
16
17
18 <birddoc> + ".nr PS 11\n"
19
20 % Hacked by mdw
21 ".nr PI 3n\n"
22 ".ds CF \\\\n\%\n"
23 ".ds CH \\&\n"
24 ".ds dR $\n" % dollar, to avoid EQN conflicts
25
26 % Start with no TOC
27 ".ds printtoc\n"
28
29 % Footnote style
30 ".nr FF 1\n"
31
32 % James Clark's trick to prevent unintended paragraph
33 % breaks
34
35 ".tr \\&\n"
36
37 % horizontal line
38 ".de hl\n"
39 ".br\n"
40 "\\l'\\\\n(.lu-\\\\n(.iu'\n"
41 "..\n"
42
43 % paragraph spacing
44 ".if n .nr PD 1v\n"
45
46 % margins added by mdw
47 ".nr PO 0.25i\n"
48 ".po 0.25i\n"
49 ".nr LL 7.0i\n"
50 ".nr TL 7.0i\n"
51 ".nr HM 0i\n"
52 ".nr FM 0i\n"
53
54 % Turn off right-margin filling
55 ".na\n"
56
57 % h is 1 if first paragraph after heading
58
59 ".nr h 0\n"
60
61 % initialize heading level
62
63 ".nr il 1\n"
64
65 % Number registers for list
66
67 ".nr bi 0\n" % initialize begin items
68 ".nr ll 0\n" % list level, stores current level
69 ".nr el 0\n" % current enumeration level
70
71 % Not all list levels are enumerations, as
72 % itemizations can be embedded within enumerations
73 % and vice versa
74
75 % type of list level is in \n(t\n(ll, where
76 % 0 : itemize, 1 : enumerate, 2: description
77
78 % enumerator for an enumeration level is in
79 % \n(e\n(el -- i.e. \n(e1=2 means current item of
80 % enumeration level 1 is 2
81
82 % context-sensitive paragraph macro
83
84 % Bug: There's some problem using this to re-start paragraphs after the
85 % </verb> and </code>, so after verb and code I insert .LP. That's fine
86 % except that is loses indentation when using verb or code inside of a list.
87
88 ".de Pp\n"
89 ".ie \\\\n(ll>0 \\{\\\n" % within list?
90 ".ie \\\\n(bi=1 \\{\\\n" % first par element of item?
91 ".nr bi 0\n" % reset bi flag
92 % if itemization, mark with a bullet
93 ".if \\\\n(t\\\\n(ll=0 \\{.IP \\\\(bu\\}\n" % itemize
94 % if enumeration: increment and print enumerator
95 % for this enumeration level
96 ".if \\\\n(t\\\\n(ll=1 \\{.IP \\\\n+(e\\\\n(el.\\}\n"
97 % if first par element of descrip, do nothing
98 ".\\}\n"
99 ".el .sp \n" % subsequent par element of item
100 ".\\}\n"
101 ".el \\{\\\n" % not within list
102 ".ie \\\\nh=1 \\{\\\n" % first par after heading
103 ".LP\n"
104 ".nr h 0\n" % reset h flag
105 ".\\}\n"
106 ".el .LP \n" % Changed from .PP, mdw
107 ".\\}\n"
108 ".nh\n"
109 "..\n"
110
111
112
113 % for each level, a number register is created
114 % to store its type and current item number, where
115 % -1=bullet of an itemized list.
116
117 % Format of list level enumerators
118
119 ".ds f1 1\n"
120 ".ds f2 a\n"
121 ".ds f3 i\n"
122 ".ds f4 A\n"
123
124 % Number registers for theorems
125 ".nr def 0\n"
126 ".nr prop 0\n"
127 ".nr lemma 0\n"
128 ".nr coroll 0\n"
129 ".nr proof 0\n"
130 ".nr theorem 0\n"
131
132 % Reference commands
133
134 % redefine superscript strings so that refer tags look like [this]
135
136 ".ds \[. \[\n"
137 ".ds .\] \]\n"
138
139 </birddoc>
140
141 % set initial level of headings, in register il
142
143 <article> + ".nr il 0" +
144 </article> + ".if '\\*[printtoc]'true' .PX\n"
145
146 <report> + ".nr il 1" +
147 </report> + ".bp\n"
148 ".rm LH\n.rm RH\n"
149 ".TC" +
150
151 <book> + ".nr il 1" +
152 </book> + ".rm LH\n.rm RH\n"
153 ".bp\n"
154 ".TC" +
155
156 <notes>
157 </notes>
158
159 <manpage> + ".nr il -1" +
160 </manpage>
161
162 <progdoc>
163 </progdoc>
164
165 % Hacked up titlepag stuff to look more reasonable. Titles and author
166 % names are now stored in strings, printed by the end of </titlepag>.
167 % Wake up! This uses groff-like long string names. You must use groff
168 % to format this.
169
170 <titlepag> + ".ds mdwtitle\n"
171 ".ds mdwsubtitle\n"
172 ".ds mdwdate\n"
173 ".de printabstract\n"
174 "..\n" +
175 </titlepag> + "\\*[mdwtitle]\n"
176 ".br\n"
177 ".if !'\\*[mdwsubtitle]'' \\*[mdwsubtitle]\n"
178 ".br\n"
179 ".printauthor\n"
180 ".br\n"
181 "\\*[mdwdate]\n"
182 ".br\n"
183 ".printabstract\n"
184 ".br\n"
185
186 %<title> + ".TL" +
187 %</title>
188
189 <title> + ".ds mdwtitle "
190 </title> +
191
192 %<subtitle> + ".br\n"
193 % ".ft R\n"
194 % ".SM" +
195 %</subtitle> + ".LG" +
196
197 <subtitle> + ".ds mdwsubtitle "
198 </subtitle> +
199
200 <date> + ".ds mdwdate "
201 </date> +
202
203 <documentid>
204 </documentid>
205
206 <abstract> + ".de printabstract\n"
207 ".LP\n"
208 </abstract> + ".." +
209
210 % author needs to be set up as its own macro, fired off from .printtitle.
211
212 <author> + ".de printauthor" +
213 </author> + ".." +
214
215 %<name> + ".AU" +
216 %</name>
217
218 <name> + ".br" +
219 </name>
220
221 <and>
222 </and>
223
224 <thanks> "\\**\n"
225 ".FS" +
226 </thanks> + ".FE" +
227
228 <inst> + ".br" +
229 </inst>
230
231 %<newline> + ".br" +
232 <newline> + ".br"
233 </newline>
234
235 <label>
236 </label>
237
238 <header>
239 </header>
240
241 <lhead> + ".EH '"
242 </lhead> "'''" +
243
244 <rhead> + ".OH '''"
245 </rhead> "'" +
246
247 <comment> + "(*" +
248 </comment> + "*)" +
249
250 % New abstract given above --mdw
251 %<abstract> + ".AB" +
252 %</abstract> + ".AE" +
253
254 <appendix> + ".af H1 A" +
255 </appendix>
256
257 % limitation: no list of figures or tables. A table of contents
258 % is always generated for books and reports. Thus these next three tags
259 % are no-ops
260
261 % For now, no table-of-contents in ASCII output. (Uncomment this if
262 % desired).
263 %<toc> + ".ds printtoc true"
264 %</toc>
265
266 <toc>
267 </toc>
268
269 <lof>
270 </lof>
271
272 <lot>
273 </lot>
274
275 <chapt> + ".bp\n"
276 ".NH \\n(il " +
277 </chapt>
278
279 <sect> + ".NH 1+\\n(il" +
280 </sect>
281
282 <sect1> + ".NH 2+\\n(il" +
283 </sect1>
284
285 <sect2> + ".NH 3+\\n(il" +
286 </sect2>
287
288 <sect3> + ".NH 4+\\n(il" +
289 </sect3>
290
291 <sect4> + ".NH 5+\\n(il" +
292 </sect4>
293
294 <heading> ".ds h "
295 </heading> + "\\*h\n"
296 ".XS \\n%\n"
297 "\\*(SN \\*h\n"
298 ".XE\n"
299 ".nr h 1\n" % set heading flag to true
300
301 <p> + ".Pp" +
302 </p>
303
304 <itemize> + ".nr ll +1\n" % increment list level
305 ".nr t\\n(ll 0\n" % set type of level to itemize
306 </itemize> + ".nr ll -1\n" % decrement list level
307
308 <enum> + ".nr ll +1\n" % increment list level
309 ".nr el +1\n" % increment enumeration level
310 ".nr t\\n(ll 1\n" % set type of level to enum
311 ".nr e\\n(el 0 1\n" % initialize enumerator
312 ".af e\\n(el \\*(f\\n(el\n" % style of enumerator
313 ".if \\n(ll>1 .RS" +
314 </enum> + ".if \\n(ll>1 .RE\n"
315 ".br\n"
316 ".nr el -1\n" % decrement enumeration level
317 ".nr ll -1\n" % decrement list level
318
319 <descrip> + ".RS\n"
320 ".nr ll +1\n" % increment list level
321 ".nr t\\n(ll 2\n" % set type of level to descrip
322 </descrip> + ".nr ll -1\n" % decrement list level
323 ".RE" +
324
325 % number register bi means "begin item". Used in the .P macro to print
326 % bullets or numbers at beginning of first paragraph of an item.
327 % If bi=1 then the paragraph is the first one of the item.
328
329 <item> + ".nr bi 1\n.Pp" +
330 </item>
331
332 <tag> + ".IP \"\\fB"
333 </tag> "\\fR\"\n"
334 ".nr bi 1" +
335
336 <m> ""
337 </m> ""
338
339 <cf> ""
340 </cf> ""
341
342 <cite> + ".\[\n[ID]\n.\]" +
343 </cite>
344
345 <ncite> + ".\[\n[ID]\n.\]\n([NOTE])"
346 </ncite>
347
348 <footnote> " (-- "
349 </footnote> "--)" +
350
351 <sq> "\\*Q"
352 </sq> "\\*U"
353
354 <lq> + ".RS\n"
355 ".nr LL \\n(LL-\\n(PI" +
356 </lq> + ".nr LL \\n(LL+\\n(PI\n"
357 ".RE" +
358
359 <em> "\\fI"
360 </em> "\\fP"
361
362 <bf> "\\fB"
363 </bf> "\\fR"
364
365 <it> "\\fI"
366 </it> "\\fR"
367
368 <sf> "\\fR"
369 </sf> "\\fR"
370
371 <sl> "\\fI"
372 </sl> "\\fR"
373
374 % Changed by mdw
375 <tt> "\\fC"
376 </tt> "\\fR"
377
378 % Added by mdw
379 <cparam> "\\fI<"
380 </cparam> ">\\fR"
381
382 <url> "[NAME] <\\fC[URL]\\fR>"
383 </url>
384
385 <htmlurl> "[NAME]"
386 </htmlurl>
387
388 <ref> "``[NAME]''"
389 </ref>
390
391 <nidx> + "\\#"
392 </nidx> "\\n"
393
394 <ncdx> + "\\#"
395 </ncdx> "\\n"
396
397 <pageref> "??"
398 </pageref>
399
400 <x>
401 </x>
402
403 <mc>
404 </mc>
405
406 <biblio> + ".\[\n"
407 "$LIST$\n"
408 ".\]" +
409 </biblio>
410
411 <code> + ".DS L\n"
412 ".hl\n"
413 ".ft R\n" +
414
415 </code> + ".hl\n"
416 ".DE\n"
417 ".ft P\n"
418 % ".Pp" + % continue previous paragraph (changed mdw)
419 ".LP"
420
421 <verb> + ".DS L\n"
422 ".ft R\n" +
423
424 </verb> + ".DE\n"
425 ".ft P\n"
426 % ".Pp" + % continue previous paragraph (changed mdw)
427 ".LP"
428
429 % tscreen added by mdw
430 <tscreen> + ".br\n"
431 ".po 0.75i\n"
432 ".ll 6.0i\n"
433 ".ft C\n"
434 ".LP\n" % Used to be Pp
435 </tscreen> + ".br\n"
436 ".po 0.25i\n"
437 ".ll 7.0i\n"
438 ".ft R\n" % This might not be correct
439 ".LP\n" % Used to be Pp
440
441 <quote> + ".br\n"
442 ".po 0.75i\n"
443 ".ll 6.0i\n"
444 ".nr LL 6.0i\n"
445 ".LP\n" % Used to be Pp
446 </quote> + ".br\n"
447 ".po 0.25i\n"
448 ".ll 7.0i\n"
449 ".nr LL 7.0i\n"
450 ".LP\n" % Used to be Pp
451
452
453
454
455 % theorems and such
456
457 <def> + ".sp\n"
458 ".nr def \\n\[def\]+1\n"
459 ".B \"Definition \\n\[def\] \"" +
460 </def> + ".ft P\n.sp" +
461
462 <prop> + ".sp\n"
463 ".nr prop \\n\[prop\]+1\n"
464 ".B \"Proposition \\n\[prop\] \"" +
465 </prop> + ".ft P\n.sp" +
466
467
468 <lemma> + ".sp\n"
469 ".nr lemma \\n\[lemma\]+1\n"
470 ".B \"Lemma \\n\[lemma\] \"" +
471 </lemma> + ".ft P\n.sp" +
472
473 <coroll> + ".sp\n"
474 ".nr coroll \\n\[coroll\]+1\n"
475 ".B \"Corolloary \\n\[coroll\] \"" +
476 </coroll> + ".ft P\n.sp" +
477
478 <proof> + ".sp\n"
479 ".nr proof \\n\[proof\]+1\n"
480 ".B \"Proof \\n\[proof\] \"" +
481 </proof> + ".ft P\n.sp" +
482
483 <theorem> + ".sp\n"
484 ".nr theorem \\n\[theorem\]+1\n"
485 ".B \"Theorem \\n\[theorem\] \"" +
486 </theorem> + ".ft P\n.sp" +
487
488 <thtag> + ".B\n("
489 </thtag> ")\n.I" +
490
491 % mathematics -- this nroff version needs work.
492
493 <f>
494 </f>
495
496 <dm> + ".DS L" +
497 </dm> + ".DE" +
498
499 <eq> + ".DS L" +
500 </eq> + ".DE" +
501
502 <fr>
503 </fr>
504
505 <nu> "{"
506 </nu> "} over "
507
508 <de> "{"
509 </de> "}"
510
511 <lim>
512 </lim>
513
514 <op>
515 </op>
516
517 <ll> " from {"
518 </ll> "}"
519
520 <ul> " to {"
521 </ul> "}"
522
523 <opd>
524 </opd>
525
526 <pr> " prod "
527 </pr>
528
529 <in> " int "
530 </in>
531
532 <sum> " sum "
533 </sum>
534
535 % limitation: eqn only does square roots!
536
537 <root> " sqrt {"
538 </root> "}"
539
540 <ar> + ".TS\n"
541 "center, tab(|) ;\n"
542 "[ca]." +
543 </ar> + ".TE" +
544
545 <arr> "\n"
546 </arr>
547
548 <arc> "|"
549 </arc>
550
551
552 <sup> " sup {"
553 </sup> "}"
554
555 <inf> " sub {"
556 </inf> "}"
557
558
559 <unl> "{"
560 </unl> "} under "
561
562 <ovl> "{"
563 </ovl> "} bar "
564
565 <rf> " bold{"
566 </rf> "}"
567
568 <v> "{"
569 </v> "} vec "
570
571 % limitation: no calligraphic characters, using helvetica italics instead. Is there a better font?
572
573 <fi> "\\fI"
574 </fi> "\\fP"
575
576 <phr> " roman }"
577 </phr> "}"
578
579
580 <tu> + ".br" +
581 </tu>
582
583 % figures
584
585 <figure> % + ".KF" +
586 </figure> % + ".KE" +
587
588 <eps> + ".if t .PSPIC [file].ps\n"
589 ".if n .sp 4" +
590 </eps>
591
592 % Are TeX units properly handled by this translation of ph?
593
594 <ph> + ".sp [VSPACE]" +
595 </ph>
596
597 <caption> + ".sp\n.ce" +
598 </caption>
599
600 % tables
601
602 <table> + ".KF\n.R" +
603 </table> + ".KE" +
604
605 <tabular> + ".TS\n"
606 "center, tab(|) ; \n"
607 "[ca]." +
608 </tabular> + ".TE" +
609
610 <rowsep> "\n" +
611 </rowsep>
612
613 <colsep> "|"
614 </colsep>
615
616 %<hline> + "_" +
617 % gregh
618 <hline> + ".hl\n" +
619
620 </hline>
621
622 <slides> + ".nr PS 18" +
623 </slides>
624
625 <slide>
626 </slide> + ".bp\n\\&" +
627
628 % letters -- replacement for email, using mh format.
629
630 <letter> + ".nf" +
631 </letter> +
632
633 <from> + "From: "
634 <to> + "To: "
635
636 <address> + ".de Ad\n"
637 </address> + ".." +
638
639 <email> " <"
640 </email> ">"
641
642 <subject> + "Subject: "
643
644 <sref> + "Sref: "
645 <rref> + "In-Reply-To: "
646
647 <cc> + "cc: "
648
649 <opening> + ".fi\n.LP" +
650
651 <closing> + ".LP" +
652
653 <encl> + ".XP\n"
654 "encl: "
655
656 <ps> + ".LP\np.s."
657
658
659 % end of roff replacement file