Changes

Jump to navigation Jump to search
144 bytes added ,  12:19, 17 May 2007
As an example, [http://www.cirma.unito.it/andrea/sw/sc/scToConTeXt.py this] is a Python script for the SuperCollider language, which has a striclty Smalltalk-like syntax.
Fed with this the following source code contained in e.g. example.sc file:
Basically, the idea is to envelope each item to be colorized inside a /BTEX /ETEX block.
Note that inside the block the text is no more verbatim, so you have to define some string replacement for special characters (e.g. _, %, $, \, etc).
As an example, the problem of the backslash (\) is solved here by replacing it with \letterbackslash.  You can then insert example.tex in your ConTeXt file with <texcode>\input example</texcode>  The example .tex file uses some definitions (explained beforein the previous sections) which have to be put in the global ConTeXt file. The definition
<texcode>
</texcode>
alsoAlso, example.tex requires color definitions, which are created following SuperCollider colorization interpreter scheme and have to be inserted in the global ConTeXt filetoo:
<texcode>
</texcode>
You can then insert example.tex in The definitions will be used for all the global ConTeXt file code files inserted with <texcode>\input example</texcode>.After compiling, this is the resultof the discussed example.
<context>
89

edits

Navigation menu