source: trunk/minix/man/man1/cawf.1@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 18.6 KB
Line 
1.\" manual page for cawf(1)
2.\"
3.\"
4.\" Copyright (c) 1991 Purdue University Research Foundation,
5.\" West Lafayette, Indiana 47907. All rights reserved.
6.\"
7.\" Written by Victor A. Abell <abe@cc.purdue.edu>, Purdue
8.\" University Computing Center. Not derived from licensed software;
9.\" derived from awf(1) by Henry Spencer of the University of Toronto.
10.\"
11.\" Permission is granted to anyone to use this software for any
12.\" purpose on any computer system, and to alter it and redistribute
13.\" it freely, subject to the following restrictions:
14.\"
15.\" 1. The author is not responsible for any consequences of use of
16.\" this software, even if they arise from flaws in it.
17.\"
18.\" 2. The origin of this software must not be misrepresented, either
19.\" by explicit claim or by omission. Credits must appear in the
20.\" documentation.
21.\"
22.\" 3. Altered versions must be plainly marked as such, and must not
23.\" be misrepresented as being the original software. Credits must
24.\" appear in the documentation.
25.\"
26.\" 4. This notice may not be removed or altered.
27.\"
28.\" Some of the stuff in this file is a bit contorted, because it's also
29.\" the regression-test input.
30.nr ES 5n
31.de ES
32.PP
33.in +\\n(ESu
34.nf
35..
36.de EE
37.in -\\n(ESu
38.fi
39.PP
40..
41.de PT
42.ie \\n(.$>1 .TP "\\$2"
43.el .TP
44.ie !'\\$1'' \\$1
45.el \(bu
46..
47.ds Nr \fInroff\fR
48.TH CAWF 1 "November, 1992"
49.BY "Purdue University"
50.SH NAME
51cawf, nroff \- C version of the nroff-like, Amazingly Workable (text) Formatter
52.SH SYNOPSIS
53.B cawf
54.RB [ \-c\c
55.IR config ]
56.RB [ \-d\c
57.IR device ]
58.RB [ \-e ]
59.RB [ \-f\c
60.IR font ]
61.RB [ \-h ]
62.RB [ \-m\c
63.IR acros ]
64.RI [ file " ...]"
65.SH DESCRIPTION
66.I Cawf
67formats the text from the input \fIfile\fR(s)
68(standard input if none)
69in an approximation of \*(Nr.
70It comes closest to duplicating \*(Nr's
71.B man
72or
73.B ms
74macro package styles.
75It has some limited support for \*(Nr's
76.B me
77macros.
78.SH OPTIONS
79Options must precede file names.
80.TP
81.BI \-c config
82defines an alternate path to the device configuration file.
83Normally the device configuration file is found in
84.I device.cf
85in the
86.I cawf
87library (see the
88.B FILES
89section).
90.IP
91The device configuration file contains device character strings for
92selecting fonts and the bold or italic type faces.
93See the
94.B DEVICES
95section for more information.
96.TP
97.BI \-d device
98specifies the name of the output device.
99There are three built\-in devices \- ANSI, NONE and NORMAL \- and
100other devices may be defined in the device configuration file.
101See the
102.B DEVICES
103section for more information.
104.IP
105The NORMAL device is the default.
106.TP
107.B \-e
108directs
109.I cawf
110to issue an eject (FF or ^L) after the last page.
111.TP
112.BI \-f font
113specifies the one font for the device, declared with the
114.BI \-d device
115option, that is to be used for the
116entire document.
117.I Font
118must match a font associated with the device's stanza in the device
119configuration file.
120See the
121.B DEVICES
122section for more information.
123.IP
124No
125.I font
126may be specified for the built\-in devices ANSI, NONE or NORMAL.
127.TP
128.B \-h
129requests a help display.
130.TP
131.BI \-m acro
132specifies the macro file to be used.
133The standard
134.I cawf
135distribution supplies macro files to support ``\-man'', ``\-me'' or ``\-ms''.
136.I Cawf
137finds a macro file by constructing its name from `m',
138.I acro
139and
140.B .mac
141\- e. g.,
142.BI \-m an
143is converted to
144.BR man.mac .
145The default directory for macro files is defined when
146.I cawf
147is compiled; it's \fIC:\\SYS\\LIB\\CAWF\fP in the MS\-DOS environment;
148.I /usr/lib/cawf
149in the UNIX environment.
150.TP
151file ...
152are the names of files containing \*(Nr source text.
153.SH NROFF COMPATIBILITY
154.I Cawf
155accepts the following raw \*(Nr requests:
156.ES
157\&.\e" .ad .bp .br .ce .de .di .ds
158\&.el .fi .fl .ft .i0 .ie .if .in
159\&.it .lg .li .ll .ls .na .ne .nf
160\&.nr .ns .pl .po .ps .rm .rn .rr
161\&.rs .so .sp .ta .ti .tm .tr
162.EE
163and the following in-text codes:
164.ES
165\e$ \e% \e* \e" \ec \ef \eh \ek
166\en \es \ew
167.EE
168plus the full list of \*(Nr/\c
169.I troff
170special characters in
171the original V7 \fItroff\fR manual.
172.PP
173Many restrictions are present; the behavior in general is a subset of
174\*(Nr's. Of particular note are the following:
175.IP \(bu 2
176The fully supported nroff request control character is the period.
177There is limited support for the non\-break, acute accent control
178character.
179.PT
180Point sizes do not exist;
181.B .ps
182is ignored.
183.PT
184Special vertical spacing \- the
185.B .vs
186request included \- is ignored.
187.PT
188Conditionals cover only the numeric comparisons >, =, <, >= and <= on
189.BR \en(.$ ;
190string com\%par\%isons between a macro parameter and a literal;
191.B n
192(always true);
193and
194.BR t
195(always false).
196Only single line input is accepted from conditionals;
197multi\-line input \- e.g., \\(\fIanything\fP\\) \- is not supported.
198.PT
199The handling of strings is generally primitive.
200.IP \(bu
201Horizontal motion via
202.B \eh
203must be supplied with a number register interpolation and must be
204positive - e. g.,
205.BR \ew\en(NN ,
206where the value in NN is >= 0.
207.IP \(bu
208The
209.B \ek
210function is reliable only after TAB characters, so it is useful only
211for measuring table positions.
212.IP \(bu
213The
214.B .di
215request only turns output on and off \- any macro name is ignored.
216.IP \(bu
217Expressions - e. g.,
218.B .sp
219- are reasonably general, but the
220.BR | ,
221.BR & ,
222and
223.BR :\&
224operators do not exist, there must be white space between the end of the \*(Nr
225function and the beginning of the expression, and
226.B \ew
227requires that quote (') be used as the delimiters.
228.B \ew
229counts the characters inside the quotes and scales the result in ens,
230so that, for example, \ew'\e(bu' equals 4n, and \ew'\e(bu'/1n equals 4.
231.PT
232The only acceptable count for the
233.B .it
234request is one,
235and it is effective only with
236.BR man ,
237.B me
238or
239.B ms
240macros.
241.PT
242The default scaling factor is `v' for the
243.BR .ne ,
244.BR .sp ,
245and
246.B .pl
247raw \*(Nr requests; it is `u' for
248.BR .nr ;
249and `n' for
250.BR .in ,
251.BR .ll ,
252.BR .ls ,
253.BR .po ,
254.BR .ta
255and
256.BR .ti .
257(A different scaling factor may be specified with a trailing character.)
258.PT
259Some obsolete or meaningless requests \-
260.BR .i0 ,
261.B .lg
262and
263.B .li
264\&\- are silently ignored.
265.P
266White space at the beginning of lines,
267and embedded white space within lines is dealt with properly.
268Sentence terminators at ends of lines are understood to imply
269extra space afterward in filled lines.
270Tabs are im\%plemented crudely and not exactly, although
271usually they work as expected.
272Hyphenation is done only at explicit hyphens, em-dashes, and \*(Nr
273discretionary hyphens.
274By default bold and italic characters are emulated with backspacing and
275overprinting, but the
276.B \-d
277and
278.B \-f
279options, combined with the contents of the device configuration file,
280may be used to generate special codes for bold and italic characters.
281(See the
282.B DEVICES
283section for more information.)
284.SH "MAN MACROS"
285The
286.B man
287macro set replicates the full V7 manual macros,
288plus a few semi-random oddballs.
289The full list is:
290.ES
291\&.AT .B .BI .BR .BY .DE .DT .HP
292\&.I .IB .IP .IR .IX .LP .NB .P
293\&.PD .PP .RB .RE .RI .RS .SH .SM
294\&.SS .TH .TP .UC
295.EE
296.B .BY
297and
298.B .NB
299each take a single string argument (respectively, an indi\%cation of
300authorship and a note about the status of the manual page) and arrange
301to place it in the page footer.
302.B .AT
303and
304.B .IX
305do nothing.
306.SH "ME MACROS"
307The
308.B me
309macro subset has been derived from the
310.I cawf
311.B ms
312macros by Chet Creider <creider@csd.uwo.ca>.
313It includes:
314.ES
315\&.(l .(q .)l .)q .b .bu .i .ip
316\&.lp .np .pp .r .sh .sm .u .uh
317.EE
318The .(l C and .(l L options are supported.
319In addition, the .AB, .AE, .AI, .AU, .DA, .ND, .TL and .UX macros have
320been retained from the
321.B ms
322set, and the .XP macro has been borrowed from the Berkeley additions to the
323.B ms
324macro set.
325.SH "MS MACROS"
326The
327.B ms
328macro set is a substantial subset of the V7 manuscript macros.
329The macros are:
330.ES
331\&.AB .AE .AI .AU .B .CD .DA .DE
332\&.DS .I .ID .IP .LD .LG .LP .ND
333\&.NH .NL .PP .QE .QP .QS .R .RE
334\&.RP .RS .SH .SM .TL .TP .UL .UX
335.EE
336Size changes are recognized but ignored, as are
337.B .RP
338and
339.BR .ND .
340.B .UL
341just prints its argument in italics.
342.BR .DS / .DE
343does not do a keep,
344nor do any of the other macros that normally imply keeps.
345.LP
346The
347.B DY
348string variable is available.
349The
350.BR PD ,
351.BR PI ,
352and
353.BR LL
354number registers exist and can be changed.
355.SH "HEADERS AND FOOTERS"
356.I Cawf
357allows the placement of text into the five line header and
358footer sections from the
359.BR LH ,
360.BR CH ,
361.BR RF ,
362.BR LF ,
363.BR CF ,
364and
365.B RF
366string variables, via the control of the
367.B .^b
368request:
369.LP
370.ta \w'.^b HF 0'u+3n
371.nf
372\&.^b fh 1 enables header string placement on the first page
373\&.^b fh 0 disables header string placement on the first page
374\&.^b HF 1 enables header/footer string placement
375\&.^b HF 0 disables header/footer string placement
376.fi
377.LP
378There are appropriate
379.B .^b
380requests in the distribution
381.BR man ,
382.B me
383and
384.B ms
385macro files.
386(The
387.B me
388and
389.B ms
390macro files use another
391.B .^b
392request, \fB.^b NH\fP, to enable numbered header processing.)
393.SH OUTPUT
394The default output format supported by
395.IR cawf ,
396in its distributed form,
397is that appropriate to a dumb terminal,
398using overprinting for italics (via underlining) and bold.
399The \*(Nr special characters are printed as some vague approximation
400(it's sometimes extremely vague) to their correct appearance.
401.PP
402One part of
403.IR cawf 's
404knowledge of the output device, related to the formation of characters,
405is established by a device file, which is read before the user's input.
406The search for it begins in
407.IR cawf 's
408library directory, under the name \fIterm\fP.\fBdev\fP
409(where \fIterm\fR is the value of the TERM environment variable).
410Failing to find that,
411.I cawf
412searches for
413.BR dumb.dev .
414(See the
415.B FILES
416section for a description of the path to
417.IR cawf 's
418library directory.)
419The device file
420uses special internal requests
421to set up resolution, special characters
422and more normal \*(Nr functions to set up page length, etc.
423.PP
424.I Cawf
425has limited support for fonts special forms of bold and italic characters.
426It is provided through the
427.B \-c
428.IR config ,
429.BI \-d device
430and
431.BI \-f font
432options.
433See the
434.B DEVICES
435section for more information.
436.PP
437Note the distinction between the device and the output device configuration
438files.
439The device file typically defines characters and constant output parameters.
440The output device configuration file defines font and type face codes.
441It is usually not necessary to define a separate device file for each
442device represented in the output device configuration file \- the
443.I dumb.dev
444device file will suffice for almost all representations.
445.SH DEVICES
446.I Cawf
447supports primitive output device configuration for font and type face
448control.
449One font may be selected for the entire document by directing
450.I cawf
451to issue a font selection control character string at the beginning
452of the document, and control character strings may be selected for
453switching between the bold, italic and Roman type faces.
454.PP
455The
456.B \-c
457.IR config,
458.BI \-d device
459and
460.BI \-f font
461options direct the font and type face selections.
462.PP
463The
464.BI \-d device
465option specifies the name of the device.
466.I Cawf
467has three built\-in devices \- ANSI, NONE and NORMAL.
468When the ANSI device is selected,
469.I cawf
470issues the ANSI shadow mode control codes, ``ESC [ 7 m'', to represent
471the bold face;
472the ANSI underscore control codes, ``ESC [ 4 m'', to represent the italic
473face;
474and the ANSI control codes, ``ESC [ 0 m'', to represent the ROMAN face.
475No
476.BI \-f font
477specification is permitted with the ANSI device.
478.PP
479When the NONE device is selected,
480.I cawf
481uses no special output codes to represent the type faces.
482No
483.BI \-f font
484specification is permitted with the ANSI device.
485.PP
486The NORMAL output device is the default.
487When it's selected,
488.I cawf
489overprints each bold character two times, using three issuances of each
490bold character, separated by backspace characters;
491it issues an underscore and backspace before each italic character.
492No
493.BI \-f font
494specification is permitted with the ANSI device.
495The
496.IR bsfilt (1)
497filter may be used to further process the backspace codes output for
498a NORMAL device.
499.PP
500All other devices named in the
501.BI \-d device
502option must be represented by a stanza in the device configuration file.
503The device configuration file is usually contained in
504.I device.cf
505in
506.IR cawf's
507library directory (see the
508.B FILES
509section for more information).
510An alternate device configuration file path may be specified with the
511.BI \-c config
512option.
513.PP
514The
515.B DEVICE CONFIGURATION FILE
516section describes the organization of the device configuration file.
517It is easy to add devices to the
518.I device.cf
519supplied in the
520.I cawf
521distribution.
522.PP
523The
524.BI \-f font
525option may be used with the
526.BI \-d device
527option, when the appropriate stanza in the device configuration file
528contains an entry for the named
529.IR font .
530The
531.B DEVICE CONFIGURATION FILE
532section describes how fonts are defined in device configuration file
533stanzas.
534.SH DEVICE CONFIGURATION FILE
535The device configuration file defines the special character codes
536necessary to direct output devices to select fonts and to produce
537bold, italic and Roman type faces.
538.PP
539The configuration file is usually found in
540.I device.cf
541in
542.IR cawf 's
543library directory (see the
544.B FILES
545section for more information).
546It is organized into two main parts \- comments and device stanzas.
547Comments are any lines that begin with the pound sign (`#') character.
548They are informational only and
549.I cawf
550ignores them.
551.I Cawf
552also ignores empty lines, so they may be used as vertical white space.
553.PP
554Stanzas name devices and define their font and type face control strings.
555A stanza begins with the name of the device, starting at the beginning
556of a line and occupying the entire line.
557The body of the stanza, defining fonts and type faces, is formed of
558lines beginning with white space (a TAB or space characters) that
559directly follow the device name.
560.PP
561Individual lines of the stanza body contain a key character, followed
562by a equal sign, followed by the font name (if a font key) and the
563output device control codes.
564.I Cawf
565issues the font control codes once, at the beginning of output, so
566only one font may be selected.
567The type face control codes are issued at each change of type face.
568.PP
569The key characters are:
570.ne 4
571.PP
572.RS
573.nf
574b for bold
575f for font definition
576i for italic
577r for Roman
578.fi
579.RE
580.PP
581The `b', `i' and `r' key codes are followed by an equal sign (`=') and
582their control code definition.
583The `f' key code is followed by an equal sign (`='), the font name,
584another equal sign and the font control code definition.
585.PP
586Control code definitions may contain any printable ASCII characters.
587Non\-printable characters may be encoded in octal notation with the `\\nnn'
588form or in hexadecimal with the `\\xnn' form.
589The special code, `\\E' (or `\\e') represents the ESC control
590character (\\033 or \\x1b).
591.PP
592Here's a sample showing the definition for the HP LaserJet III.
593The stanza name is ``lj3''.
594All its non\-printable characters are ESCs; the first is coded in
595octal form; the second with '\\E'; the rest, in hexadecimal form.
596TAB is used as the leading white space character for the stanza
597body lines.
598.PP
599.RS
600.nf
601# HP LaserJet III
602
603lj3
604 b=\\033(s7B
605 i=\\E(s1S
606 r=\\x1b(s0B\\x1b(s0S
607 f=c10=\x1b&l0O\x1b(8U\x1b(s0p12h10v0s0b3T
608 f=c12ibm=\x1b&l0O\x1b(10U\x1b(s0p10.00h12.0v0s0b3T
609 f=lg12=\x1b&l0O\x1b(8U\x1b(s12h12v0s0b6T
610.fi
611.RE
612.PP
613The distribution
614.I device.cf
615file defines the following devices and fonts.
616.LP
617.ta \w'kxp1180'u+3n +\w'Italic:'u+3n +\w'bps10'u+6n
618.nf
619.ne 3
620epson dot matrix printer in Epson FX-86e/FX-800 mode
621 Bold: Double-strike
622 Fonts: none
623
624.ne 4
625ibmppds IBM Personal Printer Data Stream (PPDS) protocol
626 Bold: Double-strike
627 Italic: Underline
628 Fonts: none
629
630.ne 12
631kxp1124 Panasonic KX\-P1124 dot matrix printer in PGM mode
632 Bold: Emphasized
633 Fonts: c10 10 Characters Per Inch (CPI) Courier
634 c12 12 CPI Courier
635 bps10 10 CPI Bold PS
636 bps12 12 CPI Bold PS
637 p10 10 CPI Prestige
638 p12 12 CPI Prestige
639 s10 10 CPI Script
640 s12 12 CPI Script
641 ss10 10 CPI Sans Serif
642 ss12 12 CPI Sans Serif
643
644.ne 10
645kxp1180 Panasonic KX\-P1180 dot matrix printer in PGM mode
646 Bold: Emphasized
647 Fonts: c10 10 Characters Per Inch (CPI) Courier
648 c12 12 CPI Courier
649 bps10 10 CPI Bold PS
650 bps12 12 CPI Bold PS
651 p10 10 CPI Prestige
652 p12 12 CPI Prestige
653 ss10 10 CPI Sans Serif
654 ss12 12 CPI Sans Serif
655
656.ne 6
657lj3 HP LaserJet III
658 Fonts: c10 10 point, 12 Characters Per Inch (CPI)
659 Courier
660 c12ibm 12 point, 10 CPI Courier, IBM\-PC
661 Symbol Set
662 lg12 12 point, 12 CPI Letter Gothic
663
664.ne 4
665vgamono VGA monochrome monitor for MS\-DOS
666 (ANSI.SYS driver required for MS\-DOS)
667 Italic: Reverse-video
668 Fonts: none
669.SH FILES
670.I Cawf
671resource files are located in the
672.I cawf
673library directory \- \fI C:\\SYS\\LIB\\CAWF\fP, the MS\-DOS environment
674default;
675or
676.IR /usr/lib/cawf ,
677the UNIX environment default.
678These defaults can be overridden by the CAWFLIB environment variable,
679or changed in the cawflib.h header file.
680
681.ta \w'device.cf'u+3n
682.nf
683common common device-independent initialization
684device.cf output device configurations
685*.dev device-specific initialization
686m*.mac macro package files
687.SH DIAGNOSTICS
688Unlike
689.IR nroff ,
690.I cawf
691complains whenever it sees unknown requests.
692All diagnostics appear on the standard error file.
693.ad
694.SH HISTORY
695Vic Abell of Purdue University <abe@cc.purdue.edu> derived
696.I cawf
697from
698.IR awf ,
699\&``the Amazingly Workable (text) Formatter,''
700written by Henry Spencer of the University of Toronto.
701The Toronto work was a supplement to the C News project.
702The Purdue effort was aimed at producing a C language version that
703would run on small systems, particularly MS\-DOS ones.
704The adaptation of the
705.B me
706macros was done by Chet Creider <creider@csd.uwo.ca>.
707Chet also contributed ideas for device, font and type face support.
708.PP
709The MS\-DOS version of
710.I cawf
711has been compiled with version 2.5 of Microsoft's Quick-C compiler.
712It runs under the Mortis Kern Systems Toolkit KornShell,
713.IR ksh (1),
714and COMMAND.COM.
715.SH BUGS
716Nroff and troff mavens will have many complaints.
717Some may even represent bugs and not deliberate omissions.
718.PP
719Watch out for scaling factors - especially on requests like
720.BR \ew .
721.PP
722The overprinting required to create bold and italicized characters is
723tiresome on a slow printer.
724The
725.IR bsfilt (1)
726post\-filter from this distribution may be used to alleviate that
727nuisance by managing the backspacing codes from
728.IR cawf 's
729NORMAL device output.
730.PP
731The printing of bold and italic characters is sometimes better handled by
732special printer codes.
733Use
734.IR cawf 's
735.B \-c
736.IR config ,
737.BI \-d device
738and
739.BI \-f font
740options to produce special font and device output control codes.
741.PP
742.I Cawf
743has a small amount of built-in code for the
744.BR man ,
745.B me
746and
747.B ms
748macro packages, but none for any others.
749.PP
750The stacking for the
751.B .so
752request is limited.
753.SH SEE ALSO
754bsfilt(1),
755colcrt(1),
756man(7),
757me(7),
758ms(7)
759and
760nroff(1).
Note: See TracBrowser for help on using the repository browser.