[texhax] newcommand with pstricks
Germain BOYER
germain.boyer at ac-toulouse.fr
Thu Jun 3 00:13:53 CEST 2010
Bonjour,
Look at this newcommand
%
\newcommand{\vect}[1]{\ensuremath{\overrightarrow{#1}}}
%
\newlength{\PSSCALyunit}
%
\newcommand{\scal}[1]{
\setlength{\PSSCALyunit}{\psyunit}
\psset{yunit=1mm , dotsize=0.75mm 0}
\hspace*{1.5mm} \psdot(0,0.75) \hspace*{1.5mm}
\psset{yunit=\PSSCALyunit}
}
%
exemple \vect{AB} \scal \vect{AC}
%
question : is it possible to write lines like \newlength{\PSSCALyunit} \setlength{\PSSCALyunit}{\psyunit} \psset{yunit=\PSSCALyunit}
to save and restore the default value of dotsize and tbarsize ?
Thanks for your answer.
For people interested , Look at this newcommand :
%
\newlength{\PSDOTXxunit}
%
\newcommand{\psdotx}[3][0.15]{
\setlength{\PSDOTXxunit}{\psxunit}
\psset{xunit=1cm}
\pnode#2{thenode}
\pstGeonode[PointSymbol=none , PointName=none](! \psGetNodeCenter{thenode} thenode.x #1 add \space thenode.y){thenodea}
\multido{\r=#3+90 , \ra=1+1}{4}
{
\pstRotation[PointSymbol=none , PointName=none , RotAngle=\r]{thenode}{thenodea}[thenode\ra]
\psline(thenode)(thenode\ra)
}
\psset{xunit=\PSDOTXxunit}
}
%
exemple : \psdotx[0.25]{(P)}{45} ou \psdotx{(1,3)}{30}
%
%
%
\newcommand{\psdotl}[3][0.15]{
\setlength{\PSDOTXxunit}{\psxunit}
\psset{xunit=1cm}
\pnode#2{thenode}
\pstGeonode[PointSymbol=none , PointName=none](! \psGetNodeCenter{thenode} thenode.x #1 add \space thenode.y){thenodea}
\multido{\r=#3+180 , \ra=1+1}{2}
{
\pstRotation[PointSymbol=none , PointName=none , RotAngle=\r]{thenode}{thenodea}[thenode\ra]
\psline(thenode)(thenode\ra)
}
\psset{xunit=\PSDOTXxunit}
}
%
%
Germain BOYER, germain.boyer at ac-toulouse.fr 02-06-2010
More information about the texhax
mailing list