[pstricks] Macro problems...
Werner Grundlingh
wgrundlingh at gmail.com
Sat Dec 5 09:05:05 CET 2009
2009/12/4 Herbert Voss <Herbert.Voss at fu-berlin.de>:
> Am 05.12.2009 07:33, schrieb Werner Grundlingh:
>
> the makeatletter ... makeatother must be outside of a
> macro definition and by the way: there is a package pst-poly:
>
> \documentclass{article}
> \usepackage{multido}
> \usepackage{pst-poly,pstricks-add}
>
> \makeatletter%
> \newcommand\circulant{%
> \SpecialCoor \degrees[8]%
> \multido{\iN=0+1}{8}{%
> \cnode*[linecolor=black,fillcolor=black](2;\iN){2pt}{v\iN}% Draw the
> nodes/vertices
> }
> \multido{\iN=0+1}{8}{%
> \psforeach{\nA}{1,2}{%
> \pst at cntc=\iN
> \advance\pst at cntc by \nA
> \pst at mod{\pst at cntc}{8}\nextnode%
>
> \psline[linewidth=0.5pt,linestyle=solid,nodesep=-0.5pt](2;\iN)(2;\nextnode)
> }
> }%
> }
> \makeatother%
>
> \begin{document}
> \begin{pspicture}(-3,-3)(3,3)
> \circulant
> \end{pspicture}
>
> \newcommand\PstPolygonNode{\psdot(1;\INode)}
> \PstPolygon[unit=2,PolyNbSides=8]%
> \rput[lb](-4,0){\PstPolygon[unit=2,PolyNbSides=4]}%
> \rput[lb](-4,0){\PstPolygon[unit=2,PolyNbSides=4,PolyRotation=45]}%
>
> \end{document}
>
> Herbert
Thanks Herbert - another straight-forward solution... Werner
More information about the PSTricks
mailing list