Outlined below are the differences between TEX and troff that
I know from experience with the two languages most of which
obtained while writing tr2tex.
Most of them are advantages TEX has over troff.
There are actually more than one type of TEX, the most
used ones are LATEXand plain TEX Troff can also be loaded with various macro packages to
produce variations to plain troff. Also, ditroff (device independent troff)
is becoming more and more the standard of troff.
The following comparison is made mainly between LATEX and ms troff.
It will be mentioned if in a particular case ditroff makes a difference.
- TEX is not system-dependent. Troff is a Unix tool.
- In Troff, tables and equations are handled by preprocessors
while in TEX they are simultaneously processed with text.
- Troff's commands have to start at the beginning of the line
and start with a dot. Equation symbols are recognized when delimited by space.
All TEX commands, in math or non-math mode, start with a backslash
and they don't have to be placed at the beginning of the line.
- TEX and LATEX commands are more verbose than troff's.
This can be an advantage or disadvantage depending on the user.
- TEX processes boxes such as lines and paragraphs as one unit.
This means it can distribute badness over that box.
For example, when a spacing between two lines needs to be large, because
a line has large symbols, it will slightly stretch the
line spacing in other lines to make the large spacing not look
too bad. This also makes it avoid orphan lines.
- The input to LATEX is a more structured document with scopes. It makes it
easier to proofread. Troff's input is less structured.
- Some TEX drivers make it very easy to include prepared
graphs with the text. Including graphs with troff's text is more difficult.
- Many fonts can be loaded in a TEX document (up to 32); in troff,
the limit is 4 (ditroff does not have this restriction).
- Non-math macros are defined just like math macros in TEX.
In troff, define is used for math definitions and .de is
used for non-math macros.
Troff's macros can be made up from anything while
TEX macros cannot have non-letters which is a nuisance sometimes.
- There is no limit on the page size in TEX. The size is limited only by
the output device. Troff's paper size is limited.
- TEX is interactive, while troff is not. However, not many people can
benefit from this feature since they have to be skillful in answering
its questions.
- TEX and LATEX give a l o n g ambiguous log file that does not
exactly tell what the error is. Troff does not give error messages.
- LATEX automatically numbers equations and figures, etc. A powerful
cross-referencing technique relieves the user from worrying about having
the right sequence of equations' and figures' numbers. This feature
is not available in troff.
- The documentation in the LATEX manual is excellent.
Troff's documentation is scattered over many references.
The documentation in the TEXBook is very technical and the average reader
may find it unreadable.
- At hanauma, we have a previewer for TeX on the SUN, but don't have it
for troff.