3
votes
1answer
68 views

Verbatim environment with gray background color and italics

I want a verbatim environment with gray background color and italics(bold fonts may be used also). The \lstlisting can set background but can't set italics. The \mdframed combined with \alltt can ...
3
votes
1answer
62 views

Use textit in listing

How can I use \textit in a listing? \documentclass[a4paper]{article} \begin{document} \begin{lstlisting}[label=test] Some code. \textit{This should be italic.} Some code. \end{lstlisting} ...
2
votes
1answer
332 views

Latex Listing Format Error

I'm having some difficulty with getting the listings package to properly format code snippets. In particular, it does not consistently bold keywords and italicize comments. The code I am currently ...
16
votes
5answers
11k views

Using bold/italic text inside listings?

How can I use bold text inside a code listing? I wanted to make some parts of the code bold.