PGF/Ti''k''Z is a pair of languages for producing
vector graphics
Vector graphics are a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector displ ...
(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 Ti''k''Z is a set of higher-level macros that use PGF. The top-level PGF and Ti''k''Z commands are invoked as
TeX
Tex, TeX, TEX, may refer to:
People and fictional characters
* Tex (nickname), a list of people and fictional characters with the nickname
* Tex Earnhardt (1930–2020), U.S. businessman
* Joe Tex (1933–1982), stage name of American soul singer ...
macros, but in contrast with
PSTricks, the PGF/Ti''k''Z graphics themselves are described in a language that resembles
MetaPost. Till Tantau is the designer of the PGF and Ti''k''Z languages. He is also the main developer of the only known interpreter for PGF and Ti''k''Z, which is written in TeX. PGF is an acronym for "Portable Graphics Format". Ti''k''Z was introduced in version 0.95 of PGF, and it is a
recursive acronym
A recursive acronym is an acronym that refers to itself, and appears most frequently in computer programming. The term was first used in print in 1979 in Douglas Hofstadter's book '' Gödel, Escher, Bach: An Eternal Golden Braid'', in which Hofs ...
for "Ti''k''Z ist ''kein'' Zeichenprogramm" (German for "Ti''k''Z is ''not'' a drawing program").
Overview
The PGF/Ti''k''Z interpreter can be used from the popular
LaTeX
Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latices are found in nature, but synthetic latices are common as well.
In nature, latex is found as a wikt:milky, milky fluid, which is present in 10% of all floweri ...
and
ConTeXt
In semiotics, linguistics, sociology and anthropology, context refers to those objects or entities which surround a ''focal event'', in these disciplines typically a communicative event, of some kind. Context is "a frame that surrounds the event ...
macro packages, and also directly from the original
TeX
Tex, TeX, TEX, may refer to:
People and fictional characters
* Tex (nickname), a list of people and fictional characters with the nickname
* Tex Earnhardt (1930–2020), U.S. businessman
* Joe Tex (1933–1982), stage name of American soul singer ...
.
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
Portable document format (PDF), standardized as ISO 32000, is a file format developed by Adobe Inc., Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, computer hardware, ...
output driver.
Unlike PSTricks, PGF can thus directly produce either
PostScript
PostScript (PS) is a page description language and dynamically typed, stack-based programming language. It is most commonly used in the electronic publishing and desktop publishing realm, but as a Turing complete programming language, it c ...
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. PGF/Ti''k''Z comes with an extensive documentation; the version 3.1.4a of the manual has over 1300 pages.
The standard LaTeX
picture
environment can also be used as a front end for PGF by using the
pgfpict2e
package.
The project has been under constant development since 2005. Most of the development until 2018 was done by Till Tantau and since then Henri Menke has been the main contributor. Version 3.0.0 was released on 20 December 2013.
One of the major new features of this version was
graph drawing
Graph drawing is an area of mathematics and computer science combining methods from geometric graph theory and information visualization to derive two-dimensional depictions of graph (discrete mathematics), graphs arising from applications such ...
using the
graphdrawing
package, which however requires
LuaTeX
LuaTeX is a TeX-based computer typesetting system which started as a version of pdfTeX with a Lua (programming language), Lua scripting engine embedded. After some experiments it was adopted by the TeX Live distribution as a successor to pdfTeX (i ...
. This version also added a new data visualization method and support for direct
SVG output via the new
dvisvgm driver.
Export
Several graphical editors can produce output for PGF/Ti''k''Z, such as the
KDE
KDE is an international free software community that develops free and open-source software. As a central development hub, it provides tools and resources that enable collaborative work on its projects. Its products include the KDE Plasma gra ...
program Cirkuit and the math drawing program
GeoGebra. Export to Ti''k''Z is also available as extensions for
Inkscape
Inkscape is a vector graphics editor. It is used for both artistic and technical illustrations such as cartoons, clip art, logos, typography, diagrams, and flowcharts. It uses vector graphics to allow for sharp printouts and renderings at ...
,
Blender
A blender (sometimes called a mixer (from Latin ''mixus, the PPP of miscere eng. to Mix)'' or liquidiser in British English) is a kitchen and laboratory appliance used to mix, crush, purée or emulsify food and other substances. A stationary ...
,
MATLAB
MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...
,
matplotlib
Matplotlib (portmanteau of MATLAB, plot, and library) is a Plotter, plotting Library (computer science), library for the Python (programming language), Python programming language and its Numerical analysis, numerical mathematics extension NumPy. ...
,
Gnuplot,
Julia, and
R. The circuit-macros package of
m4 macros exports
circuit diagram
A circuit diagram (or: wiring diagram, electrical diagram, elementary diagram, electronic schematic) is a graphical representation of an Electrical network, electrical circuit. A pictorial circuit diagram uses simple images of components, whil ...
s to Ti''k''Z using the
dpic -g
command line option. The dot2tex program can convert files in the
DOT graph description language to PGF/Ti''k''Z.
Libraries
Ti''k''Z features
libraries
A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
for easy drawing of many kinds of diagrams, such as the following (alphabetized by library name):
*
3D drawing3d
*
Finite automata
A finite-state machine (FSM) or finite-state automaton (FSA, plural: ''automata''), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number ...
and
Turing machine
A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer algori ...
s
automata
*
Coordinate system
In geometry, a coordinate system is a system that uses one or more numbers, or coordinates, to uniquely determine and standardize the position of the points or other geometric elements on a manifold such as Euclidean space. The coordinates are ...
calculations
calc
*
Calendar
A calendar is a system of organizing days. This is done by giving names to periods of time, typically days, weeks, months and years. A calendar date, date is the designation of a single and specific day within such a system. A calendar is ...
s
calendar
* Chains:
node
In general, a node is a localized swelling (a "knot") or a point of intersection (a vertex).
Node may refer to:
In mathematics
* Vertex (graph theory), a vertex in a mathematical graph
*Vertex (geometry), a point where two or more curves, lines ...
s typically connected by edges and arranged in rows and columns
chain
*
Logic circuit
A logic gate is a device that performs a Boolean function, a logical operation performed on one or more binary inputs that produces a single binary output. Depending on the context, the term may refer to an ideal logic gate, one that has, for ...
and electrical
circuit diagram
A circuit diagram (or: wiring diagram, electrical diagram, elementary diagram, electronic schematic) is a graphical representation of an Electrical network, electrical circuit. A pictorial circuit diagram uses simple images of components, whil ...
s
circuits.logic
and
circuits.ee
*
Entity–relationship diagrams
er
*
Polygon folding diagrams
folding
*
Graph drawing
Graph drawing is an area of mathematics and computer science combining methods from geometric graph theory and information visualization to derive two-dimensional depictions of graph (discrete mathematics), graphs arising from applications such ...
with
automatic layout options
graphdrawing
*
L-system
An L-system or Lindenmayer system is a parallel rewriting system and a type of formal grammar. An L-system consists of an alphabet of symbols that can be used to make strings, a collection of production rules that expand each symbol into some ...
drawings
lindenmayersystems
* Sequences of basic math
operations
math
*
Matrices
Matrix (: matrices or matrixes) or MATRIX may refer to:
Science and mathematics
* Matrix (mathematics), a rectangular array of numbers, symbols or expressions
* Matrix (logic), part of a formula in prenex normal form
* Matrix (biology), the ...
matrix
*
Mind map
A mind map is a diagram used to visually organize information into a hierarchy, showing relationships among pieces of the whole. It is often based on a single concept, drawn as an image in the center of a blank page, to which associated represe ...
s
mindmap
*
Three-point perspective drawings
perspective
*
Petri net
A Petri net, also known as a place/transition net (PT net), is one of several mathematical modeling languages for the description of distributed systems. It is a class of discrete event dynamic system. A Petri net is a directed bipartite graph t ...
s
petri
*
Quantum circuit
In quantum information theory, a quantum circuit is a model for quantum computation, similar to classical circuits, in which a computation is a sequence of quantum gates, measurements, initializations of qubits to known values, and possibly o ...
s
quantikz
*
RDF semantic annotations (only in
SVG output)
rdf
* Special
shape
A shape is a graphics, graphical representation of an object's form or its external boundary, outline, or external Surface (mathematics), surface. It is distinct from other object properties, such as color, Surface texture, texture, or material ...
s and
symbol
A symbol is a mark, Sign (semiotics), sign, or word that indicates, signifies, or is understood as representing an idea, physical object, object, or wikt:relationship, relationship. Symbols allow people to go beyond what is known or seen by cr ...
s
shapes.geometric
and
shapes.symbols
*
Magnification
Magnification is the process of enlarging the apparent size, not physical size, of something. This enlargement is quantified by a size ratio called optical magnification. When this number is less than one, it refers to a reduction in size, so ...
of part of a graphic in an inset
spy
*
Paths in
SVG syntax
svg.path
*
Tree
In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, e.g., including only woody plants with secondary growth, only ...
s
trees
*
Turtle graphics
In computer graphics, turtle graphics are vector graphics using a relative cursor (the "turtle") upon a Cartesian plane (x and y axis). Turtle graphics is a key feature of the Logo programming language. It is also a simple and didactic way of d ...
turtle
*
Zooming and
panning
Pan or PAN may refer to:
Food
* Pan (cooking), a piece of cooking equipment
* Harina P.A.N., a pre-cooked corn meal
* Pan or Paan, a North Indian term for betel
Prefix
* ''Pan-'', a prefix meaning "all", "of everything", or "involving all ...
graphics
views
Gallery
The following images were created with Ti''k''Z 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.
File:Periodic-table-of-chemical-elements.sv
Periodic table of chemical elements
(libraries used: calc
, shapes
)
File:Rooty-helix.sv
Rooty helix
(library used: calc
)
File:LighthouseMap.pd
Mind map of ''To the Lighthouse''
(libraries used: mindmap
, shapes.misc
)
File:Lda-gauss-variance-big.sv
Plot of two normal distributed variables with big variance
(libraries used: arrows
, positioning
)
File:Hypersurface-3.sv
Hypersurface rendering
(libraries used: arrows
, calc
, decorations.markings
, intersections
, positioning
)
File:Bayesian-gaussian-mixture-vb.svg, Bayesian Gaussian mixture model (libraries used: arrows
, backgrounds
, calc
, fit
, matrix
, patterns
, plotmarks
, shadows
)
File:Capacitor equivalent circuits.svg, Capacitor equivalent circuits (library used: arrows
)
File:Batezbestekoak frogak eskema 001.pdf, Diagram showing different types of mean-tests (libraries used: arrows
, shapes
)
File:3d-gradient-colored.sv
Gradient plot of a function
(library used: arrows.meta
)
File:Csv-2d-gaussian-multivarate-distributions.sv
Multivariate Gaussian distributions
(libraries used: arrows
, positioning
)
File:Feed-forward-perceptron.sv
Feed-forward perceptron
(libraries used: arrows
, arrows.meta
)
File:Shield of the Trinity with the Four Relations.svg, Shield of the trinity with the four relations (libraries used: graphdrawing
, graphs
, quotes
)
File:English Length Units Graph.svg, English length units graph
English usually refers to:
* English language
* English people
English may also refer to:
Culture, language and peoples
* ''English'', an adjective for something of, from, or related to England
* ''English'', an Amish ter ...
File:Graph homomorphism into C5.svg, Graph homomorphism into C5 (library used: calc
)
File:Krausz-Partition 2.png, Subgraphs of the Krausz partition of a given line graph
File:Adjacencylist array of linkedlists undirectedgraph.svg, Adjacencylist of a graph implemented as array of linked lists (libraries used: arrows
, calc
, positioning
, shapes.multipart
)
See also
*
Asymptote (vector graphics language)
Asymptote is a descriptive vector graphics language – developed by Andy Hammerlindl, John C. Bowman (University of Alberta), and Tom Prince – which provides a natural coordinate-based framework for technical drawing. Asymptot ...
References
Further reading
*
Conference talk video(version archived by archive.org; the previous site is unavailable) based on an earlier version of that paper.
* Comparison of several graphics systems in LaTeX.
* According t
"It contains a detailed introduction to the TikZ suite—probably one of the best existing descriptions of this highly useful package."
External links
PGF/Ti''k''Zon
CTAN
C mathematical operations are a group of functions in the C standard library, standard library of the C programming language implementing basic mathematical functions. Different C standards provide different, albeit backwards-compatible, sets of ...
PGF/Ti''k''Z manualon
CTAN
C mathematical operations are a group of functions in the C standard library, standard library of the C programming language implementing basic mathematical functions. Different C standards provide different, albeit backwards-compatible, sets of ...
PGF/Ti''k''Z gallery at TeXample.net
{{DEFAULTSORT:Pgf Tikz
Cross-platform free software
Free TeX software
Graph description languages
Graph drawing software
Object-oriented programming languages
TeX SourceForge projects
Vector graphics markup languages