[l2h] listings- set a line in a different color

Claus Behl claus at bempf.de
Sun Jan 8 12:51:21 CET 2006


Hi,

im using the package listings to set source code.
I want to get some words in a different color.
Thats what i do in my tex-file:

\lstset{moredelim =*[is][\color{red}]{|}{|}}

\begin{lstlisting}
//Holds the Focus
gtk_grab_add(|C_dialog|);
\end{lstlisting}

Now C_dialog is in red. But this dosnt work with latex2html.


For html output i remove the |. Here is my .latex2html-init file to do this.

$HTML_VERSION = "4.0"; 
$TRANSPARENT_FIGURES = 1;
sub do_env_lstlisting {
    local ($_) = @_;
    my $env_id = ++$global{'max_id'};
    $_ =~ s/\\par/\n\n/g;
    $_ =~ s/\|//g;
    &process_undefined_environment('lstlisting', $env_id, $_);
} 
1;

But of course it would be great if i can get the word in html in red too.
Is there a way to do this?

Claus Behl




More information about the latex2html mailing list