Enjoying Open Source Software

Create presentation slides with Groff and mom

Groff and mom

Groff provides an excellent and fast way to produce nice documents from a flat text file.

Mom Macros for GNU Troff is a nice toolbox to create beautiful documents.

Groff is fast

One of the great advantages of using Groff is the almost instantaneous speed.

Of course you can create beautiful slides with LaTeX and Beamer, but the processing of LaTeX takes some time. Groff on the other hand, is lightning fast!

Presentation slides with Groff and mom

We can use Groff and mom to generate presentation slides.

The result is a PDF file that can be used with a advanced PDF viewer like qpdfview to present slides on a beamer.

In qpdfview use F12 to go full screen, and use the arrow keys to go forward or backward through the slides.

The mom format is not that complicated so you can learn it quickly.

Grom and mom is capable

The mom package provides for a step by step build up of the page, so that first some lines are shown, and the press of a button, additional lines comes up, and so on. See the documentation, look for the code word "PAUSE".

No UTF-8

One of the restrictions of Groff is, as far as I know, that it only supports standard ASCII. So you can't use UTF-8 characters.

No frills, simple setup

I don't need any fancy formatting stuff and prefer a simple way to create my slides.

I tried to create a sample mom file with as little as frills as possible. I started from an example file, see:

When reduced to the max, the slides are monochrome, just black and white. This was a bit too minimalist for me, so I went back one step and kept the colors.

This is a minimal example for a few slides:

.\" Make first slide black.  Remove if printing to save ink.
.po 0
.ll 11i
.DBX SOLID 0 \n[.l]u \n[.p]u

.TITLE "Title of the presentation"
.ds VENUE Event or venue\"
.ds DATE  2022-09-23\"
.ds AUTHOR T.Alker\"
  ASPECT 16:9 \
  HEADER "\*[VENUE]" "\*[$TITLE]" "\*[DATE]" \
  FOOTER "" "" "\*S[+2]\*[SLIDE#]\*S[-2]" \
  TRANSITION "Box 1 . O" \
  PAUSE "Wipe 1"
.SS +3
.NEWCOLOR darkred #aa0000
.NEWCOLOR darkred1 #900000
.NEWCOLOR blue1 #00007b
.NEWCOLOR blue2 #00006f
.NEWCOLOR code-grey GRAY 0.3
.XCOLOR cyan4
.XCOLOR green4
.HEADER_COLOR      darkred1
.FOOTER_RULE       off
  LEAD +8 \
  COLOR white
  COLOR blue2
  FONT B \
  SIZE 115 \
  COLOR code-grey
.PDF_IMAGE_FRAME "" 1 blue1
  "\*[$TITLE]" \
  "\*[VENUE], \*[DATE] \
.STRING hand \*[darkred]\[rh]\*[black]
.IB 8P
.HEADING 1 "First Slide"

Some text followed by an unordered list.

.SP .25v
First item
Second item
Third item
Last item
.SP .25v

.HEADING 1 "Second slide"

.HEADING 2 "With a subtitle"

Some line of text, explaining something.

Another line of text, just for fun.

.HEADING 1 "Last slide"

.HEADING 2 "Also with a subtitle"

.HEADING 3 "And even with a sub-subtitle !"

That was all! Now you have a minimal working set, to
start from.

Have fun !

Just put this in a file, let's say "".

Now run the command:

pdfmom > minimal-slided.pdf

And open the file "minimal-slided.pdf" in qpdfview.

The format is clear and easy. And of course, it is very easy to write an awk-script that converts a simple Markdown-ish or org-mode-ish file into a .mom file :)


⇽ Texinfo as Personal Knowledge Base Set filedate on photo according to EXIF ⇾