I've started using plain vanilla groff (eg., no mom or other macro packages) for formatting text files. Just run: groff -Tascii example.groff
I've found it be perfect for my purposes. LaTeX felt like too much overhead for generating a few nice-looking README files and blog posts. I also have a soft spot for older UNIX / GNU tools.
The best sources of documentation (which did take some time to track down) are:
Thanks for sharing your groff file. I'm on a Debian derivative and running the below command did produce a pdf but the line "This paragraph should be right-justified and indented by th" was chopped off on the right side:
groff -Tpdf example.groff > example.pdf
Also, the left/right margins are partically non-existent (top/bottom margins look fine).
First point: the groff file in my gist is designed for plain-text files, so not all the functionality will exactly translate to PDF rendering.
Second point: to resolve the issue you're running into, remove these lines from the groff file to allow the default margins for PDF rendering to occur.
\# Set the line lenth to \nl
.ll \nl
There can occasionally be some strange behavior with the macros when different output devices are used (some options are ignored, some may have unexpected consequences). I took a look at the PDF output using my file directly, and it looks like the em sizing for gropdf is different from the grotty implementation, causing some overflow. (Maybe the font needs to be set explicitly before setting the line-length? Not sure).
The difference is the use of the ms macro package. That package generates page breaks and makes assumptions about the page size. -Tpdf will typeset your text using proportional fonts, justification and so on.
The previous poster's command generated nicely justified text in the terminal (or redirected to a file).
Did I miss any command-line option?