[NTG-context] pstrics module again

Aditya Mahajan adityam at umich.edu
Mon Nov 25 21:25:10 CET 2013


On Mon, 25 Nov 2013, Herbert Voss wrote:

> Am 25.11.2013 19:55, schrieb Aditya Mahajan:
>
>> This is what I did.
>> 
>> 1. Compile the file. You get an error that some pstrick file is missing.
>> Locate that file in the texlive directory and copy it to the current
>> directory.
>> 
>> 2. Repeat until you get an error that \ifx! is not a valid control
>> sequence.
>> 
>> 3. Run `grep ifx! *.tex` and change all the "\ifx!#1" to "\ifx !#1".
>
> why does ConTeXt needs the space before the !  ??

ConTeXt has two catcode regimes: the "standard" catcode regime and the 
"unprotected" catcode regime.

In the "unprotected" catcode regime, !, _, and @ are also letters. This is 
done so that one can use csnames such as \c!width, \!!plusone, etc. 
(Similar to \makeatletter in LaTeX).

I haven't looked at the actual code, but I am guessing that at some place, 
the following code is being called:

\unprotect
\input pstricks
\protect

and therefore when ConTeXt sees \ifx!#1 it thinks that \ifx! is a csname. 
Adding a space after \ifx avoids that.

As I said in my previous message, this is easy to fix at ConTeXt end 
defining an appropriate catcode regime before inputing pstricks.

So, the pstricks package does not need to be changed, but the ConTeXt code 
that is calling the package needs to be adapted.

Aditya


More information about the ntg-context mailing list