PGF/TikZ

Last updated
PGF/TikZ ("PGF and TikZ")
Original author(s) Till Tantau
Developer(s) Till Tantau, Christian Feuersänger
Stable release
3.1.10 [1] / 15 January 2023;13 months ago (15 January 2023)
Repository
Written in TeX, Lua
Operating system Multiplatform (TeX)
Type Vector graphics languages
License Dual License: GNU General Public License or LaTeX Project Public License
Website github.com/pgf-tikz/pgf

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").

Contents

Overview

The PGF/TikZ interpreter can be used from the popular LaTeX and ConTeXt macro packages, and also directly from the original TeX. [2] :116 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. [2] :117–120 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. [3] PGF/TikZ comes with an extensive documentation; the version 3.1.4a of the manual has over 1300 pages. [2]

The standard LaTeX picture environment can also be used as a front end for PGF — by merely using the pgfpict2e package. [2] :27

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

Export

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

Libraries

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

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

Related Research Articles

<span class="mw-page-title-main">LaTeX</span> Document preparation software system

LaTeX is a software system for typesetting documents. LaTeX markup describes the content and layout of the document, as opposed to the formatted text found in WYSIWYG word processors like Microsoft Word, LibreOffice Writer and Apple Pages. The writer uses markup tagging conventions to define the general structure of a document, to stylise text throughout a document, and to add citations and cross-references. A TeX distribution such as TeX Live or MiKTeX is used to produce an output file suitable for printing or digital distribution.

gnuplot Command-line and GUI plotting program

gnuplot is a command-line and GUI program that can generate two- and three-dimensional plots of functions, data, and data fits. The program runs on all major computers and operating systems . Originally released in 1986, its listed authors are Thomas Williams, Colin Kelley, Russell Lang, Dave Kotz, John Campbell, Gershon Elber, Alexander Woo "and many others." Despite its name, this software is not part of the GNU Project.

<span class="mw-page-title-main">Device independent file format</span> Typesetting file format

The device independent file format (DVI) is the output file format of the TeX typesetting program, designed by David R. Fuchs and implemented by Donald E. Knuth in 1982. Unlike the TeX markup files used to generate them, DVI files are not intended to be human-readable; they consist of binary data describing the visual layout of a document in a manner not reliant on any specific image format, display hardware or printer. DVI files are typically used as input to a second program which translates DVI files to graphical data. For example, most TeX software packages include a program for previewing DVI files on a user's computer display; this program is a driver. Drivers are also used to convert from DVI to popular page description languages and for printing.

MetaPost refers to both a programming language and the interpreter of the MetaPost programming language. Both are derived from Donald Knuth's Metafont language and interpreter. MetaPost produces vector graphic diagrams from a geometric/algebraic description. The language shares Metafont's declarative syntax for manipulating lines, curves, points and geometric transformations. However,

<span class="mw-page-title-main">Xfig</span> Vector graphics editor for UNIX-like systems

Xfig is a free and open-source vector graphics editor which runs under the X Window System on most UNIX-compatible platforms.

<span class="mw-page-title-main">Graphviz</span> Software package for graph visualization

Graphviz is a package of open-source tools initiated by AT&T Labs Research for drawing graphs specified in DOT language scripts having the file name extension "gv". It also provides libraries for software applications to use the tools. Graphviz is free software licensed under the Eclipse Public License.

DOT is a graph description language, developed as a part of the Graphviz project. DOT graphs are typically stored as files with the .gv or .dot filename extension — .gv is preferred, to avoid confusion with the .dot extension used by versions of Microsoft Word before 2007. dot is also the name of the main program to process DOT files in the Graphviz package.

<span class="mw-page-title-main">XyMTeX</span>

ΧyMTeΧ is a macro package for TeX which renders high-quality chemical structure diagrams. Using the typesetting system, the name is styled as XϒMTeX. It was originally written by Shinsaku Fujita. Molecules are defined by TeX markup.

<span class="mw-page-title-main">ConTeXt</span> General-purpose document processor, derived from TeX

ConTeXt is a general-purpose document processor. Like LaTeX, it is derived from TeX. It is especially suited for structured documents, automated document production, very fine typography, and multilingual typesetting. It is based in part on the TeX typesetting system, and uses a document markup language for manuscript preparation. The typographical and automated capabilities of ConTeXt are extensive, including interfaces for handling microtypography, multiple footnotes and footnote classes, and manipulating OpenType fonts and features. Moreover, it offers extensive support for colors, backgrounds, hyperlinks, presentations, figure-text integration, and conditional compilation. It gives the user extensive control over formatting while making it easy to create new layouts and styles without learning the low-level TeX macro language.

Cairo (graphics) Vector graphics-based software library

Cairo is an open-source graphics library that provides a vector graphics-based, device-independent API for software developers. It provides primitives for two-dimensional drawing across a number of different back ends. Cairo uses hardware acceleration when available.

PSTricks is a set of macros that allow the inclusion of PostScript drawings directly inside TeX or LaTeX source code. It was originally written by Timothy Van Zandt and has been maintained in recent years by Denis Girou, Sebastian Rahtz and Herbert Voss.

A number of vector graphics editors exist for various platforms. Potential users of these editors will make a comparison of vector graphics editors based on factors such as the availability for the user's platform, the software license, the feature set, the merits of the user interface (UI) and the focus of the program. Some programs are more suitable for artistic work while others are better for technical drawings. Another important factor is the application's support of various vector and bitmap image formats for import and export.

Beamer is a LaTeX document class for creating presentation slides, with a wide range of templates and a set of features for making slideshow effects.

<span class="mw-page-title-main">Asymptote (vector graphics language)</span> Descriptive vector graphics language

Asymptote is a descriptive vector graphics language – developed by Andy Hammerlindl, John C. Bowman, and Tom Prince – which provides a natural coordinate-based framework for technical drawing. Asymptote runs on all major platforms. It is free software, available under the terms of the GNU Lesser General Public License (LGPL).

<span class="mw-page-title-main">WinFIG</span> Proprietary shareware vector graphics editor application

WinFIG is a proprietary shareware vector graphics editor application. The file format and rendering are as close to Xfig as possible, but the program takes advantage of Windows features like clipboard, printer preview, multiple documents etc.

CircuiTi<i>k</i>Z

CircuiTikZ is a TikZ add-on for typesetting circuit diagrams in a TeX environment such as LaTeX. It was started by Massimo Redaelli in 2007 when he had to create exams at the Polytechnic University of Milan as a research assistant. After he left University in 2010 the project began to stumble. From 2015 on the further development mainly takes place at the Institute for Electronics Engineering of the Friedrich-Alexander-Universität Erlangen-Nürnberg.

<span class="mw-page-title-main">PlantUML</span> Open-source software tool

PlantUML is an open-source tool allowing users to create diagrams from a plain text language. Besides various UML diagrams, PlantUML has support for various other software development related formats, as well as visualisation of JSON and YAML files.

PyX is a Python package for the creation of PostScript, PDF, and static SVG files. It combines an abstraction of the PostScript drawing model with a TeX/LaTeX interface. Complex tasks like 2d and 3d plots in publication-ready quality are built out of these primitives. Its goals are similar to those of other metalanguages for PDF drawing, such as TikZ or Asymptote.

References

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

Further reading