[pstricks] newbe problem with pst-xkey

Herbert Voss Herbert.Voss at FU-Berlin.DE
Mon Dec 7 19:33:04 CET 2009


Am 07.12.2009 18:47, schrieb Omer Moussaffi:
> I tried to compile from the pst-xkey examples:

yaou have to put code which contains a charcter & into
a \makeatletter ... \matheatother sequenz. And pst-xkey
is a special package for pstricks. You cannot use it
like the examples from xkeyval.

\documentclass{minimal}
\usepackage{multido,pst-xkey,pstricks}
\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

\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