TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been playing with TikZ for while, and now I want to dig a bit deeper and produce some reusable components for future references. There are certain syntax that are used in many examples on TikZ site. For example I saw a \foreach loop, couple variables here and there. So I wonder which programming language is used to write Tikz document?

share|improve this question
up vote 30 down vote accepted

TikZ/PGF simply uses TeX as programming language. TeX is not just a typesetting system but also a fully Turing-complete programming language. However, the typesetting background and the macro format makes it quite different than usual software programming languages.

If you don't now yet the exact difference between LaTeX and TeX then have a look at What are TeX and LaTeX?. Further information and book sources can be found in What is the best way to learn TeX?.

In addition TikZ/PGF uses the output format, either PDF, Postscript and SVG, IIRC, to draw the vector graphics.

share|improve this answer
Thanks for the info. There are tons of book for LaTeX, surprisingly I haven't found one that mentions about programming in TeX. I wonder if you could suggest a book that targets only on TeX programming? – Chan Oct 7 '12 at 7:08
There are some good TeX books around, some are even free. See What is the best way to learn TeX?. – Martin Scharrer Oct 7 '12 at 7:31
Thanks again. (1 more to go..) – Chan Oct 7 '12 at 7:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.