From 1f9bce6f48e916943398e9a772cc42c3815297b4 Mon Sep 17 00:00:00 2001 From: Christophe Garion <tofgarion@runbox.com> Date: Tue, 11 Jan 2022 09:03:40 +0100 Subject: [PATCH] [listings] add return keyword in algo language --- my-listings.sty | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/my-listings.sty b/my-listings.sty index ea0e878..b55e717 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} -- GitLab