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.45, released 30 Aug 2014. Three years is a long time, but there's a combination of stability and small user base at play. Details are in the CHANGES file and man pages.

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. Grap version 1.10 still works on it, but not all features are available.

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 publically 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.

Valid XHTML 1.0!
This page written and maintained by Ted Faber.
Please mail me any problems with, or comments about this page.
PGP Public Keys