Article View: comp.text
Article #3297Re: Why troff?
From: simpson
Date: Sun, 25 Jan 1987 19:48
Date: Sun, 25 Jan 1987 19:48
143 lines
7254 bytes
7254 bytes
I have read with interest the discussion of troff vs. TeX. Many of the
postings have been by people who have only used one of the formatting
languages. As someone who has extensively used both troff (and its
preprocessors) and TeX, I have decided to throw my two cents in.
Here is a (surely incomplete) comparison of both troff and TeX.
Troff disadvantages
-------------------
-- Two character command names.
Remember BASIC? Two character command names are not mnemonic
and are hard to remember. In addition, with two letters it is easy to
come up with names for two different macros that clash.
-- Macros are often bizarre collection of symbols.
Troff macros use a lot of non-alphabetic words and symbols.
To the uninitiated, it looks like a bunch of line noise. TeX is not
much better, but in TeX at least you have readable words.
-- Troff programs have bugs.
I don't know if troff itself has any bugs, but the preprocessors
eqn and tbl surely do. TeX is (probably) bug free. In fact, Donald Knuth
offers you money if you find any bugs in TeX. I think the sum is around
$20 now for any bugs found. Usually the amount offered is a power of 2.
Interestingly enough, since TeX has been out, only two bugs have been found.
It was extensively tested with the trip test.
Troff advantages
----------------
-- tbl
Troff does tables easily with tbl. TeX can do them with much more
difficulty. LaTeX makes tables much easier to do in TeX. If you use LaTeX
then I think they are about equivalent in ease although there are purists
on both sides.
-- Pic
Troff can draw pictures. TeX can't.
-- nroff
Troff has an equivalent program to output to an ASCII device.
TeX doesn't. This is nice. Unfortunately, besides the obvious things like
line breaks, troff and nroff output does not always come out the same.
-- Comes with UNIX
You buy UNIX, you get troff. Consequently, many people have troff
and learn it first. TeX must be installed and many sites don't go through
the hassle.
-- Supports many output devices.
TeX disadvantages
-----------------
-- Complex
In addition to being a good computer scientist, Donald Knuth is
also a good mathematician. Consequently, TeX has a number of complex
algorithms and rules that the beginner may find hard to understand.
Usually doing simple text is easy for the beginner. But when he wants
to modify output routines and such, TeX becomes complex.
-- Cannot draw pictures
TeX is text-only. This is somewhat alleviated with the \special
command. This command allows you to insert device driver specific
calls into TeX's DVI output file. The driver can then read these
commands when it is processing the DVI file and interpret them. Usually
the driver will read in a graphics file and output it to the printer at
this point. I have seen some really nice graphics output merged with TeX
documents. The complexity of the graph depends on the graphics package,
the driver and the output device; pic can only draw with its command set.
The commands are driver specific.
-- Cannot output to an ASCII device.
This is also somewhat alleviated by the programs dvitty and dvidoc
which were recently posted to the net. With dvidoc you must run your
document through TeX again before you output it to get the spacing right.
With dvitty you don't; however, the lines come out the wrong length
since the line breaks are already chosen. Also, with dvitty, you may lose
characters once in a while.
TeX advantages
--------------
-- Can create your own fonts
You can do this in troff too but not nearly as easily. TeX's
companion program METAFONT is very powerful and difficult to use.
It creates bitmaps from algebraic descriptions of character glyphs.
METAFONT works with outlines so it can create a font at any resolution.
-- Highly portable
TeX is written in WEB (Pascal) and runs on virtually everything.
Troff runs on UNIX.
-- Great math facilities
Since Knuth is a mathematician, he did the math part of TeX well.
The math looks fantastic and is easy to use. Eqn is also easy to use
but the math does not look that great and is not as powerful as TeX.
-- Help facility
TeX is interactive. It will stop and give you short online
help when it finds an error. Troff just continues until it is done
and screws up your output.
-- Well documented
TeX is well documented. The TeXbook, The METAFONTbook, LaTeX:
A Document Preparation System, The Joy of TeX and TeX for Scientific
Documentation are just some of the books. The TeXbook is an adventure
in cross-referencing other pages but all the information is there if you
need it. Troff is documented but not nearly as well.
-- Long command names
TeX command names can be as long as you want. Long mnemonic
names greatly ease remembering commands. TeX is also free format; troff
commands must begin at the start of a line. Long names are a major win.
-- Supports many output devices
-- Good attention to detail
One of the reasons that TeX is hard to use is that it is so exacting.
TeX pays close attention to ligatures, kerning, widows, clubs, etc. For
example, TeX will move the characters A and V closer together when they
are typeset adjacently. Troff won't.
In summary, TeX seems to be better for high quality typesetting
since it is newer and pays more attention to detail. You can do
anything in TeX if you try hard enough. It was created not to typeset
just books, but books of the finest quality. People still continue to
use troff because it comes with UNIX, the man pages are in troff, you
can preview it on a terminal and they don't have or don't want to learn
TeX. Here at TRW, virtually all of our users have switched over to TeX
after they saw the superior output. Our site is not alone. Many other
sites within TRW have experienced the same phenomenon.
There is one other typesetting language that I haven't mentioned:
Scribe. Scribe seems to be TeX-like (or TeX seems to be Scribe-like since
Scribe existed first). The company that sells Scribe, Unilogic, charges
about $30,000 for the product plus a yearly fee. Consequently, many
sites have dropped it and adopted the free (and superior) TeX.
We dropped it about two years ago and I know the University of Southern
California is dropping it at the end of the month. Both Scribe and TeX
were written by Stanford professors.
UNIX is a trademark of AT&T Bell Laboratories.
TeX is a trademark of the American Mathematical Society.
--
Scott Simpson
TRW Electronics and Defense Sector
...{decvax,ihnp4,ucbvax}!trwrb!simpson
Technical Details
Message-ID:
<1556@trwrb.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!sri-unix!hplabs!sdcrdcf!trwrb!simpsonReferences:
<362@linus.UUCP> <106@tg.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!sri-unix!hplabs!sdcrdcf!trwrb!simpson From: simpson@trwrb.UUCP Newsgroups: comp.text Subject: Re: Why troff? Message-ID: <1556@trwrb.UUCP> Date: Sun, 25-Jan-87 14:48:38 EST Article-I.D.: trwrb.1556 Posted: Sun Jan 25 14:48:38 1987 Date-Received: Mon, 26-Jan-87 02:56:56 EST References: <362@linus.UUCP> <106@tg.UUCP> Reply-To: simpson@trwrb.UUCP (Scott Simpson) Distribution: comp.text Organization: TRW EDS, Redondo Beach, CA Lines: 143 Keywords: TeX, troff