[NTG-context] Trouble with # character in TABLE environment...& trouble with \starttyping environment too

Aditya Mahajan adityam at umich.edu
Wed Aug 25 20:59:04 CEST 2010


On Wed, 25 Aug 2010, Hans Hagen wrote:

> On 25-8-2010 12:07, Jaroslav Hajtmar wrote:
>>  Ok. Thanx Hans.
>>  I solve it with \#\type{patt} it look like as have it and therefore isnt
>>  problem.
>>
>>  BUT now I have problem with \starttyping - \stoptyping environment too.
>>
>>  here is example:
>>
>>  This works OK...
>>
>>  \starttyping
>>  c = re.compile([[
>>  longstring <- ('[' {:eq: '='* :} '[' <close>) => void
>>  close <- ']' =eq ']' / . <close>
>> ] ] , {void = function () return true end})
>>
>>  \stoptyping
>> 
>>
>>  But when I add last row, then stop work and get error message:
>>
>>  \starttyping
>>  c = re.compile([[
>>  longstring <- ('[' {:eq: '='* :} '[' <close>) => void
>>  close <- ']' =eq ']' / . <close>
>> ] ] , {void = function () return true end})
>>
>>  print(c:match'[==[]]===]]]]==]===[]') --> 17
>>  \stoptyping
>> 
>>
>>  Message error surprised me:
>
> mkiv happens to use === itself so either change your example to use 4 ='s or 
> adapt this:
>
> \unprotect
>     \def\!!bs{[=====[}
>     \def\!!es{]=====]}
> \protect
>
> (i might even move to == instead of === as it's saves tokens)

Is there a more robust way to do this? Perhaps making the number of equal 
signs user configurable?

Aditya


More information about the ntg-context mailing list