# [NTG-context] In-line syntax highlighting for type

Wed Oct 25 16:17:34 CEST 2006

On Wed, 25 Oct 2006, Aditya Mahajan wrote:

> On Wed, 25 Oct 2006, Hans Hagen wrote:
>
>>> Hi,
>>>
>>> How can I define a command that is the inline version of \startTEX ...
>>> \stopTEX. (I need to show inline commands in color). There had been a
>>> discussion on this in the past, and Taco had suggested a solution
>>>
>>>
>>> which is also posted on the wiki.
>>>
>>>
>>> http://wiki.contextgarden.net/Verbatim_text#In-line_text
>>>
>>> However, due to the recent changes in verbatim code, that solution no
>>> longer works. Can anyone suggest how to fix it?
>>>
>> \setupcolors[state=start]
>>
>> \setuptype[option=TEX]
>>
>> \definetype[typeTEX][option=tex]
>>
>> \starttext
>>
>> \type+\type{\type is a wonderful macro}+, isn't it?
>>
>> \typeTEX+\typeTEX{\typeTEX is a wonderful macro}+, isn't it?
>>
>> \stoptext
>
> Thanks, that looks easy :-)
>
> However, there seems to be a bug, sometimes the color spills across
> the type boundary.

Is is possible that everything written with \tex{command} is also
printed in color? I do not want to change \tex{command} to
\type{\command} since \tex is more robust (No catcode trickery and
stuff).