[pstricks] postscript problem

David Arnold dwarnold45 at suddenlink.net
Sun Nov 6 08:16:53 CET 2011


Hi,

I have a number of the following in a latex file:

\usepackage{pstricks,pstricks-add}

\begin{equation*}
{\color{red}2\rnode[t]{A}{x}^2y}\,({\color{red}\rnode[t]{B}{x}^2}+xy-3y^2)={\color{red}2\rnode[t]{C}{x}^4y}+2x^3y^2-6x^2y^3
\end{equation*}
\ncbar[linecolor=red,angle=90,arm=10pt,nodesep=3pt]{->}{A}{B}
\ncbar[linecolor=red,angle=270,arm=10pt,nodesep=3pt]{->}{B}{C}


For some reason, when I compile this in Texshop using Tex and DVI option, it compile fine and shows up quite nicely in the resulting pdf file.

But if I try to compile this:

\usepackage{pstricks,pstricks-add,pst-node,pst-pdf}

\begin{equation*}
{\color{red}2\rnode[t]{A}{x}^2y}\,({\color{red}\rnode[t]{B}{x}^2}+xy-3y^2)={\color{red}2\rnode[t]{C}{x}^4y}+2x^3y^2-6x^2y^3
\end{equation*}
\ncbar[linecolor=red,angle=90,arm=10pt,nodesep=3pt]{->}{A}{B}
\ncbar[linecolor=red,angle=270,arm=10pt,nodesep=3pt]{->}{B}{C}

Then compile again, then I get this error:

! Incomplete \iffalse; all text was ignored after line 12.

Vice-versa, I also have some lines:

\usepackage{pstricks,pstricks-add}

\begin{postscript}
\begin{align*}
5\rnode{A}{u2} -10\rnode{B}{uw} -8\rnode{C}{u} +16\rnode{D}{w}
&=5u\,{\color{red}(u-2w)} -8\,{\color{red}(u-2w)}\\
\intertext{Now we note that we can factor a $u-2w$ out of both of these terms.}
&=(5u-8){\color{red}(u-2w)}
\end{align*}
\ncbar[linecolor=red,angle=270,arm=7pt,nodesep=3pt]{<->}{A}{B}
\ncbar[linecolor=red,angle=270,arm=7pt,nodesep=3pt]{<->}{C}{D}
\end{postscript}

Then I get this error:

! LaTeX Error: Environment postscript undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.9 \begin{postscript}

So I'm kinda stuck. Because of our system I'm winding up with both types of file in the same section of the text:

\begin{equation*}
{\color{red}2\rnode[t]{A}{x}^2y}\,({\color{red}\rnode[t]{B}{x}^2}+xy-3y^2)={\color{red}2\rnode[t]{C}{x}^4y}+2x^3y^2-6x^2y^3
\end{equation*}
\ncbar[linecolor=red,angle=90,arm=10pt,nodesep=3pt]{->}{A}{B}
\ncbar[linecolor=red,angle=270,arm=10pt,nodesep=3pt]{->}{B}{C}

\begin{postscript}
\begin{align*}
5\rnode{A}{u2} -10\rnode{B}{uw} -8\rnode{C}{u} +16\rnode{D}{w}
&=5u\,{\color{red}(u-2w)} -8\,{\color{red}(u-2w)}\\
\intertext{Now we note that we can factor a $u-2w$ out of both of these terms.}
&=(5u-8){\color{red}(u-2w)}
\end{align*}
\ncbar[linecolor=red,angle=270,arm=7pt,nodesep=3pt]{<->}{A}{B}
\ncbar[linecolor=red,angle=270,arm=7pt,nodesep=3pt]{<->}{C}{D}
\end{postscript}

I'm wondering if there is some way of compiling the file with both these types in the file?

David.


More information about the PSTricks mailing list