From 19347dcf43e49e655346c4de2931b3b3f3127d49 Mon Sep 17 00:00:00 2001
From: Christophe Garion <tofgarion@runbox.com>
Date: Mon, 30 Jan 2017 17:13:35 +0100
Subject: [PATCH] listings: use B&W color for handouts (beamer)

---
 my-listings.sty | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/my-listings.sty b/my-listings.sty
index 4b27225..d590db0 100644
--- a/my-listings.sty
+++ b/my-listings.sty
@@ -186,13 +186,31 @@
         stringstyle=\color{lstred},
         commentstyle=\color{lstgreen},
         identifierstyle=\color{lstblue}
+      }
 }
+
+\newcommand{\lstusecolorshandouts}{
+\lstset{backgroundcolor=\color{isae@bggray}}
+
+\lstset{
+        keywordstyle=\bfseries,
+        stringstyle=,
+        commentstyle=\itshape,
+        identifierstyle=
+      }
 }
 
 \ifx@colorlst\@empty
 \relax
 \else
-\lstusecolors
+\makeatletter
+\@ifclassloaded{beamer}{%
+  \mode<presentation>{\lstusecolors}%
+  \ifx\slideshandout\undefined\mode<handout>{\lstusecolorshandouts}\else\relax\fi%
+}{%
+\lstusecolors%
+}%
+\makeatother
 \fi
 
 \endinput
\ No newline at end of file
-- 
GitLab