Chapter 1. TeX
Prev | 1.4 Generic Packages | Next

## 1.4 Generic Packages

### 1.4.1 PiCTeX (tbd.)

tbd.

### 1.4.2 PSTricks

#### 1.4.2.1 Overview

The idea behind the PSTricks package of Timothy van Zandt is to provide most of the PostScript language in LaTeX and TeX syntax.

#### 1.4.2.2 Commands and Parameters

##### 1.4.2.2.1 Color

`\newgray{color}{num}` , `\newrgbcolor{color}{num1 num2 num3}` , `\newhsbcolor{color}{num1 num2 num3}` , `\newcmykcolor{color}{num1 num2 num3 num4}`

Note that these commands are obsolete for LaTeX. Load PSTricks with `\usepackage{pstcol}` and use the standard LaTeX color commands instead.

##### 1.4.2.2.2 Setting graphics parameters

`\psset{par1=value1,par2=value2,...}`

##### 1.4.2.2.3 Dimensions, coordinates and angles

`\pssetlength{cmd}{dim}`
`unit=dim, xunit=dim, yunit=dim, yunit=dim`

  Default: `1cm`

`\degrees[num]`
`\radians`

##### 1.4.2.2.4 Basic graphics parameters

`linewidth=dim`

  Default: `.8pt`

`linecolor=color`

  Default: `black`

`showpoints=true/false`

  Default: `false`

##### 1.4.2.2.5 Lines and polygons

`linearc=dim`

  Default: `0pt`

`framearc=num`

  Default: `0`

`cornersize=relative/absolute`

  Default: `relative`

`\psline*[par]{arrows}(x0,y0)(x1,y1)...(xn,yn)`
`\qline(coor0)(coor1)`
`\pspolygon*[par](x0,y0)(x1,y1)(x2,y2)...(xn,yn)`
`\psframe*[par](x0,y0)(x1,y1)`

##### 1.4.2.2.6 Arcs, circles and ellipses

`\pscircle*[par](x0,y0){radius}`
`\qdisk(coor){radius}`
`\pswedge*[par](x0,y0){radius}{angle1}{angle2}`
`\psellipse*[par](x0,y0)(x1,y1)`
`\psarc*[par]{arrows}(x,y){radius}{angleA}{angleB}`
`\psarcn*[par]{arrows}(x,y){radius}{angleA}{angleB}`
`arcsep=dim, arcsepA=dim, arcsepB=dim`

  Default: `0pt`

##### 1.4.2.2.7 Curves

`\psbezier*[par]{arrows}(x0,y0)(x1,y1)(x2,y2)(x3,y3)`
`\parabola*[par]{arrows}(x0,y0)(x1,y1)`
`\pscurve*[par]{arrows}(x1,y1)...(xn,yn)`
`\psecurve*[par]{arrows}(x1,y1)...(xn,yn)`
`\psccurve*[par]{arrows}(x1,y1)...(xn,yn)`
`curvature=num1 num2 num3`

  Default: `1 .1 0`

##### 1.4.2.2.8 Dots

`\psdots*[par](x1,y1)(x2,y2)...(xn,yn)`
`dotstyle=style`

  Default: `*`

  Dots: `*, o, +, triangle, triangle*, square, square*, pentagon, pentagon*, |`

`dotscale=num1 num2`

  Default: `1`

`dotangle=angle`

  Default: `0`

##### 1.4.2.2.9 Grids

`\psgrid(x0,y0)(x1,y1)(x2,y2)`
`gridwidth=dim`

  Default: `.8pt`

`gridcolor=color`

  Default: `black`

`griddots=num`

  Default: `0`

`gridlabels=dim`

  Default: `10pt`

`gridlabelcolor=color`

  Default: `black`

`subgriddiv=int`

  Default: `5`

`subgridwidth=dim`

  Default: `.4pt`

`subgridcolor=color`

  Default: `gray`

`subgriddots=num`

  Default: `0`

##### 1.4.2.2.10 Plots

