I've heard that troff/groff have largely been replaced by TeX. Is this true?
The only thing that I know actually used troff nowadays is manpages. Is this also true? If not, what are some other uses?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI am using troff for my everyday typesetting; I am using the Heirloom version of troff (see http://heirloom.sourceforge.net/doctools.html ) which has very powerful support for fonts (TTF, Type1, OTF, etc.), Knuth's algorithm for formatting the paragraph as well as several micro-typesetting features that you can't find in plain TeX; it is lighter than LaTeX and as long as you don't need to typeset equations, I find it much easier to get high-level typesetting than with LaTeX (it's much easier to load fonts, get control over the exact position of things, etc.).
I run/schedule 'canned' PDF reports using *roff
, generating tables and simple PICs as I process the data with python, and organizing sources with simple bash scripts. Smooth & Simple.
Like vi
, *roff
is always there, ready-to-run and generates clean PDFs with minimal fuss. I like *roff
's terse markup.
This said, I don't pretend to be a representative sample of typesetter/mark-up users...
*roff
is particularly powerful if the objective is to generate PDFs write-ups. Inkscape touches up R's graphs (exported as PDF although PS/EPS also works), and PDF Studio (or any other PDF editor) makes graph inserts a simple copy-paste deal. You can script tbl
inputs with the language of your choice and update your doc with bash/make. This is the pipe I use:
Apr 2, 2015 at 15:27
tbl myreport.roff | eqn | groff -Tps -ms | ps2pdfwr - myreport.pdf
Apr 2, 2015 at 15:27
A very successful Addison-Wesley book published in 2015, The Go Programming Language, was typeset in troff/groff.
You can read about the rationale in this blog post by a blogger who sought to inquire about the lovely typesetting.
I've heard that troff/groff have largely been replaced by TeX. Is this true?
The only thing that I know actually used troff nowadays is manpages. Is this also true?
I've only ever seen troff/groff being used for manpages; for everything else, people seem to use TeX or LaTeX. So I'd answer yes and yes.
If not, what are some other uses?
Apparently it was used to typeset books back in the day: http://www.troff.org/pubs.html
As that page was last updated in 2006, I don't think that it's still being used for this purpose :)
I still use it with its ms macros for internal technical reports/documentation of very specific projects, not only groff but also even PIC for basic block flowchart layouts. It is also easy to incorporate custom postscript graphics or charts generated with the GNU Plotutils. Automated PDF reports are also easy to build by using groff.
I doubt it is widely used anymore but it works well for preparing simple documentation and reports and the fact that there are some answers here shows that there might be more people using it than we thought.
*roff was used at Collins Dictionaries until the early 2000s to typeset printed dictionaries. I was part of the team that worked on *roff workflows and migrated them to newer alternatives.
G/Troff can do almost everything that (La)TeX can; it's just that few people use it nowadays.
If you're going to be submitting PDFs then you might as well use Troff and benefit from its UNIX philosophy, but if you have to share source code then you may have to use LaTeX.
I think LaTeX is more of a markup language that automatically outputs the text based on style selections, while troff allows more precision but has less automatic style support. You can use both for either task, but I think each has its favored use. I use groff when I need precise text positioning.
TeX
but alsoHTML
.pandoc
to convert it into manpages or HTML. Especially ReStructuredText lends itself very well to make it into various kinds of documentation.script
formatter, I wrote a tool that let us cross-reference test cases and assertions in the specification document, identifying high value tests. One cannot even think about doing this with a WYSIWYG formatter. (Well, one could, by doing binary I/O on a proprietary, undocumented blob. No thanks!) troff/groff are tools in everyone's toolbox, and could be just the thing for The Next Project.