[pstricks] \pstVerb scope

Michelle Baert m.baert at free.fr
Thu Jan 17 10:28:16 CET 2008


Hi Herbert,

Thanks for "PSTricks 2008", it looks great !

My pst-erd project is well progressing.

I renamed things (tell me if there could be a conflict):

--
% ------- Crow's Foot Arrowheads names
% on - zero or more: ring and crow's foot
% in - one or more: dash and crow's foot
% oi - zero or one : ring and dash
% ii - exactly one : dash and dash
\edef\pst at arrowtable{\pst at arrowtable,no-on,ni-in,io-oi,ii-ii}

\psset at crowarrowsize{2pt 5}
\psset at crowarrowlength{10}
\psset at crowarrowinset{.4}

% main arrowhead routine:
%CrowFoot(reverse, optional, unique, inset, length, dim, num) 
\pst at def{CrowFoot}<...>
...
% 1..N cardinality (end)
\@namedef{psas at in}{%
    false false false \psk at crowarrowinset\space \psk at crowarrowlength
\space \psk at crowarrowsize\space     \tx at CrowFoot
}

...

--
The tx at CrowFoot ps code receives arguments set for 
each arrowhead "flavor", and calls subroutines: ring, dash, fork .
To minimize footprint, I define them in the ADict dictionary, which,
as far as I understood, is designed for that.
 
But there I have problems: 
When I use \pstVerb to include this ps code defining subroutines,
it works fine on first document page it is used, but then I get
ghostscript /undefined error.
Debugging the ps file produced by latex, it looks like all definitions I
made in \pstVerb block where cleared when starting a new page (maybe at
@endspecial ?). What's wrong ?

I could avoid this problem when replacing the \pstVerb block with
\pstheader{pst-erd.pro}. Is it the right way to do  it  ?

Looking at section 8 of pst-code.pdf, and page 2 of "Inside PSTricks",
I'd think the most portable way would be to use \ps at def, but:

When defined with ps at def{routine}, ps code is, on my system, replicated
in  ps output  for each invocation of tx at routine .  I'd prefer
to have a tx at routine ps procedure defined, but I don't know how to do
this, without modifying pstricks distribution itself.

Your help would be greatly appreciated.
--
Best regards,
Michelle Baert




More information about the PSTricks mailing list