[pstricks] Works except in style file

Patrice MEGRET Patrice.MEGRET at umons.ac.be
Tue Apr 10 08:21:50 CEST 2018


Dear Herbert,

I have still two problems :

When the option [] is empty there is no default value to \pslinecolor so the system stops ==> I added a line \psset{linecolor=black} before  \begin at OpenObj to solve this issue. (see code at the end of this mail)

When I move this code to my style file, I get an error from xcolor:

Package xcolor Error: Undefined color `pmAlpDecay'.

! Argument of \c at lor@to at ps has an extra }.
<inserted text>
                \par
l.27 \pmAlpDecay{->}(6,3){text}

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
\\color at gray 0 \@@ \fi \space \space
! Paragraph ended before \c at lor@to at ps was complete.
<to be read again>
                   \par
l.27 \pmAlpDecay{->}(6,3){text}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.


! Package xcolor Error: Undefined color model `y'.

See the xcolor package documentation for explanation.
Type  H <return>  for immediate help.
...

l.27 \pmAlpDecay{->}(6,3){text}

Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Undefined control sequence.
\@@tmp ->\@nil

l.27 \pmAlpDecay{->}(6,3){text}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Argument of \c at lor@to at ps has an extra }.
<inserted text>
                \par
l.27 \pmAlpDecay{->}(6,3){text}

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
\\color at gray 0 \@@ \fi \space \space
! Paragraph ended before \c at lor@to at ps was complete.
<to be read again>
                   \par
l.27 \pmAlpDecay{->}(6,3){text}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Argument of \c at lor@to at ps has an extra }.
<inserted text>
                \par
l.27 \pmAlpDecay{->}(6,3){text}

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
grestore\space
! Paragraph ended before \c at lor@to at ps was complete.
<to be read again>
                   \par
l.27 \pmAlpDecay{->}(6,3){text}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.


! Package xcolor Error: Undefined color `pmAlpDecay'.

See the xcolor package documentation for explanation.
Type  H <return>  for immediate help.
...

l.27 \pmAlpDecay{->}(6,3){text}

Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Argument of \c at lor@to at ps has an extra }.
<inserted text>
                \par
l.27 \pmAlpDecay{->}(6,3){text}

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
grestore\space
! Paragraph ended before \c at lor@to at ps was complete.
<to be read again>
                   \par
l.27 \pmAlpDecay{->}(6,3){text}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.


! Package xcolor Error: Undefined color `pmAlpDecay'.

See the xcolor package documentation for explanation.
Type  H <return>  for immediate help.
...

l.29 \pmAlpDecay[linecolor=red]{->}(2,3){text}

Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

\documentclass{report}
\usepackage{pst-node}

\makeatletter
%% 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\setTextColor#1#2#3#4\@nil{\definecolor{pmAlpDecay}#4}
\def\pmAlpDecay{\pst at object{pmAlpDecay}}
\def\pmAlpDecay at i{\pst at getarrows{\pmAlpDecay at ii}}
\def\pmAlpDecay at ii(#1,#2)#3{%
        \psset{linecolor=black}%
    \begin at OpenObj
    \expandafter\setTextColor\pslinecolor\@nil
    \pcline(! #1 #2 sub #2)(! #1 #2 sub 2 sub  #2 2 sub)%
    \naput{\textcolor{pmAlpDecay}{#3}}%
    \end at OpenObj}
\makeatother

\begin{document}
\begin{pspicture}(5,5)

\pmAlpDecay{->}(6,3){text}

\pmAlpDecay[linecolor=red]{->}(2,3){text}

\pmAlpDecay[linecolor=green]{->}(4,3){text}


\end{pspicture}

\end{document}



Patrice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20180410/0adbe1c0/attachment-0001.html>


More information about the PSTricks mailing list