XFMT

Section: User Commands (1)
Updated: LOCAL
Index Return to Main Contents
 

NAME

xfmt - a simple text formatter  

SYNOPSIS

xfmt [ -i ] [ -j ] [ -m ] [ -x ] [ -o ] [ -u ] [ -c ] [ -l n ] [ -p n ] [ -t n ] [ filenames ]  

DESCRIPTION

Xfmt is a simple text formatter. With no options present, the default behavior of xfmt is to copy its input (from specified files or from stdin, if no files are specified) to its output but with input reformatted into lines no longer than 72 characters long. A blank line is taken to indicate the beginning of a new paragraph. Lines that begin with a period are preserved.

The following options modify this behavior:

-i
This option will cause xfmt to preserve indentations. Blanks or tabs at the beginning of a line will be considered the beginning of a new paragraph.
-j
Justify output lines. (The default behavior of xfmt is to output lines with a ragged right margin).
-m
Interpret a few commonly used nroff -man commands. Those understood (in some fashion) are:
 .B .I .R .S .G .SM .C
 .IR .BR .RI .BI .RB .IB
 .SH .SS .TH .PP .P .LP .TP .IP .HP
 .RS .RE .DS .DE .NT .NE .VS .VE
 .CT .PN .MS
 .UC (ignored) .DT (ignored) .PD (ignored)

And a few other nroff commands that occur commonly in man pages are recognized:
 \fI \fB \fR \fP \fC
 .sp .br .nf .fi .ti
 .\" \*(lq \*(rq .ta (ignored)

More details can be found in the document cmds.tex.

-x
Interpret a few commonly used TeX commands. Those understood (in some fashion) are:
 \vskip \bigskip \medskip \smallskip \$ \# \{ \}
 \& \% \^ \_ \~ \' \" \\ \it \sl \bf \rm \tt
 \TeX \centerline \rightline \raggedright \obeylines \item
 { } \(space) ~ $ (ignored) \backslash \beginsection
-o
Produce bold and underlined text with overstriking. If the terminal and termcap entries permit, the bold and underlined portions can be seen on the screen by feeding xfmt output to Bold is produced by fonts B/bf, S/tt, and underlined by I/it, G/sl.
-u
Produce bold, underlined, reversed, and blinking text for terminal display (using termcap md, us, mr, and mb entries, respectively). This is useful only if one of the options -m or -x is also chosen. Bold is produced by font B/bf, underlined by I/it, reversed by S/tt, and blinking by G/sl.
-c
For C code, display comments reversed, flow-of-control keywords in bold, storage-class keywords underlined, and pre-processor keywords blinking. No formatting is done. The -u option is assumed unless the -o option is given.
-l n
This option can be used to change the line length from the default of 72 characters.
-p n
Change the page offset. This option will cause the output lines to be offset the indicated number of columns from the left.
-t n
Set tab size. This option is useful only with the -i or -c options, or for text in the scope of .nf, .EX, .DS, inmail.1 on the screen with right justification, a page at a time: xfmt -jmu binmail.1 | more -f Display a man page with underlining, but no bold face: xfmt -mo binmail.1 | more -f Prepare a preformatted man page to be displayed with xfmt -mo binmail.1 >binmail.doc Display high-lighted C source code on the screen: xfmt -c file.c
 

TIPS

In vi, you can define a macro that will reformat paragraphs by typing :map V {!}xfmt^M or by putting the line
map V {!}xfmt^M
in your .exrc file. After defining this macro, pressing V will cause the paragraph under the cursor to be reformatted. (Use the u key to undo if necessary.  

SEE ALSO

nroff(1), vi(1), ul(1)  

BUGS

TeX command interpretation doesn't have a chance of working except for files prepared with the limitations of xfmt in mind. Nroff -man interpretation has maybe a 50-50 chance.  

AUTHORS

original version: bgray@marque.mu.edu (Bill Gray)
TeX, man, C mods: lee@uhccux.uhcc.hawaii.edu (Greg Lee)


 

Index

NAME
SYNOPSIS
DESCRIPTION
TIPS
SEE ALSO
BUGS
AUTHORS

This document was created by man2html, using the manual pages.
Time: 06:21:09 GMT, December 12, 2024