`\fileplot*[par]{file}`
`\dataplot*[par]{commands}`
`\savedata{command}[data]`
`\readdata{command}{file}`
`\listplot*[par]{list}`
`\psplot*[par]{xmin}{xmax}{function}`
`\parametricplot*[par]{tmin}{tmax}{function}`
`plotstyle=style`

  Default: `line`

`plotpoints=int`

  Default: `50`

##### 1.4.2.2.11 Coordinate systems

`origin={coor}`

  Default: `0pt,0pt`

`swapaxes=true`

  Default: `false`

##### 1.4.2.2.12 Line styles

`linestyle=style`

  Default: `solid`

`dash=dim1 dim2`

  Default: `5pt 3pt`

`dotsep=dim`

  Default: `3pt`

`border=dim`

  Default: `0pt`

`bordercolor=color`

  Default: `white`

`doubleline=true/false`

  Default: `false`

`doublesep=dim`

  Default: `1.25\pslinewidth`

`doublecolor=color`

  Default: `white`

`shadow=true/false`

  Default: `false`

`shadowsize=dim`

  Default: `3pt`

`shadowangle=angle`

  Default: `-45`

`shadowcolor=color`

  Default: `darkgray`

`dimen=outer/inner/middle`

  Default: `outer`

##### 1.4.2.2.13 Fill styles

`fillstyle=style`

  Default: `none`

`fillcolor=color`

  Default: `white`

`hatchwidth=dim`

  Default: `.8pt`

`hatchsep=dim`

  Default: `4pt`

`hatchcolor=color`

  Default: `black`

`hatchangle=rot`

  Default: `45`

##### 1.4.2.2.14 Arrowheads and such

`arrows=style`

  Default: `-`

  Arrows: `-, <->, >-<, <<->>, >>-<<, |-|, |*-|*, [-], (-), o-o, *-*, oo-oo, **-**, c-c, cc-cc, C-C`

`arrowsize=dim num`

  Default: `2pt 3`

`arrowlength=num`

  Default: `1.4`

`arrowinset=num`

  Default: `.4`

`tbarsize=dim num`

  Default: `2pt 5`

`bracketlength=num, rbracketlength=num`

  Default: `.15`

`dotsize=dim num`

  Default: `.5pt 2.5`

`arrowscale=num1 num2`

  Default: `1`

##### 1.4.2.2.15 Custom styles

`\newpsobject{name}{object}{par1=value1,...}`
`\newpsstyle{name}{par1=value1,...}`

##### 1.4.2.2.16 The basics

`\pscustom*[par]{commands}`

##### 1.4.2.2.17 Parameters

`linetype=int`

  Default: `0`

##### 1.4.2.2.18 Graphics objects

`liftpen=0/1/2`

  Default: `0`

##### 1.4.2.2.19 Safe tricks

`\newpath`
`\moveto(coor)`
`\closepath`
`\stroke[par]`
`\fill[par]`
`\gsave`
`\grestore`
`\translate(coor)`
`\scale{num1 num2}`
`\rotate{angle}`
`\swapaxes`
`\msave`
`\mrestore`
`\openshadow[par]`
`\closedshadow[par]`
`\movepath(coor)`

##### 1.4.2.2.20 Pretty safe tricks

`\lineto(coor)`
`\rlineto(coor)`
`\curveto(x1,y1)(x2,y2)(x3,y3)`
`\rcurveto(x1,y1)(x2,y2)(x3,y3)`

##### 1.4.2.2.21 For hackers only

`\code{code}`
`\dim{dim}`
`\coor(x1,y1)(x2,y2)...(xn,yn)`
`\rcoor(x1,y1)(x2,y2)...(xn,yn)`
`\file{file}`
`\arrows{arrows}`
`\setcolor{color}`

##### 1.4.2.2.22 Pictures

`\pspicture*[baseline](x0,y0)(x1,y1)`
`\endpspicture`

##### 1.4.2.2.23 Placing and rotating whatever

`\rput*[refpoint]{rotation}(x,y){stuff}`
`\uput*{labelsep}[refangle]{rotation}(x,y){stuff}`
`\pslabelsep`
`labelsep=dim`

  Default: `5pt`

##### 1.4.2.2.24 Repetition

