For Programmers: Free Programming Magazines  


Home > Archive > Tex > October 2006 > lstlistings - language=XML coloring of identifiers









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author lstlistings - language=XML coloring of identifiers
buells@gmx.net

2006-10-31, 4:08 am

Hello group,

i've got the problem, that i cannot color everything in a xml file
correctly with lstlistings. i defined the identifierstyle to be red,
but the only things, that got rendered red are just chars[A-Za-z] in
the tag content.

so a tag like
<abc> abcdefg..1234..[%&$=A7 </abc>

gets rendered as ( _ marks red)

<abc> _abcdefg_..1234.. [%&$=A7 </abc> so the part "..1234..[%&$=A7 " is
still rendered in basicstyle. Am i missing an option or so ?

Minimal example follwos here:

\documentclass{report}

\usepackage{color}

\usepackage{listings}
\lstset{
identifierstyle=3D\color{red},
language=3DXML
}

\begin{document}

\begin{lstlisting}
<news>
<abc> abcdefg..1234..[%&$=A7 </abc>
</news>
\end{lstlisting}

\end{document}

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com