PSTricks - Graphics for T<span class="e">e</span>X and L<span class="a">a</span>T<span class="e">e</span>X


Welcome to the PSTricks web site

Basics
TUG logo

Main page

Index
Bug list
Documentation
Doc errors
Examples
2D Gallery
3D Gallery
Packages
References
CTAN
Search CTAN:
Germany
USA

Statistics

 


Extended translation of the the 5th edition

 


the 7th edition, total of 960 colored pages

 


2nd edition, 212 pages, includes 32 color pages

 


 


 


 


 


 

 

 


 


Base line |  Defining new PSTricks object |  Infix notation |  Objects |  Optional argument |  pspicture environment |  pspicture environment in a tabular |  Special Coordinates |  Units, typesetting | 


Infix notation
Mathematical expressions must by default written in the Postfix notation, also known as Reverse Polish Notation. pst-plot supports the Infix notation with the option algebraic. For more information have a look at the package pstricks-add


Origin and base line
With a pspicture environment the internal origin depends to the parameters of pspicture and LaTeX saves the space for this area and puts it on the base line of the current line. The lower left of the box is always identical to the TeX's current point. The box can be raised up and down by the optional parameter shift=<length> Without the pspicture environment the current text position is the origin and LaTeX saves no place, everything is drawn over the text.

baseline.png

Optional argument of the pspicture environment
With a pspicture environment the lower left of the box is on the current baseline. With an optional argument the baseline can be lifted up or down. This is in opposite to the behaviour of the \raisebox macro, where the box is shifted relative to the baseline.

pspicture1.png

Typesetting of units
There is a commen sense to typeset units always upright (http://physics.nist.gov/Document/typefaces.pdf). In Germany we use it in the following way:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{upgreek}
\begin{document}
\Huge
\[ 320\,\mathrm{mJ\,m\,K} \]
\[ 320\,\mathrm{mJ\cdot m \cdot K} \]
\[ \frac{3\,\textrm{eV}}{5\,\textrm{km}}\cdot 3\,\upmu\textrm{m} \]

\end{document}
With the package upgreek, greek letters like mu are also upright. For more information look at package SIUnits or read its documentation tex40.png.
New PSTricks objects

\psmoon
demo1.png
\def\psmoon{\pst@object{psmoon}}
\def\psmoon@i(#1)#2#3{%
  \begin@ClosedObj
    \pst@@getcoor{#1}%
    \pssetlength\pst@dima{#2}%
    \pssetlength\pst@dimb{#3}%
    \addto@pscode{
      \pst@coor /y ED /x ED 
      /r1 \pst@number\pst@dima def 
      /dr \pst@number\pst@dimb def
      /r2 dr dup mul r1 dup mul add sqrt def
      /alpha dr r1 atan neg def 
      /beta 180 alpha add neg def 
      x y r1 180 0 arc 
      x y dr add r2 alpha beta arcn
    }%
  \end@ClosedObj}
demo2.png

Special Coordinates *
The star * needs the command \SpecialCoor in your document to enable the handling of special coordinates. With the latest pstricks.tex version you can use the coordinate type ( f(x)), for example \psline(*3 x RadtoDeg sin). A line is drawn from (0,0) to (3,sin(3/pi*180).
SpecialCoor0.png

local time: Mon Dec 9 05:43:12 CET 2024 ; file is: 797.554490740741 days old
contact webmaster _at_ perce.de