[pstricks] Complex computations with Latex lengths

Denis Girou Denis.Girou at idris.fr
Sun Nov 25 20:48:48 CET 2001

>>>>> "Jay.Bloodworth" == Jay Bloodworth <jbloodworth at sc.rr.com> writes: 
    Jay.Bloodworth> I used the FP fixed-point arithmetic package a lot to do
    Jay.Bloodworth> within a document of where to put things. This works great
if all of 
    Jay.Bloodworth> the values used in the calculations are user supplied
values. But I 
    Jay.Bloodworth> have a situation where I need to measure the dimensions of
a box (using 
    Jay.Bloodworth> \settowidth) and then use that value in an FP
computation. Can anyone 
    Jay.Bloodworth> tell me how to get the value of a latex length register
into an FP
    Jay.Bloodworth> variable? 
    Jay.Bloodworth> I could probably also do what I need to if someone can
suggest a way to 
    Jay.Bloodworth> use the max (or min) of two latex lengths. 




% Return in #3 the minimum of the two lengths #1 and #2

% Return in #3 the maximum of the two lengths #1 and #2





\FPadd{\Result}{\strip at pt\LengthA}{\strip at pt\LengthB}
\typeout{The sum of `\the\LengthA' and `\the\LengthB' is `\Result'.}

\FPmin{\Result}{\strip at pt\LengthA}{\strip at pt\LengthB}
\typeout{The minimum of `\the\LengthA' and `\the\LengthB' is `\Result'.}


\typeout{The minimum of `\the\LengthA' and `\the\LengthB' is `\the\LengthC'.}


\typeout{The minimum of `\the\LengthA' and `\the\LengthB' is `\the\LengthC'.}

\typeout{The maximum of `\the\LengthA' and `\the\LengthB' is `\the\LengthC'.}


    Jay.Bloodworth> This is not a purely pstricks issue, but I this is the
best forum I know
    Jay.Bloodworth> to ask and I think it likely that other pstricks users
might sometime 
    Jay.Bloodworth> need to do something like this.

  Nevertheless, I clearly think personally that the interest of such mailing
lists is to concentrate on their specialized topics. For questions like your
one, the general Usenet comp.text.tex forum group would be a more appropriate


More information about the PSTricks mailing list