HOME

TheInfoList



OR:

PSTricks is a set of macros that allow the inclusion of
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 ...
drawings directly inside
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 ...
or
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 ...
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 ( de).


Basic usage

There is a wide array of commands available for making graphics. Coordinates in PSTricks are always represented in parentheses, as the following example (scaled) illustrates: \begin(5,5) %% Triangle in red: \pspolygon inecolor=red1,1)(5,1)(1,4) %% Bezier curve in green: \pscurve inecolor=green,linewidth=2pt,% showpoints=true5,5)(3,2)(4,4)(2,3) %% Circle in blue with radius 1: \pscircle inecolor=blue,linestyle=dashed3,2.5) \end


Extensions

PSTricks commands are low level, so many LaTeX packages have been made in order to ease the creation of several kinds of graphics that are commonly used on mathematical
typesetting Typesetting is the composition of text for publication, display, or distribution by means of arranging physical ''type'' (or ''sort'') in mechanical systems or '' glyphs'' in digital systems representing '' characters'' (letters and other ...
. pst-plot provides commands for creating
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-orie ...
graphs. Consider the following example: \begin(-7,-2)(7,2) \psaxes abels=none0,0)(-7,-2)(7,2) % sets up axis \psplot inecolor=blue, linewidth=1.5pt % plots the sinewave % notice the RPN expression \uput 53.1415926,0) % these are the labels \uput 0-1.570796,0) % \uput is a box positioned at ngle \uput 901.570796,0) % relative to (x,y) coordinate \uput 135-3.1415926,0) % and putting on the box \psline inewidth=1pt,linecolor=red,linestyle=dotted % red dotted lines (1.57079632,1)(1.57079632,0) \psline inewidth=1pt,linecolor=red,linestyle=dotted (-1.57079632,-1)(-1.57079632,0) \end The previous example also illustrate that TeX commands can be used as elements into the pictures. Since PostScript uses RPN style for mathematical operations, the argument to pst-plot must be supplied in the same form. An alternative is to use the optional argument ''algebraic'', then the formula can be described as an algebraic expression. pstricks-add extends pst-plot enabling also polar graphs and allowing the use algebraic notation for plots instead of RPN. pst-math provides
trigonometric Trigonometry () is a branch of mathematics concerned with relationships between angles and side lengths of triangles. In particular, the trigonometric functions relate the angles of a right triangle with ratios of its side lengths. The field ...
functions in
radian The radian, denoted by the symbol rad, is the unit of angle in the International System of Units (SI) and is the standard unit of angular measure used in many areas of mathematics. It is defined such that one radian is the angle subtended at ...
s (since PostScript defaults to using degrees) and hyperbolic trigonometric functions. pst-3dplot is used for creating 3D graphics like the following: multido provides basic loop functionality for programming graphs with repeating elements: pst-eucl is a beta extension for easy creation of
geometrical Geometry (; ) is a branch of mathematics concerned with properties of space such as the distance, shape, size, and relative position of figures. Geometry is, along with arithmetic, one of the oldest branches of mathematics. A mathematician w ...
drawings. There are many other extensions, for drawing
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,
barcode A barcode or bar code is a method of representing data in a visual, Machine-readable data, machine-readable form. Initially, barcodes represented data by varying the widths, spacings and sizes of parallel lines. These barcodes, now commonly ref ...
s,
graphs Graph may refer to: Mathematics *Graph (discrete mathematics), a structure made of vertices and edges **Graph theory, the study of such graphs and their properties * Graph (topology), a topological space resembling a graph in the sense of discre ...
,
trees 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 p ...
, visualizing data, etc.


Compatibility

PSTricks is only fully compatible with TeX systems using PostScript intermediates, including but not limited to eTeX and others. However, it is ''not'' compatible with the widely used pdfTeX engine in
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, ...
mode. As pdfTeX is the default engine in most current installations, users of PSTricks must either force pdfTeX to DVI mode or use auto-pst-pdf.
PGF/TikZ PGF/Ti''k''Z 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, ellipse ...
is an alternative to PSTricks that ''is'' compatible with pdfTeX.


Software which supports PSTricks output

*
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 ...
*
Interactive geometry software Interactive geometry software (IGS) or dynamic geometry environments (DGEs) are computer programs which allow one to create and then manipulate geometric constructions, primarily in plane geometry. In most IGS, one starts construction by putting a ...
: C.a.R.,
GeoGebra GeoGebra (a portmanteau of ''geometry'' and ''algebra'') is an interactive geometry, algebra, statistics and calculus application, intended for learning and teaching mathematics and science from primary school to university level. GeoGebra is a ...
, Kig *JPicEdt *
Mathematica Wolfram (previously known as Mathematica and Wolfram Mathematica) is a software system with built-in libraries for several areas of technical computing that allows machine learning, statistics, symbolic computation, data manipulation, network ...
* WinFIG * LaTeXPiX * gnuplot * LaTeXDraw * Dia


See also

* PSfrag *
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 ...
*
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 ...
* List of TeX extensions *
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 ...
*
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 ...
*
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 ...
for converting SVG images to PSTricks code. *
PGF/TikZ PGF/Ti''k''Z 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, ellipse ...
(Portable Graphics Format), an alternative
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 ...
package for programming graphics (also works with pdftex). *
CircuiTikZ CircuiTi''k''Z is a Ti''k''Z 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 ...


Further reading

* Herbert Voss; PSTricks – Grafik für TeX und LaTeX, 7th edition, DANTE e.V. and Lehmanns.media, 1008 pages, Heidelberg and Berlin 2016, . * Herbert Voss; PSTricks – Graphics for TeX and LaTeX, 1st edition, UIT, 916 pages, Cambridge 2011,
review in TUGboat


External links

* * PSTrick
documentation
* PSTrick
examples

LaTeXDraw
a free and
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
graphical editor generating PSTricks code, written in Java.
JPicEdt
another free and
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
graphical editor generating PSTricks code, written in Java.
LaTeXPiX
a freeware graphical editor generating (amongst others) PSTricks code, written for Windows OS. {{Vector graphics markup languages Free TeX software Macro programming languages PostScript