[pstricks] global PS procedure for getting the current linewidth in correct units

Herbert Voss Herbert.Voss at FU-Berlin.DE
Thu Apr 17 15:23:22 CEST 2008


Christoph Bersch schrieb:

> is there a way to define a global PS procedure for getting the current 
> linewidth scaled to the correct units?

no

> I tried to do it using the snippet
> 
> \pst at Verb{/GetLW {CLW \pst at number\psxunit\space div} bind def}

use instead \def\GetLW

> at the beginning of the document, but this obviously fails when the unit 
> is changed within the document (shown in the example below). I could not 
> find any postscript equivalent to '\pst at number\psxunit'. Is there any, 
> or how can solve the problem?

\documentclass{article}
\usepackage{pstricks}
\SpecialCoor
\makeatletter
\def\GetLW{CLW \pst at number\psxunit div }
\makeatother
\begin{document}
\psset{unit=2cm}

\begin{pspicture}[showgrid=true](2,2)
    \psset{linewidth=1cm}
    \makeatletter
    \psdot[dotstyle=x](! CLW \pst at number\psxunit\space div 0)
    \psdot[dotstyle=+](! \GetLW 0)
    \makeatother
\end{pspicture}

\end{document}

Herbert




More information about the PSTricks mailing list