- Source: PSTricks
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 (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:
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.
pst-plot provides commands for creating function graphs.
Consider the following example:
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 functions in radians (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 drawings.
There are many other extensions, for drawing Circuit diagrams, barcodes, graphs, trees, 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 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 is an alternative to PSTricks that is compatible with pdfTeX.
Software which supports PSTricks output
Inkscape
Interactive geometry software: C.a.R., GeoGebra, Kig
JPicEdt
Mathematica
WinFIG
LaTeXPiX
gnuplot
LaTeXDraw
Dia
See also
PSfrag
Asymptote (vector graphics language)
TeX
List of TeX extensions
LaTeX
PostScript
Inkscape for converting SVG images to PSTricks code.
PGF/TikZ (Portable Graphics Format), an alternative TeX package for programming graphics (also works with pdftex).
CircuiTikZ
Further reading
External links
Official website
PSTricks documentation.
PSTricks examples.
LaTeXDraw, a free and open source graphical editor generating PSTricks code, written in Java.
JPicEdt, another free and open source graphical editor generating PSTricks code, written in Java.
LaTeXPiX, a freeware graphical editor generating (amongst others) PSTricks code, written for Windows OS.