View Single Post
Old 9th November 2008
DrJ DrJ is offline
ISO Quartermaster
 
Join Date: Apr 2008
Location: Gold Country, CA
Posts: 507
Default

Quote:
Originally Posted by JMJ_coder View Post
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:

http://www.troff.org/papers.html

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.
Reply With Quote