[pstricks] handling of units

Manfred Braun m.braun at uni-duisburg.de
Fri Dec 5 13:52:03 CET 2003


>Juergen Goebel <juergen.goebel at sysde.eads.net> wrote:

> Hi,
>
> there is a problem for me handling units in pstricks. Please have
> a look at the following example.
>
> \documentclass{article}
> \usepackage{pstricks}
> \begin{document}
>  \psset{unit=1mm}
>  \begin{pspicture}(0,0)(100,100)
>   \newlength{\mylength}
>   \setlength{\mylength}{10mm}
>   \psframe(0,0)(10,10)
>   \makeatletter
>   \psframe(0,0)(\strip at pt\mylength,\strip at pt\mylength)
>   \makeatother
>  \end{pspicture}
> \end{document}
>
> After using \strip at pt I get a frame, that is approx 2.83 times
> larger then I'd like it to be. So pstricks uses big points here,
> although the unit is set explicitly to 1mm. What do I have to do?

TeX converts lengths always to points.  Your length "\mylength" is 10mm =
0.3937in =  28.4527559pt.  The command "\strip at pt" gobbles the unit "pt" and
leaves the plain number 28.4527559 (I do not know, how many decimals are
taken).  Therefore your command is equivalent to
  \psframe(28.4527559,28.4527559)
and this is exactly what is displayed in the picture.

Manfred





More information about the PSTricks mailing list