[pstricks] arrows no longer colored in \code blocks
Hensh, Richard
hensh at msu.edu
Tue Oct 11 21:49:24 CEST 2022
It must be inside \code. Here's a snippet of the code that I use. I can send you the complete file if you wish.
\multido{\ry=\ymin+\yInc}{\yCnt}{%
\multido{\rx=\xmin+\xInc}{\xCnt}{%
\pscustom{%
\translate(\rx,\ry)
\arrows{->}
\code{%
/p@ {4 mul} def %
/xCoord {\rx\space} bind def %
/yCoord {\ry\space} bind def %
/vec at Len {xCoord yCoord 2 copy M at xy 3 1 roll N at xy %
vec at norm dup 0 eq {pop 0.01} if} bind def %
vec at Len get at thk setlinewidth vec at Len get at col setrgbcolor %
0 0 moveto %
currentpoint %
xCoord yCoord 2 copy M at xy s at f mul 3 1 roll N at xy s at f mul %
vec at Len 3 mul dup 4 1 roll div 3 1 roll exch div exch %
ArrowB % get at thk setlinewidth %
lineto stroke %
}
}
}
}
________________________________
From: PSTricks <pstricks-bounces+hensh=math.msu.edu at tug.org> on behalf of Herbert Voss <Herbert.Voss at fu-berlin.de>
Sent: Tuesday, October 11, 2022 3:43 PM
To: pstricks at tug.org <pstricks at tug.org>
Subject: Re: [pstricks] arrows no longer colored in \code blocks
Am 11.10.22 um 21:12 schrieb Hensh, Richard:
> https://users.math.msu.edu/users/hensh/courses/234/fall2022/lectures/exam2/16.1.pdf
>
> Unfortunately, when I try to generate new vector fields, the arrows
> are no longer affected by my color selections. The MWE below is part
> of a \multido loop, and I need to set the arrow color to match the
> line color on-the-fly.
>
> The above code generates a red line with a black arrow. I must be able
> to do this within the \code block. Can you help?
>
Rick,
can you use it this way?
\documentclass{standalone}
\usepackage{pstricks-add}
\begin{document}
\psset{unit=30mm}
\begin{pspicture}(-2,-2)(2,2)
\pscustom[linewidth=2pt,arrowscale=1.5,linecolor=red]{% <---
\arrows{->}
\code{%
0 0 5 5 ArrowA
30 30 110 75 ArrowB
lineto
}
}
\end{pspicture}
\end{document}
or must it be asolutely inside \code?
Herbert
--
list: https://urldefense.com/v3/__https://lists.tug.org/pstricks__;!!HXCxUKc!2RdbwRBR_TuGR47BzjtvvST__06Z8Tn87JyLUmH0MmFZV0QS3AsZaBvbz7Z1BLpZ32KkPNrm8IIctTY5zsq7N0_NLhCA$
archive: https://urldefense.com/v3/__https://tug.org/pipermail/pstricks/__;!!HXCxUKc!2RdbwRBR_TuGR47BzjtvvST__06Z8Tn87JyLUmH0MmFZV0QS3AsZaBvbz7Z1BLpZ32KkPNrm8IIctTY5zsq7N5c-Jfqo$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/pstricks/attachments/20221011/9628c1af/attachment-0001.html>
More information about the PSTricks
mailing list.