Typesetting Documents
Writing documents in something like LaTeX or groff is better than writing something in like Word. It gives you a lot more power than a regular rich-text formatting software. But the caveat with LaTeX and even pandoc is that installing LaTeX means that you are installating more than 2GB of packages in your system. Luckily, linux provides an inbuilt way to typeset documents, which is groff.
Introduction
groff or GNU Roff is a document formatting system primarily used to typeset man pages in linux. But this can also be used to typeset documents in pdf which is really cool. For non-unix systems, it is troff rather than groff which came before the latter.
Getting Started
Groff does not have a definite syntax. Instead, it uses macro packages which provide different syntax and use-cases.
For example, if you want to typeset a manpage, you will use the groff_man macro package which provides functions and useful tools that you will probably need when writing a manpage. We will use the groff_ms macro package because it is the most common, easy and provides a lot of functionality. You can always experiment with other macro packages later.
To start, create a file. This can be any name you like. I prefer to add the .ms extension at the end so that I can differentiate the file clearly. Also adding the extension also enables vim to detect the filetype which is really helpful. Now add the following lines in your file:
.TL
The title of the document
.AU
Tanush Banerjee
.NH
This is a header
.PP
This is a paragraph
This is what a basic groff document looks like. The .TL is used to specify the title of the document, .AU is used to specify the author of the document, .NH is used to create a numbered heading (default to level 1), .PP is used to create a new paragraph. Remember that the commands in groff are always in the start of a line.
Conclusion
Groff is a really cool and powerful document typesetting system. If you are looking for ways to typeset documents in a minimalist fashion, you should definitely give groff a try. These were just some of the basics. I will write more about this topic very soon. So stay tuned!