Interact with this post using Mastodon or
What's Groff?
Published on
Around 2010, I used LaTeX to write scientific papers and my resume but it has been a struggle every single time I started working on a new document. The reason being that LaTeX has a quite steep learning curve and I forgot everything because I was not using it regularly enough.
Nowadays, I need LaTeX even less frequently but I still prefer to use this type of approach to write some documents when needed. Hence, I was looking for something “more accessible” without sacrificing of functionality. I know it looks like I was looking for the impossible… but then I came across Groff.
Before talking about Groff itself, let’s quickly add some context. Everything started with roff that was primarily designed for typesetting research papers and technical documents. Roff introduced the concept of macros, which allowed users to define reusable formatting commands, making it easier to structure and format documents.
╭── History of roff derivatives
nroff was introduced in the late 1970s. It’s a modified version of Roff specifically developed for the Unix operating system and became the standard text formatting language for Unix-based systems.
In the early 1980s, another variant called “troff” was developed. It introduced additional features and improvements, including support for more complex document structures, advanced typesetting capabilities, and the ability to generate output for different devices, such as printers and plotters.
Finally, Groff (short for “GNU troff”) is a free and open-source implementation of troff. It was developed as part of the GNU Project and released in the early 1990s. Groff expanded upon the capabilities of troff and added several enhancements, including improved font handling, better support for internationalization, and compatibility with modern operating systems.
Both Roff and Groff have been widely used in the Unix and Linux communities for typesetting and formatting various types of documents, including manuals, books, and technical papers. They have played a significant role in the development of document preparation systems and have influenced subsequent text formatting languages and tools.
╭── Why Groff better suits my needs
Simplicity: Groff’s syntax is more intuitive for formatting tasks.
Macros: As mentioned earlier, Roff introduced the concept of macros which let you define reusable formatting commands. This helps ensuring consistent formatting across a document, and facilitates formatting updates.
Speed: Groff is faster when processing documents.
LaTeX gained more popularity with the consequence to leave Groff with a smaller community so it may be more difficult to find help support. On the other hand, I personally encountered less difficulties with Groff (because of its simplicirty) and could resolve my issues quickly thanks to the complete and well written manual.
I have read that Groff may have limited advanced features for complex mathematical content. Not using them, I can’t comment this statement but this may be something to consider.
╭── The (neo)vim plugin you were expecting
A great (neo)vim plugin called vim-groff-viewer will show you the pdf output that will be updated as you work on your Groff file.
The github page lists Zathura, Evince, Okular, and Xreader as supported pdf viewers but it also works with sioyek . I have contacted the developer of this plugin who spent time to add sioyek support so hat tip to him! If you have any questions, feel free to reach out to him using this template . He truly care about his plugin that deserves to be more popular.
╭── Some examples of what Groff is capable of
-
Write an entire scientific paper
-
Basics to write a resume:
-
Do your bibliographies automatically in groff/troff:
-
The best place to get more information is always a nice written manual (text version , pdf version )
Thanks for your read. Hope it's been useful to you.
✄ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈
More food for thoughts? Check other posts about: #System #(Neo)vim