I'm trying to create a verbatim environment with a colored background and which can span across pages (so using a colorbox is not an option). It seemed that the listings package was a good way towards it, but the background is drawn one line at a time, such that, when I view the PDF, I see annoying white-ish "stripes" between the lines as well as where the invisible (0pt) frame rule was not to be drawn:
Here's the minimal code I used to create the output shown in the image:
\documentclass{minimal}
\usepackage[pdftex]{xcolor}
\usepackage[a4paper,hmargin=6cm]{geometry}
\usepackage{listings}
\lstset{backgroundcolor=\color{gray},
frame=single, framerule=0pt, framesep=5pt}
\begin{document}
\begin{lstlisting}
if (a < b)
{
printf("A is smaller than B!\n");
}
a = b;
\end{lstlisting}
\end{document}
Is there any workaround against these 'stripes'?