Here are the modifications I've done
Code: Select all
\DeclareCaptionFormat{listing}{
%\setlength{\fboxsep}{0pt}
\parbox[bottom][0pt][c]{\textwidth}{\hspace{0pt}#1#2#3}}
\DeclareCaptionFont{black}{\color{black}}
\captionsetup[lstlisting]{format=listing,labelfont=black,textfont=black,
singlelinecheck=true, margin=0pt, font={tt,small,bf}}
Code: Select all
\lstset{
showstringspaces=false,
rulesepcolor=\color{harmaa},
columns=l,
tabsize=2,
numbers=left,
frame=lines,
numberstyle=\tiny,
keywordstyle=\color{red}\bfseries\underbar\emph,
backgroundcolor=\color{white},
basicstyle=\small\ttfamily\onehalfspacing,
columns=fullflexible,
commentstyle=\color{gray}\textit,
numberstyle=\tiny,
breaklines=true,
numberstyle=\tiny,
numbersep=5pt,
framextopmargin=10pt,
morecomment=[l]{//},
stringstyle=\color{DarkGray}\textit,
}