How do PStricks and TikZ compare for ease of learning and for quality of API design?

Norman Ramsey picture Norman Ramsey · Apr 18, 2009 · Viewed 12.5k times · Source

My group uses Literate Programming for most of our source code---this means that internal documentation is written using LaTeX. We have been using PStricks for fancy technical diagrams of the system, but have recently been recommended to use TikZ. I've gathered this information:

  • TikZ/PGF is new and maintained; PStricks went a long time without a maintainer but has received some maintenance in the last couple of years.
  • TikZ works with many back ends, including (for those who care) pdftex. PStricks works only with dvips.
  • PStricks is more powerful and expressive than TikZ. In a dire emergency you even have the full power of PostScript.
  • PStricks has a significant ecology of extra packages that have been built on top of it; TikZ is too new to have many such things.
  • TikZ claims to have been designed "with the shortcomings of PStricks in mind." The author does not specify which shortcomings.

I'm interested in the answers to two questions. If you wish, feel free to post one answer per question:

  • What is the learning curve like for the two tools? (I consider PStricks to have a steep learning curve; about TikZ I am uninformed.)

  • Considered as programming APIs, is one of these two packages significantly better designed than the other? If so, which is the better design, and why? (What properties does it have that make you consider it better?)

To make a compelling argument why one API is better than another, you may want to resort to examples.

Answer

pts picture pts · May 1, 2009

Quick answer: I prefer TikZ to pstricks because I think TikZ

  • is better designed
  • is easier to learn
  • is compatible with pdftex
  • gives you more power and abstraction (you don't have to specify as many coordinates by hand)
  • lets you create more beautiful graphics with the same effort
  • it is easier to extend using TeX programming (it was designed from the ground up with extensibility in mind)

For the users of pstricks, I'd recommend writing all new documents using TikZ in the future. For the users of METAPOST, if their graphics don't use linear equation solving, I'd recommend TikZ. If the METAPOST graphics needs linear equation solving, I'd suggest trying Asymptote.

pstricks does indeed give you the power of PostScript, but it is not PostScript which makes your graphics authoring powerful, but it is abstraction: the use of automatic positioning, automatic intersection calculations, and display style templates. TikZ gives you powerful abstractions, even if you are not a programmer, or you are not willing to program this time.

I don't have experience writing TikZ extensions, but from a quick glimpse of the TikZ source code, it seems to be easy to understand and extend, compared to other TeX macro packages I came across.