`\multirput*[refpoint]{angle}(x0,y0)(x1,y1){int}{stuff}`
`\multips{angle}(x0,y0)(x1,y1){int}{graphics}`

##### 1.4.2.2.25 Axes

`\psaxes*[par]{arrows}(x0,y0)(x1,y1)(x2,y2)`

  Horizontal | Vertical | Dflt | Description
  Ox=num | Oy=num | 0 | Label at origin.
  Dx=num | Dy=num | 1 | Label increment.
  dx=dim | oy=dim | 0pt | Dist btwn labels.

`labels=all/x/y/none`

  Default: `all`

`showorigin=true/false`

  Default: `true`

`ticks=all/x/y/none`

  Default: `all`

`tickstyle=full/top/bottom`

  Default: `full`

`ticksize=dim`

  Default: `3pt`

`\psxlabel, \psylabel`
`axesstyle=axes/frame/none`

  Default: `axes`

##### 1.4.2.2.26 Framed boxes

`framesep=dim`

  Default: `3pt`

`boxsep=true/false`

  Default: `true`

`\psframebox*[par]{stuff}`
`\psdblframebox*[par]{stuff}`
`\psshadowbox*[par]{stuff}`
`\pscirclebox*[par]{stuff}`
`\cput*[par]{angle}(x,y){stuff}`
`\psovalbox*[par]{stuff}`

##### 1.4.2.2.27 Clipping

`\clipbox[dim]{stuff}`
`\psclip{graphics} ... \endpsclip`

##### 1.4.2.2.28 Rotation and scaling boxes

`\rotateleft{stuff}`
`\rotateright{stuff}`
`\rotatedown{stuff}`
`\scalebox{num1 num2}{stuff}`
`\scaleboxto(x,y){stuff}`

##### 1.4.2.2.29 Nodes

`\rnode[refpoint]{name}{stuff}`
`\Rnode(x,y){name}{stuff}`
`\RnodeRef`
`\pnode(x,y){name}`
`\cnode*[par](x,y){radius}{name}`
`\circlenode*[par]{name}{stuff}`
`\cnodeput*[par]{angle}(x,y){name}{stuff}`
`\ovalnode*[par]{name}{stuff}`

##### 1.4.2.2.30 Node connections

`nodesep=dim`

  Default: `0`

`offset=dim`

  Default: `0`

`arm=dim`

  Default: `10pt`

`angle=angle`

  Default: `0`

`arcangle=angle`

  Default: `8`

`ncurv=num`

  Default: `.67`

`loopsize=dim`

  Default: `1cm`

`\ncline*[par]{arrows}{nodeA}{nodeB}`
`\ncLine*[par]{arrows}{nodeA}{nodeB}`
`\nccurve*[par]{arrows}{nodeA}{nodeB}`
`\ncarc*[par]{arrows}{nodeA}{nodeB}`
`\ncbar*[par]{arrows}{nodeA}{nodeB}`
`\ncdiag*[par]{arrows}{nodeA}{nodeB}`
`\ncdiagg*[par]{arrows}{nodeA}{nodeB}`
`\ncangle*[par]{arrows}{nodeA}{nodeB}`
`\ncangles*[par]{arrows}{nodeA}{nodeB}`
`\ncloop*[par]{arrows}{nodeA}{nodeB}`
`\nccircle*[par]{arrows}{node}{radius}`
`\pcline*[par]{arrows}(x1,y1)(x2,y2)`
`\pccurve*[par]{arrows}(x1,y1)(x2,y2)`
`\pcarc*[par]{arrows}(x1,y1)(x2,y2)`
`\pcbar*[par]{arrows}(x1,y1)(x2,y2)`
`\pcdiag*[par]{arrows}(x1,y1)(x2,y2)`
`\pcangle*[par]{arrows}(x1,y1)(x2,y2)`
`\pcloop*[par]{arrows}(x1,y1)(x2,y2)`

##### 1.4.2.2.31 Attaching labels to node connections

`\lput*[refpoint]{rotation}(pos){stuff}`
`\aput*[labelsep]{angle}(pos){stuff}`
`\bput*[labelsep]{angle}(pos){stuff}`
`\mput*[refpoint]{stuff}`
`\Aput*[labelsep]{stuff}`
`\Bput*[labelsep]{stuff}`

