[pstricks] pstVerb

Poul Riis Poul.Riis at skolekom.dk
Tue Sep 2 22:05:04 CEST 2008


I'm very sorry to say that I have asked the following question before and
that I have forgotten the answer.
Ghostview comes with an error message when trying to show page two of the
document produced by the code below. As far as I remember the parameters
from pstVerb are no longer valid on page two....?

Yours,
Poul Riis



\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[danish]{babel}
\usepackage{helvet,mathptmx}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[dvips,svgnames,x11names]{xcolor}
\usepackage{pst-eucl}
\usepackage{pstricks-add}

\pagestyle{plain} \topmargin=-2cm \textwidth=16.5cm
\textheight=25cm \hoffset=-1cm \tolerance=5000 \hbadness=5000
\pretolerance=2500
\parindent      =    0em


\begin{document}
\psset{unit=10mm}
\pstVerb{/ax 3 def /ay 2 def /bx 2.5 def /by 4 def}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Fig 1
\begin{center}
\begin{pspicture}(-5,-1)(5,5)
\SpecialCoor
\pnode(!0 0){O}
\pnode(!ax ay){A}
\pnode(!bx by){B}
\pnode(!ay neg ax){C}
\pstRightAngle[linecolor=Green3]{A}{O}{C}
\ncline[linecolor=black,linestyle=solid]{->}{O}{A}
\naput[labelsep=-0.4,npos=0.5,nrot=:U]{$\vec{a}$}
\ncline[linecolor=black,linestyle=solid]{->}{O}{B}
\naput[labelsep=0.05,npos=0.5,nrot=:U]{$\vec{b}$}
\ncline[linecolor=Green3,linestyle=solid]{<-}{C}{O}
\naput[labelsep=-0.5,npos=0.5,nrot=:U]{\color{Green3}$\hat{\vec{a}}$}
\pstMarkAngle[MarkAngleRadius=.75,arrows=-,linecolor=blue,LabelSep=1.0]{A}{O}{B}{$\color{blue}v$}
\pstMarkAngle[MarkAngleRadius=1.5,arrows=->,linecolor=red,LabelSep=1.75]{A}{O}{B}{$\color{red}+$}
\end{pspicture}
\end{center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Fig 2
\begin{center}
\begin{pspicture}(-5,-1)(5,4)
\pnode(!0 0){O}
\pnode(!ax ay){A}
\pnode(!by neg bx){B}
\pnode(!ay neg ax){C}
\pstRightAngle[linecolor=Green3]{A}{O}{C}
\ncline[linecolor=black,linestyle=solid]{->}{O}{A}
\naput[labelsep=-0.4,npos=0.5,nrot=:U]{$\vec{a}$}
\ncline[linecolor=black,linestyle=solid]{<-}{B}{O}
\naput[labelsep=0.05,npos=0.5,nrot=:U]{$\vec{b}$}
\ncline[linecolor=Green3,linestyle=solid]{<-}{C}{O}
\naput[labelsep=-0.5,npos=0.5,nrot=:U]{\color{Green3}$\hat{\vec{a}}$}
\pstMarkAngle[MarkAngleRadius=.75,arrows=-,linecolor=blue,LabelSep=1.0]{A}{O}{B}{$\color{blue}v$}
\pstMarkAngle[MarkAngleRadius=1.5,arrows=->,linecolor=red,LabelSep=1.75]{A}{O}{B}{$\color{red}+$}
\end{pspicture}
\end{center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Fig 3
\begin{center}
\begin{pspicture}(-5,-4)(5,4)
\pnode(!0 0){O}
\pnode(!ax ay){A}
\pnode(!bx neg by neg){B}
\pnode(!ay neg ax){C}
\pstRightAngle[linecolor=Green3]{A}{O}{C}
\ncline[linecolor=black,linestyle=solid]{->}{O}{A}
\naput[labelsep=-0.4,npos=0.5,nrot=:U]{$\vec{a}$}
\ncline[linecolor=black,linestyle=solid]{<-}{B}{O}
\naput[labelsep=0.05,npos=0.5,nrot=:U]{$\vec{b}$}
\ncline[linecolor=Green3,linestyle=solid]{<-}{C}{O}
\naput[labelsep=-0.5,npos=0.5,nrot=:U]{\color{Green3}$\hat{\vec{a}}$}
\pstMarkAngle[MarkAngleRadius=.75,arrows=-,linecolor=blue,LabelSep=1.0]{B}{O}{A}{$\color{blue}v$}
\pstMarkAngle[MarkAngleRadius=1.5,arrows=<-,linecolor=red,LabelSep=1.75]{B}{O}{A}{$\color{red}-$}
\end{pspicture}
\end{center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Fig 4
\begin{center}
\begin{pspicture}(-5,-4)(5,5)
\pnode(!0 0){O}
\pnode(!ax ay){A}
\pnode(!by bx neg){B}
\pnode(!ay neg ax){C}
\pstRightAngle[linecolor=Green3]{A}{O}{C}
\ncline[linecolor=black,linestyle=solid]{->}{O}{A}
\naput[labelsep=-0.4,npos=0.5,nrot=:U]{$\vec{a}$}
\ncline[linecolor=black,linestyle=solid]{->}{O}{B}
\naput[labelsep=0.05,npos=0.5,nrot=:U]{$\vec{b}$}
\ncline[linecolor=Green3,linestyle=solid]{<-}{C}{O}
\naput[labelsep=-0.5,npos=0.5,nrot=:U]{\color{Green3}$\hat{\vec{a}}$}
\pstMarkAngle[MarkAngleRadius=.75,arrows=-,linecolor=blue,LabelSep=1.0]{B}{O}{A}{$\color{blue}v$}
\pstMarkAngle[MarkAngleRadius=1.5,arrows=<-,linecolor=red,LabelSep=1.75]{B}{O}{A}{$\color{red}-$}
\end{pspicture}
\end{center}
\end{document}




More information about the PSTricks mailing list