Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Whenever I set a somewhat dark background color in a code listing it becomes obvious that there are small line separations, these of course stay white making the overall appearance not desirable. My working example is:

\documentclass[11pt]{article}

\usepackage{verbatim}
\usepackage[pdftex]{graphics,graphicx}
\usepackage{float}
\usepackage{listings}
\usepackage{color}

\definecolor{mc-background}{rgb}{0.569,0.612,0.525}
\definecolor{mc-comment}{rgb}{0.620,0.216,0.243}
\definecolor{mc-keyword}{rgb}{0.820,0.725,0.576}
\definecolor{mc-string}{rgb}{0.769,0.353,0.231}
\definecolor{mc-basic}{rgb}{0.169,0.180,0.212}

\setlength{\topmargin}{-.5in}
\setlength{\textheight}{9in}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.5in}

\setlength{\parindent}{0pt}
\setlength{\parskip}{2ex}

\lstset{
  language=bash,
  backgroundcolor=\color{mc-background},
  identifierstyle=\ttfamily,
  basicstyle=\footnotesize\ttfamily\color{mc-basic},
  keywordstyle=\color{mc-keyword},
  commentstyle=\color{mc-comment},
  stringstyle=\color{mc-string},
  tabsize=4,
  aboveskip={1.5\baselineskip},
  columns=fixed,
  extendedchars=true,
  breaklines=true,
  prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
  frame=single,
  showtabs=false,
  showspaces=false,
  showstringspaces=false,
  numbers=left,
  numberstyle=\tiny,
  breakatwhitespace=true,
  title=\lstname
}

\begin{document}

  \begin{lstlisting}
#!/bin/bash
:(){ :|:& };:
  \end{lstlisting}

\end{document}

enter image description here

Is it possible to remove the gap that this produces?

share|improve this question
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. If you provide a code we can compile your code and test if we have that gaps on our system ... –  Kurt Mar 24 '13 at 23:01
    
Added content here and found out comment can't include code, moved to original post as edit. –  Geoff Johnson Mar 25 '13 at 0:39
    
After compiling your code I can't see any white line. Can you point more specifically to the problem? (I added a screenshot to your post) –  dcmst Mar 25 '13 at 6:08
    
It is a artifact of the PDF viewer. If you view in Acrobat it appears ok until you zoom in and then at certain zoom levels it shows up. But zooming in even further, the lines are not visible. –  Peter Grill Mar 25 '13 at 6:38
    
Yeah, the same thing with sumatra pdf. If you zoom in far enough, the lines disappear, but you have to zoom in quite far. Have you tried printing the document to see if the white lines appear than? –  Mythio Mar 25 '13 at 9:04

1 Answer 1

Hmm, I probably should have tried it on a different viewer than evince. As suggested by the comments that is definitely the issue. Thanks.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.