##### 1.4.2.2.32 Coils and zigzags

`\pscoil*[par]{arrows}(x0,y0)(x1,y1)`
`\psCoil*[par]{angle1}{angle2}`
`\pszigzag*[par]{arrows}(x0,y0)(x1,y1)`
`coilwidth=dim`

  Default: `1cm`

`coilheight=num`

  Default: `1`

`coilarm=dim`

  Default: `.5cm`

`coilaspect=angle`

  Default: `45`

`coilinc=angle`

  Default: `10`

`\nccoil*[par]{arrows}{nodeA}{nodeB}`
`\nczigzag*[par]{arrows}{nodeA}{nodeB}`
`\pccoil*[par]{arrows}(x1,y1)(x2,y2)`
`\pczigzag*[par]{arrows}(x1,y1)(x2,y2)`

##### 1.4.2.2.33 Special coordinates

`\SpecialCoor`

Table 1.12. Special coordinates and angles

Coordinate | Example | Description
(x,y) | (3,4) | Cartesian coordinate.
(r;a) | (3;110) | Polar coordinate.
(node) | (A) | Center of node.
([par]node) | ([angle=45]A) | Relative to node.
(!ps) | (!5 3.3 2 exp) | Raw PostScript.
(coor1|coor2) | (A|1in;30) | Combination.

Angle | Example | Description
num | 45 | Angle.
(coor) | (-1,1) | Coordinate (vector).
!ps | !33 sqrt | Raw PostScript.

`\NormalCoor`

##### 1.4.2.2.34 Overlays

`\overlaybox stuff\endoverlaybox`
`\psoverlay{string}`
`\putoverlaybox{string}`
`gradbegin=color`

  Default: `gradbegin`

`gradend=color`

  Default: `gradend`

`gradlines=int`

  Default: `500`

`gradmidpoint=num`

  Default: `.9`

`gradangle=angle`

  Default: `0`

##### 1.4.2.2.35 Typesetting text along a path

`\pstextpath[pos](x,y){graphics object}{text}`

##### 1.4.2.2.36 Stroking and filling character paths

`\pscharpath*[par]{text}`
`\pscharclip*[par]{text} ... \endpscharclip`

##### 1.4.2.2.37 Exporting EPS files

`\TeXtoEPS ... \endTeXtoEPS`
`\PSTtoEPS[par]{file}{graphics objects}`
`bbllx=dim`

  Default: `-1pt`

`bblly=dim`

  Default: `-1pt`

`bburx=dim`

  Default: `1pt`

`bbury=dim`

  Default: `1pt`

`headerfile=file`

  Default: `s`

`headers=none/all/user`

  Default: `none`

##### 1.4.2.2.38 Boxes

`\psmathboxtrue, \psmathboxfalse`
`\everypsbox{commands}`
`\pslongbox{name}{cmd}`
`\psverbboxtrue, \psverbboxfalse`

##### 1.4.2.2.39 Tips and More Tricks

`\pslbrace, \psrbrace`

#### 1.4.2.3 List of Additional PSTricks Packages

`psgo`
  Draw Go diagrams
`pst-blur`
  PSTricks package for "blurred" shadows
`pst-euc`
  Géométrie en LaTeX et PSTricks
`pst-fr3d`
  Three dimensional framed Boxes
`pst-ghsb`
  PSTricks package for HSB Gradients
`pst-gr3d`
  PSTricks package for 3D grids
`pst-lens`
  Optique géométrique
`pst-node`
  PSTricks package for nodes
`pst-ob3d`
  A PSTricks package for three dimensional basic objects
`pst-osci`
  Oscilloscopes with PSTricks
`pst-poly`
  Polygons with PSTricks
`pst-tree`
  PSTricks package for trees
`pst-uml`
  Draw easily diagrams with UML notation
`vaucansom.sty`
  Drawing automata

Prev | Up | Next
1.3 LaTeX Packages | Home | 1.5 `fontinst` (tbd.)