[pstricks] Strange interaction between pst-lens and pst-fill

Herbert Voss LaTeX at zedat.fu-berlin.de
Mon Aug 21 16:06:45 CEST 2006


halbard7 at aol.com wrote:
> Please take a look at the following code: evidence of bugs or brain 
> damage? Troubled lines
> prefixed with %-> below. Using MikTeX 2.4 and dvips.

yes, that is a bit tricky here. However, I would use
a filling with lines, e.g. fillstyle=vlines; or a color.
And by the way: you shouldn't use macronames with one
letter; LaTeX uses this often for its own.

Herbert


\listfiles
\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pst-lens}
\usepackage{pst-fill}

\newcommand{\f}{\mathrm{f}}
\renewcommand{\d}[1]{\mathop{\mathrm{d}#1}\nolimits}
  %
\psset{unit=1.75cm}

\def\incircle{\pspicture(2mm,2mm)\psdot(1mm,1mm)\endpspicture}
%
\def\PSTBox{%
   \rput[lb](0,0){%
   \begin{minipage}{9cm}%
%  \rule{0pt}{5.25cm}%
       \pscustom[fillstyle=solid,fillcolor=black!10]{%
         \psline(0.5,0)(0.5,2.3)
         \psecurve(0,1.8)(0.5,2.3)(2,2.7)(3,2.4)(4.5,1.6)(5,1.5)
         \psline(4.5,1.6)(4.5,0)(0.5,0)}%
     \psaxes[labels=none,ticks=none]{->}(0,0)(-.2,-.2)(5,3)%
     \pscurve(0,1.8)(0.5,2.3)(2,2.7)(3,2.4)(4.5,1.6)(5,1.5)%
     \uput[r](5,1.5){$y=\f(x)$}\psline(2,0)(2,2.7)%
     \uput[d](2,0){$\d x$}\psdots(2,2.7)%
     \uput[ur](2,2.7){$(x,y)$}%
     \uput[d](0.5,0){$a$}\uput[d](4.5,0){$b$}%
     \uput[r](5,0){$x$}\uput[l](0,3){$y$}%
%    \psboxfill{\incircle}\psframe[fillstyle=boxfill](1.6,0)(2.3,1)%
     \psframe[fillstyle=solid,fillcolor=blue](1.65,0)(2.35,1)% alternative
     \psline(.95,0)(2.95,0)\psline(1.65,0)(1.65,1)\psline(2.35,0)(2.35,1)%
     \uput[d](1.65,0){$\mathstrut x$}\uput[d](2.35,0){$\mathstrut x+\d x$}%
\end{minipage}}}
\begin{document}

\psframebox[shadow=true]{%
\begin{pspicture}(-1,-1.5)(6.2,3.5)
\PSTBox%
\PstLens[LensSize=1.5,LensRotation=75,LensMagnification=1.5](2,0.2){\PSTBox}
\end{pspicture}}

\end{document}





More information about the PSTricks mailing list