What do you see as the failings of troff that Knuth should have improved or cleaned up?

You are asking very complex questions. Have you used Troff (Groff)? Have you used TeX or at least LaTeX? Even if do not have high typographic requirements you will see that Troff is not very flexible. If you need new macros or even unusual spacing that is major thing in Troff. In TeX is almost trivial. Troff has almost nonhuman syntax comparing to TeX (which is almost nonhuman for most humans).
I am a mathematician. Mathematics is the major strength of TeX. In Troff on the another hand you either have to do real programming in order to type mathematics or to use math pre-processor which is fantastic and typical Unix idea. You pipe formulas through math pre-processor before you send to Troff.

Troff has very limiting text editing capabilities. You see before people start using computers for publishing the process of writing a book was something like

writer--->typesetter----->editor----> typsetter--->printing press

You see the major quality of TeX (LaTeX) in particular was that erased the need for typesetter and editor. The writer become typesetter and
TeX became very good book/paper editor. Troff has rather limited capabilities in that sense.

There is also lesser known aspect of TeX which is Metafont. That is a major advance in computer calligraphy. Troff never rose much above
ATT internal typographic system used for internal documentation.
By the time GNU Troff (Groff) appeared TeX was way too good for Troff to pick up.

What I really like about Troff is that is written in pure C. It is lighting fast. It does really good job if you stay within the frame of couple available pre-processors.

What I hate about TeX is that is an ugly interpreter even though implements some of finest and most original algorithms ( line breaking comes to mind). I also can not swallow the fact that TeX is coded in Pascal. It is never the less probably the most ported peace of software out there. It is also very bloated. Current standard Unix distribution TeXLive is almost 1Gb for all packages. On the another hand Troff 1.19 (Unfortunately the one in base of the OpenBSD is 1.15 version which is not
tragic having in mind that Troff almost doesn't develop) is I think only 5MB or something like that. Trust me I could easily impress you by typing math paper in Troff even though it is 200 smaller than TeXLive.

Troff is at last released by Caldera. Heirloom Project maintain the original code which is more or less obsolete due to the significant progress made in Groff.

Personally I don't think there is anything wrong with groff (which these days I use synonymously with troff though that's not quite right). It has many extensions to troff that help quite a bit, and it does pretty much all I need to do. TeX/LaTeX has some added flexibility, but it comes at the expense of greatly increased verbosity (if you use LaTeX). And no one really uses groff without macro packages or the proprocessors. -ms is fine for most things, but there are others, such as -me, -mm and -mom. Support for the groff family also is quite good through a small but dedicated group on a mailing list.

