JUST(1)

NAME
just - text justification program

SYNOPSIS
just [-<width>] [-t<tolerance>] [file...]

DESCRIPTION
Just takes one or more files containing text and justifies them to a specified width, sending the result to standard output. Default <width> is 72. (The default can be changed by creating a file in the current directory called ".justwidth" and containing a number.) If no files are given just takes its data from standard input. Thus either of the following commands show the simplest use of just

just oldtext > newtext
just < oldtext > newtext

This is a simple text formatting program, designed for situations where the more complex facilities of nroff or troff are not required. It formats according to the following rules:

1) blank lines remain blank.
2) if a line begins with spaces, these are preserved and it is not merged with the previous one.
3) lines which begin with 8 or more spaces (equiv one tab), or which have a '>' sign in column 1, have their layout frozen completely.

Otherwise each line is merged with the previous line and reformatted so as to maximise the number of words in the line and then justify it to the specified width. During reformatting the following two extra rules are observed:

(a) Between any of the sentence terminators '.', '?', '!', and a following word on the same line, a minimum of two spaces will be preserved if present in the original text.

(b) Justification (i.e. padding out to the exact width) is not performed on a line when it would require the insertion of more than <tolerance> extra spaces in any one place. This rule is added to make just behave sensibly when formatting to a width allowing only a small number of words per line, eg for a newspaper column. The default tolerance is 3.

These rules are quite well adapted to the conventions of normal English text, and enable just to be used to format letters, and a variety of simple documents. Rule (3) provides two conventions whereby fragments of program, tables etc, can be embedded in such documents and protected from reformatting. Note that just can safely be applied to its own output, eg to reformat to different widths. (Reapplying just with the same width will leave the text unchanged.)

Just removes tabs from lines which it is reformatting, replacing them by spaces. (But tabs in frozen lines will be left alone.)

Just knows about underlining (in the style "underline-backspace-character...") and handles underlined words and sentences correctly. When preparing text which is to be continuously underlined across wordbreaks, each non-final line of underlined input should have a trailing underlined space.

Setting <tolerance> to zero, as in `just -t0' will cause reformatting without justification. Specifying a negative width also has this effect. That is `just --72' means `just -72 -t0'.

SEE ALSO
vi(1)
fmt(1) - the advantages of just over fmt are that it can format to different widths (fmt is fixed at 72), that it does justification, and that it knows about underlining. Like fmt, just is conveniently called from inside vi, by using the `!' command. Examples, of using just inside vi: To reformat a paragraph, position the cursor at, or just above, the beginning of the paragraph, and say
!}just
To reformat the whole document say
:1,$!just
These are standard applications of the vi `!' command, which pipes pieces of text through an arbitrary UNIX command called from inside the editor - see vi documentation for more information.)

BUGS
When preparing input text, you have to remember to leave at least one space at the front of each line which is not preceded by a blank line and which you don't want merged with the previous line, e.g. successive lines of an address. Note that this means that just cannot be used to reformat a paragraph all of whose lines are indented. (This is the one respect in which fmt is superior to just.)

AUTHOR
Research Software Limited. Just is included in the distribution file for Miranda(tm).