Grap is a language for typesetting graphs specified and first implemented by Brian Kernighan and Jon Bentley at Bell Labs. It is an expressive language for describing graphs and incorporating them in typeset documents. It is implemented as a preprocessor to Kernigan's pic language for describing languages, so any system that can use pic can use grap. For sure, TeX and groff can use it.

For some reason, when James J. Clark implemented groff, a free version of troff and associated tools, he didn't implement grap. I finally wanted to use it badly enough that I wrote it. The current version is 1.47, released 29 Dec 2023. This time only 3 years between releases, but there's a combination of stability and small user base at play. Details are in the CHANGES file and man pages.

And, hey, I've made the source available on github

If you have problems with grap, let me know.

I've compiled grap on FreeBSD, Linux, and Solaris, with appropriate versions of yacc, lex, C++, and the standard template library. Note that versions of g++ before 2.95 or so are no longer supported.

Bruce Lilly, brave soul that he is, has made it run using UWIN under Windows NT with g++ 2.95.1. Yeah, it surprised me, too. Bruce is quite the grap hero, having found several bugs and contributed the error reporting code. Not to be outdone, Kees Zeelenberg has compiled a version under Windows 98 that's publicly available. He has a full Windows version of groff and he's ported a bunch of other GNU utilities as well. Nelson Beebe at the University of Utah has compiled grap on many platforms from Apple's Darwin to HP/UX and counting. Avi Rubin reports that it compiles and runs on OS/X. Denny White has built and installed on OpenBSD.

The source is available, as well as some cool example output in gnuzipped postscript, pdf, or html.

This page written and maintained by Ted Faber.
Please mail me any problems with, or comments about this page.
Lunabase logo designed by and licensed from Roger Strunk
PGP Public Keys