[pstricks] How to use linecolor in text

Patrice MEGRET Patrice.MEGRET at umons.ac.be
Mon Apr 9 11:01:26 CEST 2018


Dear all,

I need to draw an alpha decay as a line from point (N,Z) to point (N-2,Z-2) with N=A-Z
To avoid typing all the coordinates, I use a pstricks object and a \pcline in such a way that I have just to give (A,Z) of the atom  and get the correct line taking into account the option [] and the arrows {}.
I have added \naput{#3} to add a text on the line.

%% the following commands work like \pcline with the optional argument [] and arrows {}
% \pmAlpDecay[opt]{arrows}(A,Z){text} draw alpha decay line from (A,Z)
% #1 = A
% #2 = Z
% #3 = text
\def\pmAlpDecay{\pst at object{pmAlpDecay}}
\def\pmAlpDecay at i{\pst at getarrows{\pmAlpDecay at ii}}
\def\pmAlpDecay at ii(#1,#2)#3{%
               \begin at OpenObj%
               \pcline(! #1 #2 sub #2)(! #1 #2 sub 2 sub  #2 2 sub)%
               \naput{#3}
\end at OpenObj}

It works well but I would like to put the text in the same color as linecolor by a command like \naput{\textcolor{\pslinecolor}{#3}} but  of course this is too simple to work. Is there a way to transform \pslinecolor in something that can be uses by \textcolor or should I do it directly at the postcscript level.

Best regards,
Patrice

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20180409/da2ece59/attachment.html>


More information about the PSTricks mailing list