[pstricks] \pst-getint{#1}

Herbert Voss Herbert.Voss at FU-Berlin.DE
Thu Feb 19 13:30:45 CET 2009


Shane Gibney schrieb:

> Am I using the correct packages. I am getting an error just after
> ...\pst at getint          {#1}....... but \pst at getint is a pstricks macro
> according to the pstricks documentation.
> 
> So why the error on compiling?

PSTricks uses a spcial feature of xkeyval, the package pst-xkey.
The reason why you should use always  \psset instead of \setkeys

\documentclass{article}
\usepackage{pstricks-add}

\makeatletter
\define at key[psset]{}{Start}{\pst at getint{#1}{\MultTable at Start}}
\define at key[psset]{}{End}{\pst at getint{#1}{\MultTable at End}}
\define at key[psset]{}{Value}{\pst at getint{#1}{\MultTable at Value}}
\psset{Start=1,End=5,Value=2}% Default values
% Main macro for "multiplication table" object
\def\MultTable{\def\pst at par{}\pst at object{MultTable}}
\def\MultTable at i{{%
  \use at par% Assignment of local parameters
  \pst at cnth=\MultTable at End
  \advance\pst at cnth-\MultTable at Start
  \advance\pst at cnth\@ne
  \multido{\iValue=\MultTable at Start+\@ne}{\pst at cnth}{%
    \pst at cntg=\iValue
    \multiply\pst at cntg\MultTable at Value
    \iValue$\times$\MultTable at Value = \the\pst at cntg
    \ifnum\multidocount=\pst at cnth\else; \fi}}}
\makeatother
\begin{document}
\MultTable

\MultTable[Value=9]

\psset{Value=6}
\MultTable[Start=6,End=11]

\MultTable[Start=19742,End=19742]
\end{document}

Herbert


More information about the PSTricks mailing list