function finalize()
{
// get parent's output
parent::finalize();
$output = parent::getOutput();
$tex_output = '';
foreach ($output as $token) {
if ($this->_enumerated) {
$class = $token[0];
$content = $token[1];
} else {
$key = key($token);
$class = $key;
$content = $token[$key];
}
$iswhitespace = ctype_space($content);
if (!$iswhitespace) {
if ($class === 'special') {
$class = 'code';
}
$tex_output .= sprintf('\\textcolor{%s}{%s}', $class, $this->escape($content));
} else {
$tex_output .= $content;
}
}
$this->_output = "\\begin{alltt}\n" . $tex_output . "\\end{alltt}";
}