Changes

Jump to navigation Jump to search
362 bytes added ,  13:47, 12 May 2007
// an example starting with a comment
"this is a string".postln ;
 
\aSymbol ;
 
ThisClassDoesNotExists ;
\stoptyping
</context>
/BTEX{\color[SCred] //// an example starting with a comment}/ETEX
/BTEX{\color[SCgrey] "this is a string"}/ETEX .postln ;
 
/BTEX{\color[SCgreen] \type{\}aSymbol}/ETEX ;
 
/BTEX{\color[SCblue] ThisClassDoesNotExists}/ETEX
\stopSC
</texcode>
Basically, the idea is to envelope each item to be colorized inside a <texcode>/BTEX /ETEX</texcode>block. Note that inside the block the text is no more verbatim, so you have to define some string replacemtn replacement for special characters (e.g. _, %, $ etc). The problem of the slash is solved wrapping the character within a type command. The example uses some definitions (explained before) which have to be put in the global ConTeXt file
<texcode>
\definecolor [SCgreen] [r=0.0, g=0.45, b=0.0]
\definecolor[cirmaBlue] [r=.0,g=.2,b=.6] % for frame
</texcode>
\definecolor [SCgrey] [r=0.376, g=0.376, b=0.376]
\definecolor [SCgreen] [r=0.0, g=0.45, b=0.0]
\definecolor[cirmaBlue] [r=.0,g=.2,b=.6]
 
\defineframedtext
[framedSC]
/BTEX{\color[SCred] //// an example starting with a comment}/ETEX
/BTEX{\color[SCgrey] "this is a string"}/ETEX .postln ;
 
/BTEX{\color[SCgreen] \type{\}aSymbol}/ETEX ;
 
/BTEX{\color[SCblue] ThisClassDoesNotExists}/ETEX
\stopSC
\stoptext
</context>
89

edits

Navigation menu