Verbatim text

From Wiki
Revision as of 00:52, 4 August 2005 by 171.64.119.38 (talk) (Clarified wording, added examples.)
Jump to navigation Jump to search

< Visuals

Displayed text

\starttyping, \typebuffer

In-line text

Interesting features

The option=commands setting allows the usage of ConTeXt commands inside verbatim text, as in this example:

\definetyping[C][option=commands]
\startC
#include 
int main(){
	return 0;
	/BTEX{\em unreachedCode;}/ETEX
}
\stopC

The tab character normally corresponds to one character, as can be seen above. That value can be adjusted, using the following code (available in the 2005.06.01 version and later):

\definetyping[C][tab=3]
% for older ConTeXt versions: \chardef\spacespertab=3
\startC
int func(int a){
	if(a > 4)
		return 0;
	else
		return 10;
}
\stopC