2000. — 294 p.
This document is about METAPOST and TEX. The former is a graphic programming language, the latter a typographic programming language. However, in this document we will not focus on real programming, but more on how we can interface between those two languages. We will do so by using CONTEXT, a macro package written in TEX, where support for METAPOST is integrated in the core. The TEX macros are integrated in CONTEXT, and the METAPOST macros are bundled in MetaFun.
When Donald Knuth wrote his typographical programming language TEX he was in need for fonts, especially mathematical fonts. So, as a side track, he started writing METAFONT, a graphical language. When you read between the lines in the METAFONT book and the source code, the name John Hobby is mentioned alongside complicated formulas. It will be no surprise then, that, since he was tightly involved in the development of METAFONT, after a few years his METAPOST showed up.
While its ancestor METAFONT was originally targeted at designing fonts, METAPOST is more oriented to drawing graphics as used in scientific publications. Since METAFONT produced bitmap output, some of its operators make use of this fact. METAPOST on the other hand produces POSTSCRIPT code, which means that it has some features not present in METAFONT and vise versa.
With MetaFun I will demonstrate that METAPOST can also be used, or misused, for less technical drawing purposes. We will see that METAPOST can fill in some gaps in TEX, especially its lack of graphic capabilities. We will demonstrate that graphics can make a document more attractive, even if it is processed in a batch processing system like TEX. Most of all, we will see that embedding METAPOST definitions in the TEX source enables a smooth communication between both programs.
In this MetaFun manual we will demonstrate how you can embed graphics in a TEX document, but we will also introduce most of the features of METAPOST. For this reason you will see a lot of METAPOST code. For sure there are better methods to solve problems, but I have tried to demonstrate different methods and techniques as much as possible.
I started using METAPOST long after I started using TEX, and I never regret it. Although I like TEX very much, I must admit that sometimes using METAPOST is even more fun. Therefore, before we start exploring both in depth, I want to thank their creators, Donald Knuth and John Hobby, for providing me these fabulous tools.