[pstricks] Using Symbol postscript font in \addto at pscode

Buddy Ledger buddyledger at gmail.com
Thu Apr 23 04:57:32 CEST 2009


Does anyone know how to include postscript Symbol codes in a 
\addto at pscode{} object?  When I try to produce bracketswith this code:
0 0 moveto symbol10 (\050) show  % see full code below.
I get an undefined error on \050 latex thinks it's a token to be 
expanded.  I've tryed \noexpand and \verb anyone else know the answer?

Thanks in advance.
Buddy

\documentclass[]{article}

\usepackage{pst-all}
\usepackage{pst-func}
\usepackage{pstricks-add}
\usepackage{filecontents}

\begin{filecontents*}{datafile.dat}
Vc CH1DiaMT3 CH2DiaMS3 CH3DiaMT6 CH4DiaMS6
1.600000E+000 9.826193E+000 6.984904E+000 8.066498E+000 4.960284E+000
1.800000E+001 1.163769E+001 9.443092E+000 1.030773E+001 5.544281E+000
2.800000E+001 1.590967E+001 1.898143E+001 1.214513E+001 5.621518E+000
\end{filecontents*}

\makeatletter
\define at key[psset]{pst-func}{yShift}[0]{\def\psk at yShift{#1}}
\define at key[psset]{pst-func}{xyPlotLabels}[0]{\def\psk at xyPlotLabels{#1}}
\psset[pst-func]{yShift=0}
\psset[pst-func]{xyPlotLabels=0}
\def\psPrintCoor{\pst at object{psPrintCoor}}
\def\psPrintCoor at i(#1)#2#3{%
  \ifnum\psk at xyPlotLabels=1
  \begin at SpecialObj
  \use at par \pst at getcoor{#1}\pst at tempA
  \addto at pscode{
     /mfont {\psk at PSfont findfont \psk at fontscale scalefont setfont} bind def
     /s1 {/Symbol findfont \psk at fontscale scalefont setfont} bind def
     \pst at tempA pop \pst at number\psyunit div \psk at decimals -1 gt
     { 10   \psk at decimals exp dup 3 1 roll mul cvi exch div } if
     \psk at valuewidth string cvs /xcoor exch def
%
     #2 \pst at tempA pop \pst at number\psyunit div mul \psk at decimals -1 gt
     { 10   \psk at decimals exp dup 3 1 roll mul cvi exch div } if
     \psk at valuewidth string cvs /delx exch def
%
     \pst at tempA exch pop \pst at number\psyunit div \psk at decimals -1 gt
     { 10  \psk at decimals exp dup 3 1 roll mul cvi exch div } if
     \psk at valuewidth string cvs /ycoor exch def % save output
%
     #3 \pst at tempA exch pop \pst at number\psyunit div mul \psk at decimals -1 gt
     { 10   \psk at decimals exp dup 3 1 roll mul cvi exch div } if
     \psk at valuewidth string cvs /dely exch def
%
     \ifPst at comma        % do we have to change dot to comma
       0 1 xcoor length 1 sub {
         /Index exch def
         xcoor Index get 46 eq { xcoor Index 44 put } if
       } for
     \fi
     \ifPst at comma        % do we have to change dot to comma
       0 1 delx length 1 sub {
         /Index exch def
         delx Index get 46 eq { delx Index 44 put } if
       } for
     \fi
     \ifPst at comma        % do we have to change dot to comma
       0 1 ycoor length 1 sub {
         /Index exch def
         ycoor Index get 46 eq { ycoor Index 44 put } if
       } for
     \fi
     \ifPst at comma        % do we have to change dot to comma
       0 1 dely length 1 sub {
         /Index exch def
         dely Index get 46 eq { dely Index 44 put } if
       } for
     \fi
     newpath
     \psk at xShift\space \psk at yShift\space moveto s1 ([) show  %I want ( not [
     2 0 rmoveto mfont xcoor show
     #2 \pst at tempA pop \pst at number\psyunit div mul 0 ne {
     2 0 rmoveto s1 (+/-) show        %I want +- character Symbol \261
     2 0 rmoveto mfont delx show} if
     2 0 rmoveto s1 (,) show     
     2 0 rmoveto mfont ycoor show
     #3 \pst at tempA exch pop \pst at number\psyunit div mul 0 ne {
     2 0 rmoveto s1 (+/-) show        %I want +- character Symbol \261
     2 0 rmoveto mfont dely show} if
     2 0 rmoveto s1 (]) show   %I want ) not ] Symbol \051 gives 
undefined error
  }%
  \end at SpecialObj%
  \fi
}
\def\pserrorLine{\pst at object{pserrorLine}}
\def\pserrorLine at i(#1)#2#3{\begingroup
 \use at par \pst at getcoor{#1}\pst at tempA
 \def\ps at xErr{#2}\def\ps at yErr{#3}
 \if\ps at yErr 0\relax \else
 \psline(! /yDot \pst at tempA exch pop \pst at number\psyunit div def
      /xDot \pst at tempA pop \pst at number\psxunit div def
      xDot yDot yDot \ps at yErr\space mul add )
     (! /yDot \pst at tempA exch pop \pst at number\psyunit div def
      /xDot \pst at tempA pop \pst at number\psxunit div def
      xDot yDot yDot \ps at yErr\space mul sub )
 \fi
 \if\ps at xErr 0\relax \else
 \psline(! /yDot \pst at tempA exch pop \pst at number\psyunit div def
      /xDot \pst at tempA pop \pst at number\psxunit div def
      xDot xDot \ps at xErr\space mul add yDot )
     (! /yDot \pst at tempA exch pop \pst at number\psyunit div def
      /xDot \pst at tempA pop \pst at number\psxunit div def
      xDot xDot \ps at xErr\space mul sub yDot )
  \fi
\endgroup}

\newcounter{loopcount}
\def\GetCoordinates#1#2#3#4#5{%
\setcounter{loopcount}{0}


More information about the PSTricks mailing list