3

I am using the listings package to display code in a document. Now I noticed that there are lines in the background.

Does someone know how to remove them?

Config:

\lstset{
   basicstyle=\scriptsize\ttfamily,
   keywordstyle=\bfseries\ttfamily\color{orange},
   commentstyle=\color{gray}\ttfamily,
   emph={square}, 
   emphstyle=\color{blue}\texttt,
   emph={[2]root,base},
   emphstyle={[2]\color{yac}\texttt},
   showstringspaces=false,
   flexiblecolumns=false,
   tabsize=2,
   numbers=left,
   numberstyle=\tiny,
   numberblanklines=false,
   stepnumber=1,
   numbersep=10pt,
   xleftmargin=15pt,
   language=bash,
   backgroundcolor=\color{lightgray},
   frame=L
 }

Sample: Sample Image

Minimal Working:

\documentclass[11pt]{article}
\usepackage{xcolor}
\usepackage{listings}

\lstset{
   basicstyle=\scriptsize\ttfamily,
   keywordstyle=\bfseries\ttfamily\color{orange},
   commentstyle=\color{gray}\ttfamily,
   emph={square}, 
   emphstyle=\color{blue}\texttt,
   emph={[2]root,base},
   emphstyle={[2]\color{yac}\texttt},
   showstringspaces=false,
   flexiblecolumns=false,
   tabsize=2,
   numbers=left,
   numberstyle=\tiny,
   numberblanklines=false,
   stepnumber=1,
   numbersep=10pt,
   xleftmargin=15pt,
   language=bash,
   backgroundcolor=\color{lightgray},
   frame=L
 }

\begin{document}

\begin{lstlisting}[language={}]
interface=wlan0
driver=nl80211
bssid=02:ab:cd:ef:12:30
country_code=DE
ieee80211d=1

ssid=INR-IoTs
channel=6
hw_mode=g

wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=xxxxxxxx

bss=wlan0_0
ssid=INR-IoT
\end{lstlisting} 

\end{document}
Phill93
  • 55
  • The example from the listings manual (p19) also suffers from this problem - looks like a bug. Maybe related (for an alternative solution): http://tex.stackexchange.com/questions/88977/putting-a-coloured-background-behind-text-without-adding-whitespace – Marijn Apr 03 '17 at 12:52
  • Try zooming in, i think they will be disapeared. – Bobyandbob Apr 15 '17 at 22:56
  • @Bobyandbob Trying this in different viewers, they do not disappear – Andrew Swann Nov 28 '18 at 20:03

0 Answers0