[pstricks] The psbezier anomaly within pscustom

Dwight Aplevich aplevich at uwaterloo.ca
Fri Aug 27 16:31:07 CEST 2010


Thank you for your reply (see below), and thank you for your
work on the powerful PSTricks package, which I have used for
a decade and a half.

At 06:00 AM 27/08/2010, you wrote:

>Today's Topics:
>
>    1. The psbezier anomaly within pscustom has re-emerged.
>       (Dwight Aplevich)
>    2. Re: The psbezier anomaly within pscustom has re-emerged.
>       (Herbert Voss)
>
>[...]
>Message: 2
>Date: Thu, 26 Aug 2010 22:17:26 +0200
>From: Herbert Voss <Herbert.Voss at FU-Berlin.DE>
>To: Graphics with PSTricks <pstricks at tug.org>
>Subject: Re: [pstricks] The psbezier anomaly within pscustom has
>         re-emerged.
>Message-ID: <4C76CBD6.6060206 at FU-Berlin.DE>
>Content-Type: text/plain; charset=ISO-8859-1
>
>Am 26.08.2010 20:20, schrieb Dwight Aplevich:
>
> > This behavior would seem to be a bug. The coordinate data defining a spline
> > depend on whether the path will be embedded in a \pscustom environment,
> > which may not be known when the coordinates are generated, and the first
> > segment may not be known.
> >
> > The following example illustrates the problem:
> >
> > \psset{unit=1in,cornersize=absolute,dimen=middle}%
> > \begin{pspicture}(0,0)(0.75,0.5)%
> > \pscustom[fillstyle=solid, linecolor=black, fillcolor=lightgray]{
> > \psline(0,0)(0,0.5)(0,0.5)(0.5,0.5)
> > \psbezier(0.5,0.5)(0.625,0.5)(0.75,0.375)(0.75,0.25)
> > \psline(0.75,0.25)(0.75,0)(0.75,0)(0,0)
> > }%
> > \end{pspicture}%
>
>the correct way inside a \pscustom is:
>
>\pscustom[fillstyle=solid, linecolor=red, fillcolor=lightgray]{
>   \psline(0,0)(0,0.5)(0,0.5)(0.5,0.5)
>   \psbezier(0.625,0.5)(0.75,0.375)(0.75,0.25)
>   \psline(0.75,0)(0.75,0)(0,0)
>}
>
>And without \pscustom
>
>\documentclass[]{book}
>\usepackage{pstricks}
>\begin{document}
>
>\psset{unit=1in,cornersize=absolute,dimen=middle}%
>\begin{pspicture}(0,0)(0.75,0.5)
>   \psline(0,0)(0,0.5)(0,0.5)(0.5,0.5)
>   \psbezier(0.5,0.5)(0.625,0.5)(0.75,0.375)(0.75,0.25)
>   \psline(0.75,0.25)(0.75,0)(0.75,0)(0,0)
>\end{pspicture}
>
>\end{document}
>
>Inside \pscustom the current point is always taken into account
>and you have to define with the liftpen setting what to do
>when the next line starts at another point.

The consequence is that coordinate arguments have to be changed depending on
1.  whether there is a current point;
2.  whether the command is within \pscustom;
3.  whether the command is \psbezier (or \pscurve);
4.  the version of PSTricks.

This means that
1.  legacy diagrams are broken, going back to the mid-1990s;
2.  the workflow for generating PSTricks code has to be changed.

Whether the new behavior is "correct" is a matter of opinion, perhaps,
but it certainly violates the principle of orthogonality in language design.
If it is just too difficult to change then that's a different matter, 
but I think
we disagree on the meaning of "always" and "correct" in this context.

You may know that I distribute the dpic interpreter that converts pic code
to PSTricks, among other formats.  The most recent changes were brought
to my attention by a user of that package.  For my part, I am working with
other authors on a new edition of a book in print, and I (and others) will have
to take the time to find a way to produce robust diagram code for several
current diagrams.

Thank you again for the reply.

Respectfully
Dwight Aplevich




More information about the PSTricks mailing list