[pstricks] How to get this to work?

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Dec 22 10:32:05 CET 2009


Am 22.12.2009 01:45, schrieb David Arnold:

> \begin{equation*}
> \frac{#a}{#b}=\frac{#c}{n},
> \end{equation*}
> cross multiply.
> \begin{equation*}
> \psset{linecolor=red,nodesep=-15pt}
> \frac{\rnode{A}{a}}{\rnode{B}{b}}=\frac{\rnode{C}{c}}{\rnode{D}{d}}
> \ncline[arrows=->]{A}{D}\uput{20pt}[-20](D){\color{darkred}\text{Product
> of extremes}=ad}
> \ncline[arrows=->]{B}{C}\uput{20pt}[20](C){\color{darkred}\text{Product
> of means}=bc}
> \end{equation*}
> 
> We're compiling the document using a script. Here are the pertinent lines:
> 
>     system "latex --shell-escape $testbank-preview.tex";
>     system "dvips -o $testbank-preview-pics.ps $testbank-preview.dvi";
>     system "ps2pdf -dAutoRotatePages=/None $testbank-preview-pics.ps
> $testbank-preview-pics.pdf";
>     system "pdflatex $testbank-preview.tex";
> 
> How can I get the arrows in the above code snippet to show properly
> using our compilation method?

please provide always full working examples!

\documentclass{article}
\usepackage{pst-node,amsmath,pst-pdf}
\SpecialCoor
\colorlet{darkred}{red!80!black!80}
\pagestyle{empty}

\begin{document}

\begin{pspicture}(0,-1.75cm)(\linewidth,1.5cm)
\psset{linecolor=red,nodesep=-15pt}
\parbox{\linewidth}{%
\begin{align*}
\frac{\#a}{\#b}                   &= \frac{\#c}{n},
%
\intertext{cross multiply.}
%
\frac{\rnode{A}{a}}{\rnode{B}{b}} &= \frac{\rnode{C}{c}}{\rnode{D}{d}}
\ncline[arrows=->]{A}{D}\uput{20pt}[-20](D){\color{darkred}\text{Product
of extremes}=ad}
\ncline[arrows=->]{B}{C}\uput{20pt}[20](C){\color{darkred}\text{Product
of means}=bc}
\end{align*}}
\end{pspicture}

\end{document}


Herbert


More information about the PSTricks mailing list