<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Dear Herbert,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thank you so much.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
regards</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
rick<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> PSTricks <pstricks-bounces+hensh=math.msu.edu@tug.org> on behalf of Herbert Voss <Herbert.Voss@fu-berlin.de><br>
<b>Sent:</b> Wednesday, October 12, 2022 2:42 AM<br>
<b>To:</b> pstricks@tug.org <pstricks@tug.org><br>
<b>Subject:</b> Re: [pstricks] arrows no longer colored in \code blocks</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
Am 12.10.22 um 08:19 schrieb Herbert Voss:<br>
><br>
><br>
> Am 11.10.22 um 22:04 schrieb Hensh, Richard:<br>
>> Please see attached.<br>
><br>
> there is something wrong, because vec@norm is not defined!<br>
<br>
<br>
I used the already existing Pyth command and added only the with<br>
%%% <===  marked code line.<br>
<br>
\documentclass{article}<br>
\usepackage{xspace,xparse}<br>
\usepackage{mathtools}<br>
\usepackage{pstricks-add}<br>
\begin{document}<br>
<br>
     The radial field $ \textbf{rF} = x\textbf{i} + y\textbf{j} $<br>
<br>
     \bigskip<br>
<br>
     \psset{unit=30mm}<br>
     \makeatletter<br>
     \def\unitsPT{\strip@pt\psunit}<br>
     \def\scaleFactor{\strip@pt\psunit\space 2 mul 3 div}<br>
     \def\ps@check@tipcolor{}%%%%%%   <=======<br>
     \makeatother<br>
<br>
     \def\xInc{0.25}\def\xCnt{16}<br>
     \def\yInc{0.25}\def\yCnt{16}<br>
     \def\xmin{-2}\def\xmax{2}<br>
     \def\ymin{-2}\def\ymax{2}<br>
     \begin{pspicture*}(\xmin,\ymin)(\xmax,\ymax)%\showgrid<br>
     \pstVerb{%<br>
         /dist@len {max@len div dist@} def %<br>
         /get@col {dist@len dup low@int lt {1 low@int div mul 1} {dup<br>
         high@int lt {high@int sub low@int high@int sub div 1 exch}<br>
         {1 sub high@int 1 sub div 1 add 2 div 0} ifelse} ifelse 0} def %<br>
         /nstr 10 string def %<br>
         /showLength {/Times-Bold findfont 10 scalefont setfont nstr cvs <br>
show} def<br>
         /k@ {0.5} bind def %<br>
         /a@ {k@ med@ sub med@ dup 1 sub mul div} def %<br>
         /b@ {1 a@ sub} def %<br>
         /dist@ {dup a@ mul b@ add mul} def % ax^2 + bx<br>
         /max@thk {4} bind def %<br>
         /get@thk {dist@len 0.5 add 1.5 mul} def %<br>
%        /get@thk {dist@len 1 sub max@thk 1 sub mul 1 add} def %<br>
         %%<br>
         /M@xy {pop 1.25 div} def %<br>
         /N@xy {exch pop 1.25 div} def %<br>
         /max@len {2 sqrt} bind def % function of the vector field and <br>
Viewing Window<br>
         /med@ {1 2 sqrt div} def %<br>
         /low@int {0.35} bind def %<br>
         /high@int {0.75} bind def %<br>
         /s@f {\unitsPT\space 2 mul 3 div} def % scalefactor<br>
         }%<br>
         \psaxes{<->}(0,0)(\xmin,\ymin)(\xmax,\ymax)%<br>
         \multido{\ry=\ymin+\yInc}{\yCnt}{%<br>
         \multido{\rx=\xmin+\xInc}{\xCnt}{%<br>
             \pscustom[linewidth=1.5pt,arrowscale=1.0675]{%<br>
             \translate(\rx,\ry)<br>
             \arrows{->}<br>
             \code{%<br>
             /p@ {4 mul} def %<br>
             /xCoord {\rx\space} bind def %<br>
             /yCoord {\ry\space} bind def %<br>
             /vec@Len {xCoord yCoord 2 copy M@xy 3 1 roll N@xy %<br>
             Pyth % vec@norm<br>
             dup 0 eq {pop 0.01} if} bind def %<br>
             vec@Len get@thk setlinewidth vec@Len get@col setrgbcolor %<br>
             0 0 moveto<br>
             currentpoint<br>
             xCoord yCoord 2 copy M@xy s@f mul 3 1 roll N@xy s@f mul %<br>
             vec@Len 3 mul dup 4 1 roll div 3 1 roll exch div exch %<br>
             ArrowB % get@thk setlinewidth %<br>
             lineto stroke %<br>
             }<br>
             }<br>
         }<br>
         }<br>
     \end{pspicture*}<br>
<br>
\end{document}<br>
You do not need al the % at the line ends for PostScript. It is only <br>
important<br>
for TeX.<br>
<br>
Herbert<br>
</div>
</span></font></div>
</body>
</html>