Possible Duplicate:
How can I highlight some lines from source code?
How to hide LaTeX command (keywords) in a listing? When I use for example \textbf{} in the listing it appears as \textbf{}. How can I hide this?
Possible Duplicate:
How can I highlight some lines from source code?
How to hide LaTeX command (keywords) in a listing? When I use for example \textbf{} in the listing it appears as \textbf{}. How can I hide this?
I'm not sure that you can. The listings package provides its own macros for emphasising words in source code listings. For example, by default it emphasises language keywords. You can alter or add to the words that the pakcage emphasises. The following snippet, from the listings documentation,
\lstset{emph={square,root},emphstyle=\underbar}
will cause listings to set the words square and root with an underline.
\documentclass[12pt]{article}
\usepackage{alltt}
\begin{document}
\begin{alltt}
How to hide Latex Command (keywords) in a Listing.
When i user for example \textbf{} the in the listing
wil be appereard \textbf{}. How can hide this?
\end{alltt}
\end{document}

listings package. And of course, when he/she tried to do that, the commands appeared as they are, and no formatting took place.
– Martin Tapankov
Feb 01 '11 at 14:45