Someone who knows how to fill with color only the box?
\begin{shaded}
\begin{lstlisting}
if (a < b)
{
printf("A is smaller than B!\n");
}
a = b;
\end{lstlisting}
\end{shaded}
backgroundscolorlistings
Someone who knows how to fill with color only the box?
\begin{shaded}
\begin{lstlisting}
if (a < b)
{
printf("A is smaller than B!\n");
}
a = b;
\end{lstlisting}
\end{shaded}
Best Answer
listings
has a settingbackgroundcolor=\color{gray}
for this purpose:See section 2.7 of the manual which you should get with
texdoc listings
.