24

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?

6
  • 3
    Not just TeX but also HTML.
    – jordanm
    Sep 6, 2013 at 5:18
  • 15
    I would consider the fact that man pages still use *roff to make it relevant.
    – Chris Down
    Sep 6, 2013 at 7:58
  • It's kinda open up to opinion. Nowadays, people often use Markdown and ReStructuredText and use pandoc to convert it into manpages or HTML. Especially ReStructuredText lends itself very well to make it into various kinds of documentation.
    – polemon
    Nov 16, 2021 at 23:54
  • 1
    If troff/groff still work, anybody can use it. There are several advantages to an "embedded controls" document formatter over a WYSIWYG (What You See Is All You Get) formatter. Using IBM's 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.
    – waltinator
    Nov 17, 2021 at 0:55
  • 1
    If I may say so, whilst the body of the question is fine, the title itself seems to invite opinions rather than factual answers. Feb 22, 2022 at 12:44

8 Answers 8

30

I 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.).

26

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...

3
  • Mmm. I'd not thought of using *roff to create PDFs. (It's been a (very) long while since I last used nroff for anything.) Must revisit that as a possible solution for a project I have in mind. Unless HTML solves it sensibly, too. Apr 2, 2015 at 15:00
  • 1
    I think the combination of R-Inkscape and *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
  • 3
    tbl myreport.roff | eqn | groff -Tps -ms | ps2pdfwr - myreport.pdf Apr 2, 2015 at 15:27
15

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.

1
14

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 :)

2
  • 5
    -1 to this answer. Troff is still used for authoring documentation across a variety of mediums, and even manpages aren't strictly formatted only for TTY display. As for TeX, yes, it's true it replaced Troff as the dominant language for technical publishing (Roff's hairier-looking syntax probably didn't help here), but both languages are equally powerful and extensible.
    – user101379
    Mar 19, 2018 at 13:03
  • 1
    I've been using groff since Pandoc enabled the ms macros for pdf output (via pdfroff). So, basically, I dumped LaTeX. Not without hesitation, though.
    – jarnosz
    Nov 16, 2021 at 23:12
6

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.

4

*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.

1
  • 1
    What are some of the newer alternatives? Jan 24 at 8:22
1

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.

1
  • That's a hard oversell of Groff/Troff. No, it can not nearly do all that TeX can. That in itself might be a feature, but you won't be setting any publication-grade multidimensional plots with groff anytime soon. Aug 26 at 22:34
-1

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.

1
  • that is not true. LaTeX is anything but a markup language – it's more of a self-parsing parser configuration language with "document output" as side effect. LaTex is definitely a programming language and very little a markup language. Sure, there's some commands in standard LaTeX that specify document structure, but the abstraction that they just describe properties of a text segment is too leaky even for very superficial usage. Aug 26 at 22:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .