[pstricks] PostScript code within PSTricks

Vinay Kanetkar vkanetka at uoguelph.ca
Mon Jun 11 19:49:00 CEST 2001


This may be trivial question for those familiar with Postscript 
but in following code I am trying to add 0.1 to argument. 
I am not having much success in do it. 

In particular, following line:
\rput(#1,! #2\space\a add}){\tiny 23.8\%}

Thanks for help.

Vinay Kanetkar
vkanetka at uoguelph.ca

Code begins:

\documentclass{article}
\usepackage[dvips]{graphics}     % From LaTeX distribution
\usepackage{pst-all}      % From PSTricks

\newpsobject{showgrid}{psgrid}{subgriddiv=1,griddots=10,gridlabels=6pt}
\textheight=23cm
\topmargin=-2cm
\textwidth=16cm
\oddsidemargin=0cm
\evensidemargin=0cm
\def\mydata1{.25}
\def\myang{35 45}
\def\a{.1}

\newcommand{\myline}[3]{%
\SpecialCoor
\psframe[linewidth=1pt,fillstyle=solid,fillcolor=#3](! #1 \mydata1\space
add 0)(! #1 \mydata1\space sub #2)
          \pscustom{ \SpecialCoor 
          %\rput(#1 ! #2\space\a add}){\tiny 23.8\%}  %%%%%%   This line
does not work. 
} 
}

\begin{document}

\begin{figure}[!htbp]
  \centering
\begin{pspicture}(0,0)(3,3)\showgrid
\myline{1}{1.376}{gray}

\psline{->>}(3; ! \myang\space add)

\end{pspicture}
\end{figure}
\end{document}



More information about the PSTricks mailing list