PGF/TikZ explained

PGF/TikZ ("PGF and
Author:Till Tantau
Developer:Till Tantau, Christian Feuersänger
Screenshot Alt:Example of graphics created with TikZ. Note the slightly translucent top layer.
Programming Language:TeX, Lua
Genre:Vector graphics languages
License:Dual License: GNU General Public License or LaTeX Project Public License
Operating System:Multiplatform (TeX)

PGF/TikZ is a pair of languages for producing vector graphics (e.g., technical illustrations and drawings) from a geometric/algebraic description, with standard features including the drawing of points, lines, arrows, paths, circles, ellipses and polygons. PGF is a lower-level language, while TikZ is a set of higher-level macros that use PGF. The top-level PGF and TikZ commands are invoked as TeX macros, but in contrast with PSTricks, the PGF/TikZ graphics themselves are described in a language that resembles MetaPost. Till Tantau is the designer of the PGF and TikZ languages. He is also the main developer of the only known interpreter for PGF and TikZ, which is written in TeX. PGF is an acronym for "Portable Graphics Format". TikZ was introduced in version 0.95 of PGF, and it is a recursive acronym for "TikZ ist kein Zeichenprogramm" (German for "TikZ is not a drawing program").

Overview

The PGF/TikZ interpreter can be used from the popular LaTeX and ConTeXt macro packages, and also directly from the original TeX.[1] Since TeX itself is not concerned with graphics, the interpreter supports multiple TeX output backends: dvips, dvipdfm/dvipdfmx/xdvipdfmx, TeX4ht, and pdftex's internal PDF output driver.[1] Unlike PSTricks, PGF can thus directly produce either PostScript or PDF output, but it cannot use some of the more advanced PostScript programming features that PSTricks can use due to the "least common denominator" effect.[2] PGF/TikZ comes with an extensive documentation; the version 3.1.4a of the manual has over 1300 pages.[1]

The standard LaTeX picture environment can also be used as a front end for PGF by using the pgfpict2e package.[1]

The project has been under constant development since 2005.[3] Most of the development until 2018 was done by Till Tantau and since then Henri Menke has been the main contributor.[4] Version 3.0.0 was released on 20 December 2013.[5] One of the major new features of this version was graph drawing using the graphdrawing package, which however requires LuaTeX.[6] This version also added a new data visualization method and support for direct SVG output via the new dvisvgm driver.[5]

Export

Several graphical editors can produce output for PGF/TikZ, such as the KDE program Cirkuit[7] and the math drawing program GeoGebra.[8] Export to TikZ is also available as extensions for Inkscape,[9] Blender,[10] MATLAB,[11] matplotlib,[12] Gnuplot,[13] Julia,[14] and R.[15] The circuit-macros package[16] of m4 macros exports circuit diagrams to TikZ using the dpic -g command line option.[17] The dot2tex program can convert files in the DOT graph description language to PGF/TikZ.[18]

Libraries

TikZ features libraries for easy drawing of many kinds of diagrams, such as the following (alphabetized by library name):[1]

Gallery

The following images were created with TikZ and show some examples of the range of graphic types that can be produced. The link in each caption points to the source code for the image.

See also

Further reading

External links

Notes and References

  1. Web site: The TikZ and PGF Packages: Manual . CTAN.org . 2019-06-17.
  2. Web site: 17. The TikZ and PGF Packages: Manual for version 2.10. CTAN.org. Till Tantau. 20 February 2008. 6 May 2010. dead. https://web.archive.org/web/20110109090729/https://www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf. 9 January 2011.
  3. Web site: Commits – pgf-tikz/pgf . GitHub.com . 2019-06-17.
  4. Web site: Contributors to pgf-tikz/pgf . GitHub.com . 2019-06-17.
  5. Web site: PGF and TikZ – Graphic systems for TeX – Browse /pgf/version 3.0.0 . SourceForge.net . 2013-12-20 . 2019-06-17.
  6. 10.7155/jgaa.00301 . Graph Drawing in TikZ . Journal of Graph Algorithms and Applications . 2013 . 17 . 4 . 495–513 . Till . Tantau. free . See also the older GD 2012 presentation by Tantau.
  7. Web site: Cirkuit . Matteo . Agostinelli . 31 December 2011 . uni-klu.ac.at . 2019-06-17.
  8. Web site: Export to LaTeX (PGF, PSTricks) and Asymptote – GeoGebra Manual . wiki.geogebra.org . 2019-06-17.
  9. Web site: svg2tikz: An Inkscape extension for exporting SVG paths as TikZ/PGF paths . GitHub.com . 2019-06-17.
  10. Web site: blend2tikz: Export Blender (2.4x) curves to TikZ format for use with TeX . GitHub.com . 2019-06-17.
  11. Web site: matlab2tikz – File Exchange – MATLAB Central . Nico . Schlömer . MathWorks.com . 2019-06-17.
  12. Web site: tikzplotlib: Convert matplotlib figures to TikZ/PGFplots for smooth integration into LaTeX . Nico . Schlömer . GitHub.com . 2019-06-17.
  13. Web site: gnuplot 5.2: An Interactive Plotting Program . Thomas . Williams . Colin . Kelley . October 2018 . gnuplot.info . 2019-06-17.
  14. Web site: Julia plotting backends. docs.juliaplots.org. Thomas . Breloff. 2024-02-27.
  15. Web site: tikzDevice: R Graphics Output in LaTeX Format . cran.r-project.org . 2019-06-17.
  16. Web site: circuit-macros – M4 macros for electric circuit diagrams . 15 April 2020 . CTAN.org.
  17. Web site: dpic README . Dwight . Aplevich . 3 January 2020 . ece.uwaterloo.ca . 15 April 2020.
  18. Web site: dot2tex – A Graphviz to LaTeX converter . dot2tex.readthedocs.io . 2019-11-01.