9 ms·
Recreated sources for the book “UNIX Text Processing,” published in 1987
- jgtrosh 5y agoThe archive.org [1] page has a preformatted version and more info. [1]: https://archive.org/details/utp_book/page/n3/mode/2up https://archive.org/details/utp_book/page/n3/mode/2up
- yesenadam 5y agoThanks. Link for the complete PDF book, from that page: https://archive.org/download/utp_book/utp_book.pdf https://archive.org/download/utp_book/utp_book.pdf
- elvis70 5y agoPrevious discussion about this book (2012): https://news.ycombinator.com/item?id=4902595 https://news.ycombinator.com/item?id=4902595
- jmclnx 5y agoI actually have that book :) I thought it was very informative.
- bombcar 5y agoMost people assume UNIX typesetting was always just TeX - but troff and friends was probably more widespread at the time.
- Tor3 5y agoThe book I learned writing networking code from, Steven's "Unix Network Programming" (https://en.wikipedia.org/wiki/UNIX_Network_Programming https://en.wikipedia.org/wiki/UNIX_Network_Programming) was typeset in troff. The first edition (1990) at least. The later ones aren't I think. Stevens passed away in 1999. I recall coming across many other books which mentioned "troff" in the introduction back then.
- srvmshr 5y ago"The Unix Programming Environment" & "The C programming language" (K & R) were also written in troff.
- macintux 5y agoHard to believe it’s been that long since he passed. Was quite the blow. I was pleasantly surprised to find he wrote a Forth primer for Kitt Peak observatory. Linked from this page: http://www.forth.org/tutorials.html http://www.forth.org/tutorials.html
- timClicks 5y agoIIRC UNIX was supported by Bell Labs because of troff. They needed a type setting system.
- bear8642 5y agoThought that was more how they convinced management to buy PDP11 saying we'll make typesetting software for patent department?
- bediger4000 5y agoI kept my resume in troff from maybe late 80s until early 2017. troff is really weird, a genuinely different kind of text formatting. The fact that something as commonplace as text formatting can have such divergent methods as troff, lout and TeX has kept me looking for things like different pattern matching, something not at all like regular expressions.
- Someone 5y agoThere’s lex (https://en.wikipedia.org/wiki/Lex_(software) https://en.wikipedia.org/wiki/Lex_(software)) and parser generators such as yacc (https://en.wikipedia.org/wiki/Yacc https://en.wikipedia.org/wiki/Yacc). And what do you find weird in troff? I see it as an early markdown, or rather, markdown as yet another take on runoff (https://en.wikipedia.org/wiki/TYPSET_and_RUNOFF https://en.wikipedia.org/wiki/TYPSET_and_RUNOFF). Markdown is a bit more implicit and (unless you ‘escape’ out of it using html) has fewer features, but I don’t see it as that different.
- bediger4000 5y agoI'm aware of the Chomsky hierarchy. You can express more in a language with a grammar than one described by regular expressions. What's weird in troff: macros aren't particularly easy. Also the necessity of mixing "semantic" macros (.PP or whatever for "here's a paragraph") with fine-grained typesetting directives. There's also some property of .troff that although the language is enough to write old school file viruses (here's something about a TeX virus: https://www.usenix.org/system/files/login/articles/73506-checkoway.pdf https://www.usenix.org/system/files/login/articles/73506-che..., can't find the troff virus citation), I don't think anyone has ever been able to write a troff self-replicating program. It appears you can't write a macro that puts a '.' at the beginning of the line or something like that. I'm also aware that Stevens typeset all of this books with troff. It's very capable and unlike some other word processing systems, you can keep troff files in version control systems meaningfully.
- Someone 5y ago> can't find the troff virus citation Reading http://www.di-srv.unisa.it/~ads/corso-security/www/HTML/VIRUS/node45.html http://www.di-srv.unisa.it/~ads/corso-security/www/HTML/VIRU... using my very rudimentary understanding of Italian, I think that would be P. Beyls, “Is Unix resistant to computer viruses?” Proceedings of the European UNIX systems UserGroup, pp 229-238, Münich, Germany, April 23-27 1990 I can’t find that online. Amazon knows of the 1988 and 1989 proceedings, but not of those for 1990, and neither of those is available (https://www.amazon.com/s?i=stripbooks&rh=p_27%3AEuropean+UNIX+Systems+User+Group&s=relevancerank&text=European+UNIX+Systems+User+Group&ref=dp_byline_sr_book_1 https://www.amazon.com/s?i=stripbooks&rh=p_27%3AEuropean+UNI...)
- 2b3a51 5y agoJust had to try running this on Slackware 15 with the groff that is part of the install. The git source has a hardwired path to ghostscript/9.53.3/..some font. Just symlinked to the 9.55.0 present in Slackware and there we are, a pdf file, with some warnings about bookmarks and a table with zero width spacing. Impressive work. Thanks to those responsible for this both for the book and for an example of how to produce a book with groff using the ms macros.
- Aloha 5y agoThis is great. I've long had a paper copy on my bookshelf. I did notice when building this on OSX changing the makefile to call env to get groff and awk is required to work with homebrew. I did submit an issue on the github about this however.
- jll29 5y ago/usr/bin/groff -Tpdf -P-pletter -step -ms -z -rpdf:bm.nr=1 -rRef=0 -dPDF.EXPORT=1 utp_book.t 2>&1 | grep '^.ds' | /usr/bin/groff -Tpdf -P-pletter -step -ms -rRef=0 - utp_book.t >utp_book.pdf.tmp /usr/bin/groff: can't find `DESC' file /usr/bin/groff:fatal error: invalid device `pdf' make: ** [utp_book.pdf] Error 3 Just replace -Tpdf by -Tps in Makefile and run ps2pdf manually afterwards, then it works.
- kickingvegas 5y agoRelated: "Unix™ NROFF/TROFF A User's Guide" by Kevin P. Roddy got me through all my troff-related work back in the day.
- contingencies 5y agoNotes from W. Richard Stevens on the subject @ http://www.kohala.com/start/#typesetting http://www.kohala.com/start/#typesetting