[pstricks] pstVerb

Herbert Voss LaTeX at zedat.fu-berlin.de
Sun Apr 22 18:34:45 CEST 2007


Poul Riis wrote:
> But this time I cannot find out how to solve my problem.
> The example below works (even if it is a bit messy). However, if I
> uncomment the \newpage command in line 29 ghostview gives an error
> message. Well, the \newpage might be silly here but I simply cannot find
> out when it works and when it doesn't. I would like to understand what
> happens (if it's not just a stupid error such as a missing { but latex
> doesn't complain).
>
>
> \documentclass[11pt]{article}
> \usepackage[T1]{fontenc}
> \usepackage[ansinew]{inputenc}%
> \usepackage[english]{babel}
> \usepackage{amsmath,amssymb}
> \usepackage[svgnames,dvipsnames,x11names]{xcolor}
> \usepackage{pst-node,pst-eucl}
> \usepackage{pstricks-add}
>   
in general:
load pstricks-add _always_ as last PSTricks related package,
in this case after pst-func

> \usepackage{pst-func}
> \usepackage{geometry}
> \usepackage{graphicx}
> \usepackage[hang,small,it]{caption2}
> \usepackage{multido}
>
>
> \newcommand{\plotgraphwithoneparameter}[8]{%
> \pstVerb{/#3 #4 def /f {dup dup mul neg 1 add exch #4 add dup mul mul}
> def}%
> \psset{linecolor=#8}%
> \psplot[plotpoints=100]{#1}{#2}{x f}%
> \pnode(!#5 #5 f){Q}%
> \rput[tr](!#5 #6 add #5 f #7
> add){\rnode{P}{\color{#8}\psframebox[linecolor=#8]{$\beta=#4$}}}%{\psframebox{C=\C}}
> \ncarc[nodesep=1pt,linecolor=#8]{->}{P}{Q}%
> }
>
>   
\newcommand{\plotgraphwithoneparameter}[8]{%
  \pstVerb{
    tx at Dict begin
    /#3 #4 def
    /f { dup dup mul neg 1 add exch #4 add dup mul mul } def
    end
  }%
  \psset{linecolor=#8}%
  \psplot[plotpoints=100]{#1}{#2}{x f}%
  \pnode(!#5 #5 f){Q}%
  \rput[tr](!#5 #6 add #5 f #7 add){%
    \rnode{P}{\color{#8}\psframebox[linecolor=#8]{$\beta=#4$}}}
  \ncarc[nodesep=1pt,linecolor=#8]{->}{P}{Q}%
}

Herbert



More information about the PSTricks mailing list