Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Learn: Ancient troff sources vs. modern-day groff (virtuallyfun.com)
39 points by beefhash on Dec 22, 2017 | hide | past | favorite | 29 comments


You really can't appreciate troff (and runoff and scribe) unless you do all of your document preparation on a fixed width font 24 line by 80 column terminal :-)

If you force yourself to do all of your work in that environment for a few months you can get a really good understanding of why the Xerox Star, Sun-1, and the Macintosh were so amazingly cool to people.


LOL And probably why I think linux is so cool now. The envy I had of people who had window managers!


I learned troff/groff pretty recently. Two reasons: 1) I hate WYSIWYG with the passion of a thousand suns, but sometimes you need pretty documents; 2) troff is a fast, tiny, ubiquitous tool.

I found that the existing macro packages (such as Mom) can produce beautiful documents, but they are limited to the specific types of documents for which they were created. Going "against the grain" of a macro package is nothing but pain and heartache.

A macro package can be learned in an hour.

Without existing macro packages, troff source is just control lines and text lines. It can be learned in a day or two. The "Troff User's Manual" technical report by Ossanna and Kernighan (yes, THAT Kernighan) is very readable.

* NOT A STORAGE FORMAT *

Troff (with or without macros) is meant to be read as a stream, top-down, producing a formatted document split into pages on the fly. Its formatting structure was not meant for specifying semantics or using the document outside of troff.

Therefore I think troff can be a wonderful output format. Its battle-tested tools are capable of directly generating, say, PDFs. But I'm personally not going to write anything I want to keep directly in troff.

Jeez, now I need to go write that *roff_mom backend for acsciidoctor...

Edit: unwanted italics via asterisks - the irony!


Real V7/PWB UNIX pros write m4/cpp macros to cross-compile their custom semantic/structural macros + document body fragments into troff and then generate final output from that..


And use a typewriter to put on the page numbers- because of that $%#& margin requirement...


It's funny to call groff "modern".

Nothing wrong with using it, it's just that it's nearly three decades old, which in software terms is pretty much ancient. troff was newer when groff was created than groff is today (~26 vs ~27 years, if WikiPedia is to be believed). So...I think it's more reasonable to say "extremely ancient troff sources vs. slightly less ancient groff".


From the title I thought the article would be about comparing the troff source to the groff source. But, it wasn't.


Troff isn't that bad once you spend a bit of time familiarizing yourself with the syntax - and possibly buildings your own abstractions on top of the available macro packages, -ms works but... SH? NH? .NaH. Or build a new one from scratch if you feel masochistic enough (not that I would know anything about it, nossiree).

It's lightweight (I like to think the feather typesetting-Anubis uses weights a bit more), fast, produces a decent output, and it is simple enough you can use it to make shell scripts spit out pdfs.


Troff is great! I started typesetting books in troff, then tried Lout, then LaTeX, and finally came back to troff. It's simple, flexible, predictable, and can typeset formulae, pictures, and tables (via eqn, pic, tbl). I would not want to trade it for anything else!


I would love to learn grap(1). No equation was plotted with the tools from Heirloom.


Nice! I didn't know about grap!


It probably would have been a good idea to use plan 9 troff for this. It's a descendant of the original troff while groff is a reimplementation...and I have noticed the output of groff looks a bit different.


I miss plan9/9front's plot(1) too. No, it doesn't exists on any BSD or GNU OS as base. And no, Gnuplot is an extra and is not actually a GNU tool. OpenBSD guys should create a BSD plotutils counterpart.


I've had similar nightmares involving LaTeX.


When I actually settled down to use LaTeX for a paper, I found it plenty nice. However there are two areas of LaTeX best left to professionals.

Installation - just use a cloud LaTeX like OverLeaf.

Font Installation - use what's available. If what you want isn't available, use what's available.


On Debian systems, installation is apt-get install texlive-latex-base texlive-latex-extra texlive-latex-recommended (basically, all the texlive-latex-* packages, base is enough for simple stuff).

Fonts come in the packages. if you want some extra one, just apt-get install it too.


Was this on Linux? LaTex on Mac and Windows is really easy (MacTex and MikTex, respectively).

Installing fonts through the Tex Live Manager is as easy as installing any other package.

There's also XeLaTex and LuaTex, both of which can use system fonts.


Probably not as it's the equivalent of `$pkg install texlive-full' (or whatever) on basically all distributions you'd use for a workstation.


> Installing fonts through the Tex Live Manager is as easy as installing any other package.

That's only the case if that font is already packaged. I tried to package Hack for installation and ran away shrieking like a banshee. It was a time sink where I probably could have wasted a couple of weeks coming up to speed on something I really didn't need to know.

Anyways, I'm quite happy with OverLeaf and Inconsolata is close enough.


Regarding fonts, nowadays I just use XeLaTeX and you can select any system font directly and output straight to PDF.


I kinda miss lout.


I keep saying I want to learn groff - but it does nothing but win me geek points - I can make documents that look almost as nice in a modern WYSIWYG word processor.


That is an awesomely cool set of rotating header images. I've also already wasted a few minutes trying to track down which Ulitma map that is to no avail.


Thanks, I thought it looked pretty cool to mix in some random OS screen shots with the Ultima VII intro animation. I screen capped a bunch of the animation to paste it all in to get the banner. I have 14 of them now, I started with a simple BIOS POST screen from PCem, and went from there...


Based on the black silhouettes I’d say it is Ultima VI, but it is hard to tell for sure.


I think it's actually a photoshopped combination. I found images of all of them, and none look quite right (and all details this is missing).


The monitor and map image (though not the screen contents obviously) are from the opening cutscene of Ultima VII.

https://youtu.be/JfqOZlNxbfI?t=106


> photoshopped

lol I'm not that sophisticated, just the print-screen key + paint brush. Graphical artist, I'm not.


Troff: not even once.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: