Changes

Jump to navigation Jump to search
804 bytes added ,  14:00, 12 May 2007
you can go for another, less elegant, way to format your verbatim text, which can include all the discussed ConTeXt benefits.
 
== Writing a parser/formatter ==
It is not difficult at all to write a little parser which takes as it input your source file and gives in output a .tex file containing the code plus the opportune commands for colorization. You can then include the resulting file in the global ConTeXt document file.
\stoptext
</context>
 
== Attaching the source code ==
 
If your document is inteded to provide code examples to be tested by the readers, the presence of format sign (e.g. line numbers) can create some trouble while copying and pasting the code text from your document to the language environment. More generally, the copy and paste approach is not satisfying at all.
You can include source files in the pdf with a couple of ConTeXt commands:
 
<texcode>
\useattachment[ex][example.sc]
\attachment[ex]
</texcode>
 
The commands embed example.sc in the pdf, so that it is accessible by double-clicking on a generated icon.
If you use Acrobat Reader (Preview.app in MacOSX does not provide support for the behaviour) example.sc will be open in the related application (i.e. SuperCollider.app).
89

edits

Navigation menu