A PGF and TikZ examples gallery

  • Published 2006-11-12 (6 years, 6 months ago)

PGF and TikZ is a package for creating high quality illustrations for use with LaTeX, ConTeX or pure TeX. It is a package that deserves a larger user base. I've therefore created a gallery of examples with code and results. Its purpose is to showcase PGF/TikZ and hopefully be a useful learning resource.

A mosaic of examples from the PGF and TikZ gallery

Figure. A Mosaic of examples from the gallery

Motivation

I just recently started to use PGF/TIkZ actively. I've been a PSTricks fan for quite a while, but while working on my dot2tex tool I fell for PGF/TikZ 's clean and consistent design, excellent documentation and the fact that it works natively with PDFTeX.

PGF and its user friendly front end TikZ, has not been around as long as PSTricks and Metapost. It's therefore not as well known, and there are not that many resources for learning the package. The users guide is very good, with many examples. However, there are few online examples of illustrations made with PGF/TikZ. Here PSTricks excels, with a very large collection of examples available. Well, complaining is not very constructive, so I decided to create a gallery of examples myself. It was also a great opportunity to sharpen my Django skills.

At the moment most of the examples are from the PGF/TikZ manual. However, I'm planning to add more of my own illustrations. Hopefully others are willing to contribute examples as well. Contact me if you want to contribute!

Implementation

The gallery is made with the Django web framework. It is actually a mix of my dot2tex gallery and my notebook, so it didn't take long to put it together. The most challenging part was to create the build script for automatically updating the gallery. However, with the help of Python, the Django database API, PIL, Docutils, and Pygments, this was quite a simple task as well. Let me know if you are interested in the code.

Comments

  • #1 Nik, January 25, 2008 at 11:04 a.m.

    Heisann Kjell,

    great work. A friend of mine told me about TikZ and your website. It is excellent to get into TikZ using the examples as I find the documentation of TikZ not too useful.

    I am working on a flow chart. Now I have the problem, that it does not fit on one page. Is there any mechanism to make an automatic page break, when needed?

    Hilsen fra Tyskland Nik

  • #2 Kjell Magne Fauske, April 22, 2008 at 12:59 p.m.

    Thanks Nik. There is currently no mechanism in TikZ for automatic page breaking. I think it will be quite difficult to implement, but maybe you could split your chart into blocks and use some tricks to insert page breaks when necessary.

  • #3 Jason Geng, July 30, 2008 at 9:47 a.m.

    Great resource. Thank you.

  • #4 Michael Hallgren, November 18, 2008 at 4:13 p.m.

    Hello,

    Yes, a very useful package. Many thanks!

    Someone been looking into "the mechanism for automatic page breaking"?

    What "tricks" do you refer to above?

    Cheers,

    mh

  • #5 Kjell Magne Fauske, November 18, 2008 at 4:25 p.m.

    @Michael
    I have not yet heard about anyone trying to implement automatic page breaking for TikZ. I did not had any specific tricks in mind when I wrote the comment. Some package manages to split for instance tables across multiple pages. I don't know how they do it or if something similar can be used for a block diagram.

  • #6 Andrew, February 22, 2009 at 8:35 p.m.

    Hello, thank you very much for this resource!

    Can you explain, how can I make the page size to correspond size of the image on it as in examples on your site?

  • #7 Kjell Magne Fauske, February 22, 2009 at 9:01 p.m.

    Thanks Andrew.

    You can find an explanation in a recent comment over at TeXample.net

Comments are disabled for this entry