[pstricks] When to use metapost...when to use pstricks

Jean-Côme Charpentier Jean-Come.Charpentier at wanadoo.fr
Thu Jul 14 01:47:45 CEST 2005


Christopher Ellison wrote:
> I have a 'simple' question.  Pstricks is nice because I can have the 
> source for my figures directly in the source of my document

It's also possible with metapost.

> ...it is also 
> very nice because of the all powerful packages and tools that come with 
> pstricks.

Indeed.  The number of pstricks packages is *much* greater than the 
number of metapost packages.

> I have also seen metapost.  Is there any reason why I should 
> use metapost over pstricks?

Nobody force you to use metapost :-)

> Are there tasks that are easier to do with 
> metapost than with pstricks?

There is the node of the problem.  In fact, one can find examples more 
easy with metapost than with pstricks... and vice versa.
   Examples (for metapost):
     x = a + b;
     x = a - b;
metapost now knows that x = 2a and b = 0. Easy, isn't it ?  More 
generaly, metapost works easily with anything in the affin geometry (n 
equations with m variables, affin transformation, ...)

     z2 = 2/3[z0,z1];
makes the point z2 2/3 on the way z0 to z1.

     pickup pencircle scaled .1in yscaled .1 rotated 45;
produces lines as they would be draw with a real rectangular pen .1in 
width, 0.01in thick, rotated 45... like a calligraphic pen.

   Examples (for pstricks):
     \psline[linecolor=red]{|->}(1,2)(3,4)
Not difficult with metapost but so easy with pstricks

     \scalebox{2 1}{\Large \bfseries Foo}
More easy with pstricks. Especially when the user decide to change
   \documentclass{article}
with
   \documentclass[12pt]{article}
   \usepackage{mathptmx}
(With metapost he has to change the metapost file prambule.)

     \pstree[nodesepB=3p]{\Tcircle{X}}{%
       \TR{\tilde{\tilde{X}}}
       \TR{x}
       \TR{y}
     }
(example in pstricks documentation).
In fact, this last example is not easy to obtain with metapost nor 
pstricks. But it illustrates the good point for pstricks: number of 
packages (here pst-tree).

> If so, could you provide a couple of 
> examples?  I guess I was looking for a brief  "comparison" of these 
> approaches...and yes, I do understand that the opinion will be biased in 
> favor of pstricks (but I am okay with that...and I lean that way anyway).

I'm  not sure that examples are the right way to see difference between 
Metapost and pstricks.  I like both Metapost and Pstricks but 
programming styles are absolutely differents.

   Jean-Côme Charpentier




More information about the PSTricks mailing list