diff --git a/my-listings.sty b/my-listings.sty index ea0e8781d8cbcf894c664f9db4bc55eef6f3c1bf..b55e717f02049ea303e68765df717a39e8d2362f 100644 --- a/my-listings.sty +++ b/my-listings.sty @@ -71,7 +71,7 @@ \lstdefinelanguage{algo}{ morekeywords={:=, end, if, then, else, while, do, for, until, - Function, Procedure, out}, + Function, Procedure, out, return}, keywordstyle=\color{black}\bfseries, stringstyle=\color{black}, commentstyle=\color{black}, @@ -182,9 +182,13 @@ \RequirePackage{xcolor} \RequirePackage{caption} -\DeclareCaptionFont{white}{\color{white}} -\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\linewidth}{\hspace{15pt}#1#2#3}}} -\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white, +\DeclareCaptionFont{white}{\color{black}} +\DeclareCaptionFormat{listing}{% + \colorbox{gray}{% + \noindent\parbox{\dimexpr\columnwidth-2\fboxsep}{#1#2#3}% + }% +} +\captionsetup[lstlisting]{format=listing, labelfont=white, textfont=white, singlelinecheck=false, margin=0pt, font={bf}} \colorlet{isae@bggray}{gray!20}