home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
FM25.ZIP
/
fm.tar
/
README.tex
< prev
next >
Wrap
Text File
|
1992-05-12
|
4KB
|
97 lines
% README file for "fm" program.
\raggedright\parskip=12pt\parindent=-4em
"Fm" formats text into paragraphs for tty screen
display. It is similar to UCB "fmt" and in fact can
mimic that program, but it is somewhat more flexible,
and it does English hyphenation (the routines and
data for hyphenation are taken from TeX). Even if
you don't care for "fm", if you write formatting
utilities, you might be interested in the hyphenation
routine in file hyphenate.c.
{\bf Installation.} You need flex to compile "fm". A
stock unix compiler ought to work, or gcc. Also,
you need termcap to use the Makefile as supplied.
(See the note in the Makefile if you're on sys5r3.)
As an alternative to using termcap, you can add
"-DANSI" to CFLAGS, which substitutes some built-in
routines for color display on a suitable ANSI-type
console. If you don't actually have an ANSI color
display device, you won't be able to use the "-u"
option of "fm".
{\bf Usage.} "fm" is a filter. Send it input on standard input,
or give on the command line a list of files with text to process. The
formatted result appears on the standard output. There
are a bunch of options, or the program can be called
by different names to vary the type of formatting done.
Screen attributes indicate different intended fonts, for
files with nroff -man or TeX formatting commands.
See below and the files fm.1, cmds.tex and the source
code for details.
\leftskip=4em\rightskip=4em
{\bf History \& acknowledgments.} The first version of this
program was written by Bill Gray (bgray@marque.mu.edu) and
appeared in comp.sources.misc, v02i102 (Apr.~1988) as
"fmt". A second version, called "xfmt" and modified by me was in
comp.sources.unix, v16i071 (Nov.~1988). My thanks to Ken Yap
(ken@cs.rochester.edu) and Dave Yearke, Sigma Systems Technology, Inc.
for fixes to some problems with that version.
\leftskip=0em\rightskip=0em
{\bf Summary of modes.} You can call "fm" by that name, or call it
"fmt" or "nroff" or "tex". Called by one of the first two
names, it understands no embedded formatting commands. Called
"fmt" it emulates the UCB program "fmt" and tries to preserve
indentation and spacing from the original input text. Called
"nroff", it interprets -man page formatting commands. Called
"tex", it interprets a small subset of TeX commands.
\noindent Instead of giving it different names, instead you can
use option flags to the same effect: "fm -b" is the same as giving
the program the name "fmt" (b is for Berkeley); "fm -jmo" is the
same as "nroff" (or "nroff -man"); "fm -jx" is the same as "tex".
With the name "tex", the suffix .tex is added to a file name
on the command name if a file by the name given is not found.
\noindent Aside from embedded formatting commands,
formatters differ in how to interpret natural features of
input text and what sort of formatting to do by default.
For instance, does blank space at the beginning of a line
start a new paragraph? Is the indentation carried over into
the formatted output? The chart below outlines "fm"s four
conventions about this.
\medskip{\obeylines\obeyspaces\leftskip=5em
fm fmt nroff tex
fm -b fm -jmo fm -jx
blank line starts par. yes yes yes yes
indent starts par. no* yes yes no*
keep paragraph indent no* yes no no*
add paragraph indent no no no yes(5)
keep word spacing no yes no no
keep blank lines yes yes yes no*
keep offset no yes no no
justification no no yes yes
hyphenation yes no yes yes
left offset no no yes(5) yes(4)
file suffix no no no yes(.tex)
Note: "no*" is "yes" with -i option.
\leftskip=0em}\medskip
{\bf What is it good for?} (1) Making narrow columns for feeding to
"pr"; e.g., "fm -40 -p2 textfile | pr -3 -w132 -l23 | more". (2) Displaying
man pages without a long wait or using disk space for preformatted
versions; e.g., "fm -jmo fm.1 | more" or (with program named "nroff")
"nroff -man fm.1 | more". (3) Format simple documents which may later
be printed using TeX; e.g., "fm -x README.tex >README" (which creates
this file). (4) Displaying C-code with reserved words highlighted;
e.g., "fm -C fm.l | more".
\bigskip
\rightline{-- Greg Lee}
\rightline{lee@uhunix.uhcc.Hawaii.edu}
\rightline{5/5/92}
\bye
The end.