# listings: framebox shows breaks in font

Using the listings package in LaTeX seems to put lines in the frame box. This happens for all frame box options and if I use a shadow box it is even more apparent...

Is there any way I can stop this from happening it looks really ugly.

It get even worse if I use a lighter font for comments, which changes the font of the framebox on that line.

\documentclass[a4paper, 12pt]{report}
\usepackage[plain,in]{fullpage}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{afterpage}
\usepackage{listings}
\usepackage{courier}
\usepackage{textcomp}

\lstnewenvironment{vb}[1][]{
\lstset{
language=VBScript,
breaklines=false,
basicstyle=\footnotesize\ttfamily\setstretch{0.7},
stringstyle=\slshape \color{grey},
showstringspaces=false,
keywordstyle=\bfseries,
breakatwhitespace=false,
upquote=true,
framextopmargin=1mm,
#1
}}{}

\begin{document}

\begin{vb}
Sub getInterarrivalTimes()
Dim i, j, k, y, count As Long
Dim sum As Double
Dim range1 As Range
Dim percentOp() As Variant
Dim opID() As Variant
Dim meanIA() As Variant

'th code keeps breaking the vertical frame box lines
'some more dummy code here
a=b
b=c
c=d

End Sub

\end{vb}

\end{document}


Apologies for not adding an image but its my first post and the rules wont allow me

Note that I DO want a frame just not with the font markings, its like theres a white underline on every line that is visible using the frame and/or shadow option

Should have clarified, I DO want a frame just not with the font markings, its like theres a white underline on every line that is visible using the frame and/or shadow option

-

## migrated from stackoverflow.comSep 12 '11 at 14:38

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  N.N. Sep 13 '11 at 8:26

If you remove the \setstretch{0.7} then the lines are solid. Is that what you are looking for? So I belive that if you replace that line with

    basicstyle=\footnotesize\ttfamily\renewcommand{\baselinestretch}{0.7},


you should get solid lines.

-

If you want "tight typesetting", write

basicstyle=\ttfamily\fontsize{10}{10}\selectfont,

-