[pstricks] bug in pstricks

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Sat Apr 3 19:14:30 CEST 2004


Could someone please so kind and confirm a bug
in pstricks with \msave and \mrestore?

The example only works with the redefinition
of \def\tx at MSave  and \def\tx at MRestore. Delete
this stuff and you should get an error.

Herbert


\documentclass[12pt]{article}
\usepackage{pst-plot}

\makeatletter
\def\tx at MSave{%
     /msavematrx
         [ tx at Dict /msavematrx known % does msavematrix exists?
             { msavematrx aload pop } if
             CM % matrix currentmatrix
         ]
     def
     msavematrx % missing in pstricks
}
\def\tx at MRestore{% atypo in pstricks with msavematrx
     tx at Dict /msavematrx known { length 0 gt } { false } ifelse
         { msavematrx aload pop setmatrix } if
}
\makeatother

\begin{document}

   \begin{pspicture}(3,4)
     \psgrid[subgriddiv=0,gridcolor=lightgray]
     \pscustom{%
       \translate(0,1.5)
       \psplot{0}{3}{x 180.0 mul 1.5 div sin}%
       \msave
         \translate(1,2)
         \scale{1 0.5}
         \psplot[liftpen=2]{-1}{2}{x 180.0 mul 1.5 div sin}
       \mrestore
       \psplot[liftpen=2]{0}{3}{x 180.0 mul 0.5 div cos}
     }
   \end{pspicture}

\end{document}



-- 
http://TeXnik.de/
http://PSTricks.de/




More information about the PSTricks mailing list