# info > roff

---
type: CommandReference
command: roff
mode: man
section: 7
source: man-pages
---

## Quick Reference

- `groff file` — format a roff document with GNU roff (default output device)
- `nroff file` — format for text terminals (usually via `groff -Tascii`)
- `troff file` — format for graphical output (usually via `groff -Tps`)
- `grog file` — guess groff arguments from document content
- `groffer file` — display groff files and man pages graphically
- `tbl file | troff` — preprocess tables before troff
- `eqn file | troff` — preprocess equations before troff
- `pic file | troff` — preprocess diagrams before troff
- `refer file | troff` — preprocess bibliographic references before troff
- `soelim file | troff` — include macro files from standard locations

## Name

roff — concepts and history of roff typesetting

## Synopsis

cat file | [preprocessor] | ... | troff [options] | postprocessor
## Options

No command-line options are documented for the generic roff concept. For specific implementations, see `groff(1)`, `troff(1)`, `nroff(1)`.

## Examples

### Editing a roff document

Start each sentence on a new line, avoid blank lines, and use `.` or `.\"` for empty/comment lines.

This is an example of a
.I roff
document that you can type into your text editor.
.
This is the next sentence in the same paragraph.
.
This is a longer sentence stretching over several input lines;
abbreviations like cf. are easily identified because the dot is
not followed by a line break.
.
In the output, this sentence continues the same paragraph.
### Using Emacs nroff mode

Add these lines at the end of the file to enable nroff mode automatically:

.\" Local Variables:
.\" mode: nroff
.\" End:
### Using Vim with groff highlighting

Add these lines at the end of the file:

.\" vim: set filetype=groff:
## See Also

- [groff(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown) — GNU roff implementation
- [troff(1)](https://www.chedong.com/phpMan.php/man/troff/1/markdown) — classical roff formatter
- [grog(1)](https://www.chedong.com/phpMan.php/man/grog/1/markdown) — guess groff arguments
- [groffer(1)](https://www.chedong.com/phpMan.php/man/groffer/1/markdown) — graphical display of groff files
- [ditroff(7)](https://www.chedong.com/phpMan.php/man/ditroff/7/markdown) — device-independent troff
- [groff_out(5)](https://www.chedong.com/phpMan.php/man/groffout/5/markdown) — intermediate output format
- [groff_tmac(5)](https://www.chedong.com/phpMan.php/man/grofftmac/5/markdown) — macro package naming and placement
- [groff_file_names(5)](https://www.chedong.com/phpMan.php/man/names/5/markdown) — file name extensions for roff
- [less(1)](https://www.chedong.com/phpMan.php/man/less/1/markdown) — pager with LESSOPEN support for roff files
- [emacs(1)](https://www.chedong.com/phpMan.php/man/emacs/1/markdown) — editor with nroff mode
- [vim(1)](https://www.chedong.com/phpMan.php/man/vim/1/markdown) — editor with roff syntax highlighting
- Historical references: [CSTR #54](http://www.troff.org/54.pdf), [CSTR #97](http://cm.bell-labs.com/cm/cs/cstr/97.ps.gz)
- [troff.org](http://www.troff.org) — historical troff site
- [GNU roff](http://www.gnu.org/software/groff) — official groff site
- [Heirloom roff](https://github.com/n-t-roff/heirloom-doctools) — alternative free roff implementation