[pstricks] Accessing key/value parameters set using \psset in custom macros?
Richard Hensh
henshric at msu.edu
Wed Apr 27 00:38:04 CEST 2005
I'm trying to understand how to write more sophisticated PSTricks macros
using a format that has appeared in this list.
The following does not work as expected. How can I modify the macro \rjhLine
to ``apply'' all relevant styles that have been set using \psset (see
comments below)? Can someone point me in the right direction? I can't figure
it out!
Thanks
Ricky
\documentclass[10pt,dvips]{article}
\usepackage{calc}
\usepackage{pst-plot,pst-math,pstricks-add}%
%\RequirePackage{pst-xkey}
\makeatletter
\def\rjhLine{\pst at object{rjhLine}}
\def\rjhLine at i(#1,#2){%
\pst at killglue
\begingroup
\addbefore at par{linewidth=1.25pt,linecolor=red,arrowscale=1.25,arrows=->}%
% \addto at par{linewidth=1.25pt,linecolor=red,arrowscale=1.25}%
\use at par
%\the\pst at toks
%\the\toks@
\rjhLine at ii(#1,#2)
\endgroup
}
\def\rjhLine at ii(#1,#2){%
\psline(#1,#2)
}
\makeatother
\begin{document}
\def\xmin{-6}\def\xmax{6}
\def\ymin{-6}\def\ymax{6}
\begin{pspicture}(\xmin,\ymin)(\xmax,\ymax)
\rjhLine[linecolor=green](-1,2)
\psset{linecolor=blue}
\rjhLine(3,4) %%%Why isn't this line blue?
\end{pspicture}
\end{document}
More information about the PSTricks
mailing list