Subscribe to Rahul's Blog        RSS Feed
-----

Give troff a try

Icon Leave Comment
If you are an author or want to make near perfect typeset documents, you owe it to yourself to give troff a shot. Its one of those old Unix tools that continue to be useful, regardless of their current popularity. Think of it as a document markup language that lends itself easily to making print-able documents like PostScript and PDF. If this sounds similar to Tex/Latex, it is. But it is not inspired from them, it actually precedes them.

Bare troff is hard to write, I admit. But the macro packages on top of it make writing documents a breeze. Packages like man are still widely used to make man-pages, but general document writing packages like ms, me and mm are still available and useful. The incarnation of troff used on most machines now-a-days is groff which is the GNU implementation. It comes with several useful utilities like a PostScript converter, tbl for creating tables and almost all other tools that are common to troff implementations.

The learning curve for a macro package like ms is easier than most people think. In about 30 mins you would be able to learn the basic commands and create good looking documents. Plus you get the added advantage of working with plaintext - so diffing between versions, working in your favorite editor, revision control all become easier. And the output can be converted to almost any format you wish - HTML, PDF, PS, even formatted plaintext.

While choosing between Latex and troff is a subjective matter, if you haven't tried either, it would be good to start of with the lightweight troff and see if it suits your taste. It certainly suited Brian Kernighan and W.Richard Stevens so why not give it a shot to see why these great minds stuck with troff. The complete book - Unix Text Processing - has been available for free by O'Reilly and describes troff in detail in a tutorial style approach.

0 Comments On This Entry

 

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

Search My Blog

Recent Entries

Recent Comments

My Picture