Its main failing I have found is that it is hard to float text around an inserted graphics element, which is important when you have page limits, and that the graphics insertion routines are rather picky about the eps syntax (and you can't use any other format, though you can always convert).

The other limitation is that very few publishers accept troff code, but usually do accept TeX/LaTeX code. That is a *major* problem. Some accept a submission in PDF format, but many more do not.

I also think that the computer modern font Knuth developed is downright ugly. I understand the motivation for its development, but there is a reason that type designers didn't come up with something like it. I know you can use others, but Times Roman is just a better default (not that it is my favorite either).

I also think that the computer modern font Knuth developed is downright ugly. I understand the motivation for its development, but there is a reason that type designers didn't come up with something like it. I know you can use others, but Times Roman is just a better default (not that it is my favorite either).

And lets not forget it.TeX didn't support pure ASCII for a long time
Unfortunately domination of the TeX is probably due to the fact that TeX was open source while Troff was jealously guarded ATT child until it was too late.

personally, i don't use g/troff or (la)tex and i never thought about this until you guys brought this up. so why did Knuth create TeX if troff was already available at the time?
(BTW, i think Jmj_coder was asking the same question )

> I preferred if he worked on improving Troff instead of waisting 10 years of his life to code TeX from the scratch.

the man is known as the father of computer science and his intellect/achievements exceeds that of all of us combined. do you really think he would "waste" 10 years of his life creating TeX without a compelling reason for doing so?

I'll not let facts get in the way of healthy speculation, but I would guess that Knuth simply got interested in text processing and thought he could improve the state-of-the-art. Academics are free to do that -- there need be no real "reason". That troff was closed at the time was likely a motivation.

the man is known as the father of computer science and his intellect/achievements exceeds that of all of us combined. do you really think he would "waste" 10 years of his life creating TeX without a compelling reason for doing so?

Well depends on you point of view. The people who were deprived from the
third volume of the Art of the Computer Science for almost two decades would cold -heartedly agree with me. I would go with Dr. J healthy speculation. Troff was closed and there were no real alternatives at the time for typesetting while the old gold standards were scraped by publishers due to the cost.

I agree that Knuth is the Leonard Euler of CS. However do not let the greatness cloud your mind. Great people also make blunders. The famous one in Computer Science is one committed by John von Neumann by putting a single clock in the heart of the computer despite fierce opposition of the chief co-architect
Dr. Lehman from U.C. Berkley (Just like Dr. J) who wanted to put couple clocks and run programs in parallel fashion. That effectively hindered the development of parallel programming for half a century.

I could not get of the impression that Knuth has gotten himself little bit too much into calligraphy. The fact that he brought Brian Ried inventor of the third major type setting system of the time Scribe to Stanford is the one of my arguments. It is important however to notice that typesetting systems that we are talking for granted today have been painfully developed by some of the brightest minds of computer science.

Cheers,
OKO

P.S. For Moderators.

I apologize to BSD666fun and everybody else as I had no intention of hijacking original thread. It seems to me that one of my original remarks mentioned in respond to the question to PCC compiler lead to this very interesting discussion TeX vs Troff. Could you pelase separate the thread.

like Knuth we started with PCC then switched to a completely unrelated topic.

can the moderators fork this thread?

> The famous one in Computer Science is one committed by John von Neumann by putting a single clock in the heart of the computer despite fierce opposition of the chief co-architect Dr. Lehman from U.C. Berkley (Just like Dr. J) who wanted to put couple clocks and run programs in parallel fashion. That effectively hindered the development of parallel programming for half a century.

this is interesting. can you tell us more about it or point to any links?

BSDfan666, sorry for hijacking the thread.

> U.C. Berkley (Just like Dr. J)

Oko, don't get me wrong, I was just being a fanboy and I didn't mean it that way.

Troff was closed and there were no real alternatives at the time for typesetting while the old gold standards were scraped by publishers due to the cost.

A few random comments before this thread is split off, which it really should be.

While troff was closed, AT&T was rather liberal with academic licenses. Stanford undoubtedly had the source. It would hinder its wide-spread propagation, though that may not have mattered much to Knuth initially. My guess is that he looked at the troff source, and found areas where he could improve the product, such as the spacing and line-break algorithms.

You also have to remember where the industry was in those days. troff and its many preprocessors was the practical justification that was used to develop Unix originally. KSRs were still very common, and being displaced slowly by terminals. The PDP 7 and 11 were considered to be very powerful computers. These days we have more computing power in our cell phones.

Move forward a few years into the late 1970s and early 1980s, and you are in the era of CP/M 8-bit machines. Wordstar was king (though I used the EMACS- and Scribe-like editor-formatter Final Word). Eight-pin dot matrix printers were the most common (yuk!); there were some daisy wheel and rotating ball printers that had extended character sets but they were really costly (like over $2K). The majority of scientific and technical document processing was done on Wang stand-alone word processors.

On the other end of the spectrum were the dedicated phototypesetters. These usually ran on minicomputers, used proprietary software, and drove the phototype output device. The output form was photographic paper; resolutions were extremely high (on the order of 6000 dpi) and the type was absolutely beautiful. My wife at the time was a typographical proofreader and typesetter, and it was through her that I originally got into type.

The output from troff was limited to a single typesetter (Berkeley had one which I used) and the troff output type, while quite good, fell terribly far short of what could be done with dedicated systems. There simply was not enough attention given to character spacing (kerning), typographical "nicities" like ligatures, interword spacing and use of thousands and thousands of type families, and their corresponding weights, in condensed and expanded faces, and in faces (like italic).

While extremely capable as a technical document production system, troff was a pretty crude typesetter when compared with the professional systems.

That's the context into which Knuth started TeX. It is no wonder that he thought he could do better -- there were many areas where improvement was possible. At the same time, he was undoubtedly influenced greatly by troff, which you can see in how it handles mathematics. Personally, I think the troff preprocessor eqn is one of the most brilliant pieces of software ever written.

Incidentally, type these days has taken a terrible turn for the worse. There simply is no replacement for phototype -- it is simply stunningly beautiful. You really should try to find a galley on photographic paper produced by a first-rate system. There is nothing like it.

At the same time, the word processors uniformly turn out ugly type. MS Word, for example, in spite of the alleged sophistication of its many internal algorithms, produces profoundly ugly type. I can always tell when someone has written a document in it. Both troff and TeX produce type that is worlds better. But even those pale in comparison with the old dedicated systems. These, alas, are pretty much dead. Typography has never really recovered from the introduction of the personal computer. And I count that as a great shame.

The upside is that for a few hundred dollars (including an inexpensive laser printer), one can use troff or TeX to produce documents that are pretty good. They are much, much better than documents produced by the old Wang (or even scientific typewriters!) and so they are much more accessible to the general user. Sadly, those users tend to use Word or its equivalents, which really have no place for anything beyond a simple memo. That is, if one places any value in the appearance of type.

Sorry for the length of the post, but this is an area near to my heart, as you can probably tell.

> The famous one in Computer Science is one committed by John von >Neumann by putting a single clock in the heart of the computer despite >fierce opposition of the chief co-architect Dr. Lehman from U.C. Berkley >(Just like Dr. J) who wanted to put couple clocks and run programs in >parallel fashion. That effectively hindered the development of parallel >programming for half a century.

this is interesting. can you tell us more about it or point to any links?

That is not the part of the official history You have to know the people who created the history to find that out such details. John von Neumann is deceased but his daughter is alive and lives in Boston so this can get me into legal troubles. It is called defaming people.

Lets put this way. I know very well the guy (mister X) who is now 85 years who was Ph.D. student of late
Dr. Lehman at the time. For the record mister X was not my Ph.D advisor. We are just very good friends. My Ph.D. advisor was dealing with computers mostly through me!

You are asking very complex questions. Have you used Troff (Groff)? Have you used TeX or at least LaTeX? Even if do not have high typographic requirements you will see that Troff is not very flexible. If you need new macros or even unusual spacing that is major thing in Troff. In TeX is almost trivial. Troff has almost nonhuman syntax comparing to TeX (which is almost nonhuman for most humans).

I have never used Troff (or any others in the roff family). I have used TeX/LaTeX a little bit in my exploring various typesetting solutions, but didn't get that far as I started to concentrate at the time into musical typesetting - for which I use Lilypond (which itself could be greatly improved).

Is the roff family capable of any typesetting task presented to it - or is it just the syntax is so unnatural that it is hard to learn?

__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)

