home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / FM25.ZIP / fm.tar / README.tex < prev    next >
Text File  |  1992-05-12  |  4KB  |  97 lines

  1. % README file for "fm" program.
  2. \raggedright\parskip=12pt\parindent=-4em
  3. "Fm" formats text into paragraphs for tty screen
  4. display.  It is similar to UCB "fmt" and in fact can
  5. mimic that program, but it is somewhat more flexible,
  6. and it does English hyphenation (the routines and
  7. data for hyphenation are taken from TeX).  Even if
  8. you don't care for "fm", if you write formatting
  9. utilities, you might be interested in the hyphenation
  10. routine in file hyphenate.c.
  11.  
  12. {\bf Installation.}  You need flex to compile "fm".  A
  13. stock unix compiler ought to work, or gcc.  Also,
  14. you need termcap to use the Makefile as supplied.
  15. (See the note in the Makefile if you're on sys5r3.)
  16. As an alternative to using termcap, you can add
  17. "-DANSI" to CFLAGS, which substitutes some built-in
  18. routines for color display on a suitable ANSI-type
  19. console.  If you don't actually have an ANSI color
  20. display device, you won't be able to use the "-u"
  21. option of "fm".
  22.  
  23. {\bf Usage.}  "fm" is a filter.  Send it input on standard input,
  24. or give on the command line a list of files with text to process.  The
  25. formatted result appears on the standard output.  There
  26. are a bunch of options, or the program can be called
  27. by different names to vary the type of formatting done.
  28. Screen attributes indicate different intended fonts, for
  29. files with nroff -man or TeX formatting commands.
  30. See below and the files fm.1, cmds.tex and the source
  31. code for details.
  32.  
  33. \leftskip=4em\rightskip=4em
  34. {\bf History \& acknowledgments.}  The first version of this
  35. program was written by Bill Gray (bgray@marque.mu.edu) and
  36. appeared in comp.sources.misc, v02i102 (Apr.~1988) as
  37. "fmt".  A second version, called "xfmt" and modified by me was in
  38. comp.sources.unix, v16i071 (Nov.~1988).  My thanks to Ken Yap
  39. (ken@cs.rochester.edu) and Dave Yearke, Sigma Systems Technology, Inc.
  40. for fixes to some problems with that version.
  41. \leftskip=0em\rightskip=0em
  42.  
  43. {\bf Summary of modes.}  You can call "fm" by that name, or call it
  44. "fmt" or "nroff" or "tex".  Called by one of the first two
  45. names, it understands no embedded formatting commands.  Called
  46. "fmt" it emulates the UCB program "fmt" and tries to preserve
  47. indentation and spacing from the original input text.  Called
  48. "nroff", it interprets -man page formatting commands.  Called
  49. "tex", it interprets a small subset of TeX commands.
  50.  
  51. \noindent Instead of giving it different names, instead you can
  52. use option flags to the same effect: "fm -b" is the same as giving
  53. the program the name "fmt" (b is for Berkeley); "fm -jmo" is the
  54. same as "nroff" (or "nroff -man"); "fm -jx" is the same as "tex".
  55. With the name "tex", the suffix .tex is added to a file name
  56. on the command name if a file by the name given is not found.
  57.  
  58. \noindent  Aside from embedded formatting commands,
  59. formatters differ in how to interpret natural features of
  60. input text and what sort of formatting to do by default.
  61. For instance, does blank space at the beginning of a line
  62. start a new paragraph?  Is the indentation carried over into
  63. the formatted output?  The chart below outlines "fm"s four
  64. conventions about this.
  65.  
  66. \medskip{\obeylines\obeyspaces\leftskip=5em
  67.             fm    fmt    nroff    tex
  68.                 fm -b    fm -jmo    fm -jx
  69. blank line starts par.    yes    yes    yes    yes
  70. indent starts par.    no*    yes    yes    no*
  71. keep paragraph indent    no*    yes    no    no*
  72. add paragraph indent    no    no    no    yes(5)
  73. keep word spacing    no    yes    no    no
  74. keep blank lines    yes    yes    yes    no*
  75. keep offset        no    yes    no    no
  76. justification        no    no    yes    yes
  77. hyphenation        yes    no    yes    yes
  78. left offset        no    no    yes(5)    yes(4)
  79. file suffix        no    no    no    yes(.tex)
  80.     Note: "no*" is "yes" with -i option.
  81. \leftskip=0em}\medskip
  82.  
  83. {\bf What is it good for?}  (1) Making narrow columns for feeding to
  84. "pr"; e.g., "fm -40 -p2 textfile | pr -3 -w132 -l23 | more".  (2) Displaying
  85. man pages without a long wait or using disk space for preformatted
  86. versions; e.g., "fm -jmo fm.1 | more" or (with program named "nroff")
  87. "nroff -man fm.1 | more".  (3) Format simple documents which may later
  88. be printed using TeX; e.g., "fm -x README.tex >README" (which creates
  89. this file).  (4) Displaying C-code with reserved words highlighted;
  90. e.g., "fm -C fm.l | more".
  91. \bigskip
  92. \rightline{-- Greg Lee}
  93. \rightline{lee@uhunix.uhcc.Hawaii.edu}
  94. \rightline{5/5/92}
  95. \bye
  96. The end.
  97.