Overview | The picture Environment | The pstricks Package
LaTeX Graphics The pspicture Environment LaTeX Graphics


Unlike epic and eepic, the pstricks package brings with it its own environment, pspicture, with drawing commands different from those of the picture environment. A detailed description can be found in GOOSSENS, RAHTZ, MITTELBACH[2].

Remark. pdflatex cannot deal directly with commands of the pstricks package. The pictures in Section 3 were generated with the commands
latex \(\vert\) dvips \(\vert\) ps2pdf
and subsequently converted into png pictures. These were then imported with the \includegraphics command.

Line Segments and Circles

Regular polygon

Source file
This example illustrates how line segments of arbitrary slopes can be drawn within the pspicture environment. The command \psset{unit=3cm} sets the length unit to 3cm. (The pstricks default is 1cm.) The arguments (0, 0) and (2, 2) of \begin{pspicture} determine the upper left corner and the lower right corner of the picture. Line width ist set by

for the periphery, and by


for the diagonals.

The points \(P_i\quad(i=0,\,\dots,\,16)\) are determined by

x_i & = &\displaystyle 1+\cos\le...
... 1+\sin\left(i\cdot\frac{2\pi}{17}\right).


Source file
This example illustrates that pstricks allows the drawing of circles with arbitrary radii. The * after {pspicture} causes the picture to be clipped to the frame determined by (420, 420). The upper left corner not being mentioned, it defaults to (0, 0).

In the picture, a triangle is drawn with the inscribed and the circumscribed circle (solid), the three adjacent circles (dashed), and the nine point (Feuerbach) circle (dotted).

Loops and calculations

Source file
As this example shows, with the calc and the ifthen packages, LATEX assumes the capability of running through loops, taking decisions, and doing calculations. The * after {pspicture} causes the picture to be clipped to the frame determined by (100, 100). The upper left corner not being mentioned, it defaults to (0, 0).

A remark about latex2html

Unlike the latex command, the latex2html command expects all \psset commands to be placed within the pspicture environment. Otherwise, \psset is considered unknown. Thus the arguments of the \begin{pspicture} command always have to be given in the default unit, which is 1cm.

More Applications

The following examples are taken from GOOSSENS, RAHTZ, MITTELBACH[2], with slight variations. They are intended to give some hints as to the versatility of the pstricks package, and the related packages,

pstcol, pst-grad, pst-text, pst-node, pst-tree.

While the latex2html command is capable of processing pstricks commands, it cannot process pstcol, pst-grad, pst-text, pst-node, or pst-tree commands. Thus, we get the following overview:

  latex latex2html pdflatex
epic + + +
eepic + + -
pstricks + + -
pstcol,... + - -


Source file

Curved text

Source file


Source file


Source file

Family tree

Source file


M. Goossens, F. Mittelbach, A. Samarin The LATEX Companion

M. Goossens, S. Rahtz, F. Mittelbach The LATEX Graphics Companion

John D. Hobby, User's Manual, http://cm.bell-labs.com/who/hobby/

Alan Hoenig, TeX Unbound, OXFORD UNIVERSITY PRESS, 1998, ISBN 0-19-509685-1

Donald E. Knuth. The METAFONTbook. ADDISON-WESLEY, 1992, ISBN 0-201-13445-4 und ISBN 0-201-13444-6 (soft)

Leslie Lampert. LATEX - A Document Preparation System. ADDISON-WESLEY, 1994 (13th Printing November 2001), ISBN 0201529831

Helmut Kopka. LATEX - Eine Einführung. ADDISON-WESLEY, 1992, ISBN 3-89319-434-7

Helmut Kopka. LATEX - Erweiterungsmöglichkeiten. ADDISON-WESLEY, 1992, ISBN 3-89319-356-1

Keith Reckdahl, Using Imported Graphics in LaTeX2e,