# pgf/tikz vs metapost

Can the experts here comment on the pros and cons of these two languages? I have been using metapost for a long time and I was wondering if I should learn pgf/tikz also.

How does both languages compare as far as the programming ability goes? I mean the ability to create user defined functions.

I am a research student in engineering. So my requirement is drawing graphs/block diagrams/engineering figures etc.

-
That's a very general and open question. You know MetaPost well, perhaps have a look at pgf/TikZ and post a very specific question? For explanation, see: Gorilla vs. Shark. –  Stefan Kottwitz Nov 11 '11 at 22:30
I guess a look at the PGF manual can tell you about the power of TikZ/PGF. It starts with some very nice tutorials showing the general usage. –  Tobi Nov 11 '11 at 23:01
I have the same dilemma as @suresh. I need to draw a plethora of technical drawings (e.g., statistical distributions with annotations, graph theory concepts) and include them both into lecture notes created with LaTeX and into Beamer slides. I'm now struggling between MetaPost and TikZ/PGF too. –  Andrej Nov 13 '11 at 14:33
@suresh What I miss in MetaPost is better (i.e., fluent) integration with LaTeX documents. So I stay with TiKZ/PGF for now. –  Andrej Nov 17 '11 at 22:32
Metapost code can be easily integrated in LaTex documents using the gmp package ctan.org/pkg/gmp . –  mmj Apr 8 '13 at 14:08

For me, the main differences are:

• metapost is an external program, so you need more complicated processing or `\write18` calls; also, tikz pictures may be better integrated with the rest of the document (eg, they ingerit the fonts from their surroundings).
• metapost is an easier programming language (no problems with TeX parsing, macros, expansion etc.).
• metapost is better at drawing "nice" Bezier curves (you do not have to specify control points yourself).
• tikz seems to have larger library of dedicated routines for different tasks; also, it has quite a few built-in ways of specifying coordinates, shape and decoration libraries etc.
• tikz supports mainly pdf (in particular, transparencies); metapost had some problems with that (or with filling with patterns-but it was a long time ago I used it).
• on the other hand, metapost has the excellent metafun macro package by Has Hagen.
-
AFAIK with luaTeX metapost is not longer an external program. –  Schweinebacke Nov 13 '11 at 10:26
@Schweinebacke Metapost has been turned into a library and LuaTeX has some APIs to link to it. But only ConTeXt has support for these calls, up to now. –  egreg Nov 13 '11 at 10:41
Two recent packages allow for integration of Metapost into LaTeX (via shell-escape, of course): mpgraphics by Vafa Khaligi and gmp (it's a package of mine). –  egreg Nov 13 '11 at 10:43
It's portable so long as the final user has a TeX distribution not several years old and they give the `-shell-escape` option (or `-enable-write18` for MiKTeX; in the last version also MiKTeX knows `-shell-escape`) –  egreg Nov 13 '11 at 18:55
I endorse egreg's comment, gmp package (ctan.org/pkg/gmp) allows easy Metapost integration into LaTex. –  mmj Apr 8 '13 at 14:11