[pstricks] Learning internals example (seeking docs, tutorials)

Michael Sharpe msharpe at ucsd.edu
Thu Mar 25 19:06:14 CET 2010


On Mar 25, 2010, at 10:32 AM, Herbert Voss wrote:

> Am 25.03.2010 06:48, schrieb Carsten Vogel (orphaned):
> 
>> (Does the latest edition of "PSTricks" cover that? I think I am two
>> editions late and would, of course buy a new copy if this topic is to be
>> found in there.)
> 
> chapter Grundlagen in the book
> 
>> but I want something like
>> \pspolygon(0,0)(0,\Height)(\Depth,\Height+\Depth)(\Width+\Depth,\Height+\Depth)
> 
> 
> \documentclass{minimal}
> \usepackage{pstricks,pst-node}
> \SpecialCoor
> \def\Height{1cm}
> \def\Depth{0.7cm}
> \def\Width{1cm}
> 
> \makeatletter
> \pst at getlength{\Height}\pskHeight
> \pst at getlength{\Depth}\pskDepth
> \pst at getlength{\Width}\pskWidth
> \makeatother
> 
> \begin{document}
> 
> \begin{pspicture}(0,0)(4,4)
> \makeatletter
> \pspolygon(0,0)(0,\Height)(!\pskDepth\space dup \pskHeight\space add
> \tx at UserCoor)%
>  (!\pskWidth\space \pskDepth\space add \pskHeight\space \pskDepth\space
> add \tx at UserCoor) %
>  (\Width,\Height)(\Width,0)
> \end{pspicture}
> 
> \end{document}


If you have the most recent pst-node, you an do this another way, using node expressions rather than PostScript code.

\documentclass{minimal}
\usepackage{pstricks,pst-node}
\SpecialCoor
\def\Height{1cm}
\def\Depth{0.7cm}
\def\Width{1cm}
\begin{document}
\pnode(0,\Height){A}
\nodexn{(A)+(\Depth,\Depth)}{B}
\nodexn{(B)+(\Width,0)}{C}
\begin{pspicture}(0,0)(4,4)
\makeatletter
\pspolygon(0,0)(A)(B)(C)
\end{pspicture}
\end{document}


More information about the PSTricks mailing list