[pstricks] With ps4pdf, it works, but not with pst-pdf

Vince McGarry vmcgarry at austin.rr.com
Sat Jun 18 16:53:09 CEST 2005


On Jun 18, 2005, at 6:32 AM, Paul Smith wrote:

> Thanks, Patrice, but how should I insert the parameters with
> \begin{pspicture}? Recall that I have:
>
> \pspicture(-1.1,-0.5)(5.2,2.5)
>

Hi Paul,

The following will work, but I use a version of ps4pdf that calls the  
preview package which appears to correct a problem I had been having  
with bounding boxes.

Vince

%-------------

\documentclass{minimal}

\usepackage{ps4pdf}

\PSforPDF{
\usepackage{pstricks}
\usepackage{pst-plot}
% \usepackage{pst-pdf}  % When using Rolf's script instead of Herb's
\usepackage{pstricks-add}
}
\begin{document}
\begin{center}
\def\f#1{#1 sqrt}
\PSforPDF{%
\psset{unit=1.5}
\begin{pspicture}(-1.1,-0.5)(5.2,2.5)
    \pscustom[fillstyle=solid,fillcolor=blue]{%
           \psline(1,0)(!1 \f{1})
           \psplot{1}{4}{\f{x}}
           \psline(!4 \f{4})(4,0)
           \psline(4,0)(1,0)
     }
     \psplot{0}{4.95}{\f{x}}
     \psaxes{->}(0,0)(-0.1,-0.1)(5,2.3)
     \rput(1.1,1.8){$f(x)=\sqrt{x}$}
     \uput[0](0,2.3){$y$}
     \uput[-90](5,0){$x$}
     %\uput[-90](1.08,0){$1$}
\end{pspicture}
}
\end{center}
\end{document}




More information about the PSTricks mailing list