gnroff - Unix, Linux Command


Advertisements


NAME

nroff - emulate nroff command with groff

SYNOPSIS

nroff [ -h ] [ -i ] [ -m ] [ -n ] [ -o ] [ -p ] [ -r ] [ -S ] [ -t ] [ -T ] [ -U ] [ -v ] [ file ... ]

DESCRIPTION

The nroff script emulates the nroff command using groff. Only ascii, ascii8, latin1, utf8, nippon, and cp1047 are valid arguments for the -T option. If an invalid or no -T option is given, nroff checks the current locale to select a default output device. It first tries the locale program, then the environment variables LC_ALL, LC_CTYPE, and LANG, and finally the LESSCHARSET environment variable.

The -h and -c options are equivalent to grotty’s options -h (using tabs in the output) and -c (using the old output scheme instead of SGR escape sequences). The -C, -i, -n, -m, -o, and -r options have the effect described in troff(1). In addition, nroff silently ignores the options -e, -q, and -s (which are not implemented in troff). Options -p (pic), -t (tbl), -S (safer), and -U (unsafe) are passed to groff. -v shows the version number.

ENVIRONMENT

TagDescription
GROFF_BIN_PATH A colon separated list of directories in which to search for the groff executable before searching in PATH. If unset, ‘/usr/bin’ is used.

NOTES

This shell script is basically intended for use with man(1), so warnings are suppressed. nroff-style character definitions (in the file tty-char.tmac) are also loaded to emulate unrepresentable glyphs.

EXAMPLES

nroff is a text layout language used to format text on UNIX/Linux machines. The difference between word processor and text layout language is that the result of formatting will not be available directly to the screen. The input file will have text as well as formatting commands which needs to be interpreted so to display formatted text.

nroff is designed for letter quality printers and for CRT terminals.

As a basic example, consider below file:

This is for testing only......
This is to demonstrate the formatting done by nroff
This is only a basic example.
This is the last line of file.

$ nroff -e test.txt > outfile.txt
$ cat outfile.txt
This  is  for testing only......  This is to demonstrate the for-
matting done by nroff This is only a basic example.  This is  the
last line of file.
Using the -e option has produced the output of equally-spaced words in adjusted lines

Advertisements