Beautiful Documents with Groff (Part II)
(You may want to read Part I first.)
Stephen Ramsay
When I first heard about Pandoc (I think somewhere around 2007 or 2008), it seemed like a “this-to-that” program. There are many such utilities on the Linux command line that convert things from one format to another, and such “Swiss Army knives”—a high honorific in hackerdom—frequently lie at the basis of much more ambitious endeavors. ImageMagick has been a secret weapon among graphics people for as long as I’ve been using computers, and it would not be an exaggeration to say that the entire film industry is a gentle wrapper around FFmpeg. There are other ways to do these things, of course, but such commands have the additional feature of being very fast (even before you realize, to your embarrassment, that the problem is embarrassingly parallel and therefore parallelizable with gnu parallel).
But Pandoc is a lot fancier than this, because it is
actually a sophisticated transpiler that converts the
underlying code for your document into an abstract
syntax tree (ast) (its own
“this” before generating a “that”). What’s more, it extends
Markdown just enough to provide useful clues for
the creation of beautiful documents. And since you can extend
and manipulate the ast in
Lua,1
you can easily write a custom converter to go from this to that
any way you like—for example, from Pandoc-flavored Markdown to
groff
. And that’s the way I’ve been doing things
for the last year or so. I write everything (class lectures,
articles, books, talks) in Markdown and mostly generate a
pdf with groff
. And
sometimes LaTeX. Or html. Or
(very occasionally) epub. I’ll
probably keep doing this for the foreseeable future, but as I
noted in Part I, this is all an
excellent form of procrastination. And doubly so when I look at
Typst (or, and this is really
when procrastination is becoming pathological) the entirely
delightful Pollen.
Pandoc was relatively new when I first encountered it in the late aughties, but let me be clear: I’m almost old enough to remember when ImageMagick was new (and no, I am not old enough to have witnessed the premier of Roff!). In my time, I have seen lots of would-be successors to LaTeX come and go. None have come close to unseating it, and I doubt any system ever will. LaTeX, after all, did not really “unseat” Roff in the way that ascii replaced ebcdic or C replaced B.
But Typst, I think, has legs. Not because it does some fancy thing of which LaTeX is incapable (that would be difficult at this point), but simply because writing in Typst feels—in the normative case, at least—far more like writing in Markdown than either LaTeX or Roff. That could change, of course; systems for doing complicated tasks rarely get simpler as they approach the lambent horizon at which All Things have been granted to All People. But Markdown is one of the more vivid examples of “worse is better,” and most (including me) love it precisely for its stupidity. I’ve been using html since the days when you could unironically put it on your resume; I still forget how to do this or that with it. I can’t remember the last time I forgot how to do something in Markdown, because there’s barely anything to remember. “Do I do headings with hashes? Or do you put hyphens underneath them?” Yes. Whatever.
ai is the future of writing (you weren’t expecting that were you?), because so far (in the history of the world) no thing that has made writing demonstrably easier has ever failed. Word processors are better than typewriters, which are better than fountain pens, which are better than dip pens, which are for damn sure better than quills and reed pens. People will quibble with you over whether they really are better, but they really are. Because when it comes to something as difficult as writing, the term “better” is always convertible with easier.
Word is easier than LaTeX. If it were as good at formulas and the more recherché aspects of typography as LaTeX, no one would bother. But LaTeX is not easier than Roff or Pollen. Typst seems to me easier than any of the systems that have come along at handling the more typical cases in which one needs to create beautiful documents. That is better.
It’s not quite there (at the time of this writing), but every time I output something from Markdown with Pandoc, I wonder at what point Typst might became my daily “this.”
Because that would be cool.
Incoming: Beautiful Documents with Groff (Part I) | home | blog | index
Keywords: LaTeX, groff, mom, Typst, typography, writing
Last Modified: 2024-11-15T14:11:45:-0600
-
Or Haskell, but Lua has the advantage of being the only language I was ever able to pick up without actually reading any documentation. I have played around with Haskell a bit, and it’s awfully clever, but maybe a bit too much so for day-to-day things. But really, if the creation of Haskell had resulted in nothing but Pandoc and ShellCheck, it would have been worth the journey.↩︎