I have never used Troff (or any others in the roff family). I have used TeX/LaTeX a little bit in my exploring various typesetting solutions, but didn't get that far as I started to concentrate at the time into musical typesetting - for which I use Lilypond (which itself could be greatly improved).

Is the roff family capable of any typesetting task presented to it - or is it just the syntax is so unnatural that it is hard to learn?

GNU Troff is very capable system but it is very crude if you just use standard packages and pre-processors. I have never tried to use Troff to type music. I would imagine that mom package might have capabilities to typeset music. I have tried to use TeX to type music but I think that Lilypond is much more capable.

By the way Werer Lemberg is current maintainer of Troff. He has significantly contributed to LaTeX, and he is professional composer by occupation so he uses Lilypond on daily basis.

Speaking of Troff syntax I find it little bit more difficult than TeX but I have used TeX thousand times more than Troff. It is OK actually. Why don't you try. There are enough documents on the net to get you start with the simple document in Troff. Unix in the Nutshell has a good short introduction.

Lets face it. Any markup language is far beyond capabilities of most desktop users. Don't forget most Windows users are not like Dr. J who uses Windows because he has to run specific software.

Is the roff family capable of any typesetting task presented to it - or is it just the syntax is so unnatural that it is hard to learn?

Yes to both. Kernighan wrote that "[t]he great strength of troff is the flexibility of the basic language and its programmability -- it can be made to do almost any formatting task."

The macro packages are pretty easy to use for most things, as are the preprocessors for equations (eqn), tables (tbl), references (refer), line drawings (pic), graphs (grap) and chemistry (chem). I've found that you have to know a certain amount of raw troff to do some of the things I want to, and that is less than intuitive until you get the hang of it. That takes some time. The next level up, such as writing macros, is pretty challenging for me, mainly because I don't do it enough to stay in shape.

An excellent introduction to the troff family is the original Bell Labs documentation. You can find much of it here:

Remember that groff has many useful extensions from the troff of these papers, but they are an excellent place to start. I still use my dog-eared Unix Seventh Edition programmer's manual (volume 2) as my day-to-day reference.

FWIW, I learned it by writing everything in raw troff (from the tutorial), including overhead slide presentations and simple memos, until I got the hang of it. Then I moved on into the macro packages, which then were quite easy.

I don't know if that sort of effort is worth it these days. The upside is that every *nix system has groff, it is still used for man pages, and it is very powerful. The downside is that an investment in TeX might be better if you are looking to publish or exchange source files with other authors (though they usually use Word).

For me I've used it for 25 years, so it is second nature. But it really does suck to have to translate the code to TeX, and then diddle with it, to publish anything. There are enough hurdles to getting articles out the door already.

GNU Troff is very capable system but it is very crude if you just use standard packages and pre-processors.

I'd use the words "somewhat limited" instead of "crude." The macros have a limited extent, but what they do, they do well. For me they cover the vast majority of what I have to do. Still, there are things that are irritating, such as trying to get refer to use an output format other than the very few that are supported.

These are the sort of discussions that leave me confused as to what to study. On my list of things to learn is troff/groff/nroff/tex/latex and I'm not sure what to choose or where to start. I always find articles and postings that do what seems to be done above, that is, "troff can do anything you want better"/"I don't know if it's worth learning anymore" and "Latex isn't as good"/"No one can accept your troff files" or "Everyone uses Latex"/"It can't do what you want". (Don't take all that literally.)

This rocking back and forth makes me unsure what to take up first and what's worth pursuing later. I think, I think, I want to be able to markup my text that can be easily published, or at least easily translated to postscript or pdf (or even Word/OO?). As an assembly language programmer, I like working with the simple basics of handling raw code but I don't want to waste my time with something no one can use, or no one uses anymore. I even get confused with the differences between the different roffs.

Does it all boil down to this compilation from DrJ above?

Quote:

I learned it by writing everything in raw troff...I don't know if that sort of effort is worth it these days...an investment in TeX might be better if you are looking to publish or exchange source files with other authors...

Is this summary my answer to whether I should bother with the roffs?

Quote:

it really does suck to have to translate the code to TeX, and then diddle with it, to publish anything. There are enough hurdles to getting articles out the door already.

As a semantic language, DocBook documents do not describe what their contents look like, but rather the meaning of those contents. For example, rather than explaining how the abstract for an article might be visually formatted, DocBook simply says that a particular section is an abstract. It is up to an external processing tool or application to decide where on a page the abstract should go and what it should look like.

I have been using a very very simplified Docbook XML derivate to write Howtos. I write the source in XML. One stylesheet produces HTML, another stylesheets converts the same XML source into Vbulletin markup.
It wouldn't be too difficult to write a stylesheet to produce Tex or troff markup.

But it does depend on what you want to do: what sorts of documents you want to produce, the parties with whom you collaborate (if any), and where those documents will go. Either troff (used generically) or TeX produce decent documents, even getting html or pdf from them. That's easy.

Where both of the shine is in producing complex documents, like technical reports that include heavy math and tables and the like. That includes things like technical publications or proposals. If you want just a PDF at the end, use either. If you want to submit an article to ACS or APS (for example), go with TeX. Many publications from the Royal Society or Elsevier accept PDFs and massage them directly. But honestly, most are geared, even in this space, more for Word.

If you collaborate with all but a few of us nerdly types, don't bother. Just use Word or OO.o. And there is no good way to take a troff or TeX document and convert it to Word and back.

I'd suggest you learn both troff and TeX, at least at a rudimentary level. They are in many ways very similar in how they do their jobs, but the specific statements are of course a bit different. It is like picking up a new programming language -- at first it seems like it is hard, but after you know four or five, picking up a new one is just no big deal.

You don't have to learn all of the low-level troff stuff -- I did, and it helps, but it is by no means necessary. Most people can get by just fine without it.

These days I write in troff, use a translator to convert it to TeX, and then massage the code so that it formats properly. OKO probably does something similar, but in reverse. I probably should learn TeX/LaTeX better, but honestly it just does not seem worth the time.

If you are set on only learning one, TeX is probably the better choice these days. It is used in more places, and more people seem to know it well. You probably won't see much difference in the output quality unless you do *really* heavy-duty math (mostly in the symbolic area). In this case TeX is better. It is also better for writing non-Roman documents (like in Arabic). For western documents it makes little difference.

On the other hand, the introductory troff + preprocessor documentation is really outstanding, and just feels like Unix. TeX feels more like Pascal when you are used to troff's C, or the GNU command-line options ("-this_option_is_really_long") when you are used to BSD ("-opt"). That's an aesthetic choice, and not one of functionality or usefulness.

One example might be the number of options to control font size. LaTeX has five (or more?) options to make fonts larger. Most troff macros have one, since it was geared to writing standard patent applications. I usually just use the direct font-size commands from raw troff, so it doesn't matter to me in the slightest.

I hope this ramble has been of some use. If you want to share more of what your needs are, we can certainly discuss it.

Much of what J65nko write is true: both troff and TeX are geared primarily for paper output of whatever size. That can be proposals, reports or books -- that does not really matter -- but they are not at their best for other formats.

That said, how an abstract (for example) appears is controlled through the macros, and those are pretty easy to edit. That part is transparent to the user. You just have to designate it as an abstract.

As an aside, when people ask me what I do for a living, I often say that "I kill trees." Clearly output to paper is what matters to me.