langs.sty
changeset 123 556cd74cbba9
parent 21 610f7a4a9ede
child 184 84dc794928de
--- a/langs.sty	Wed May 31 09:26:08 2017 +0100
+++ b/langs.sty	Thu Nov 02 14:47:55 2017 +0000
@@ -39,13 +39,27 @@
   otherkeywords={=,!=,:=,<,>,\%;*,/},
 }[keywords,comments,strings]
 
+
+\newcommand{\code}[1]{{\lstinline{#1}}}
+\newcommand{\pcode}[1]{\mbox{\lstset{language={},keywordstyle=\color{black}}\lstinline!#1!}}
+\newcommand{\scode}[1]{\mbox{\lstset{language={},basicstyle=\ttfamily\color{codegreen}}\lstinline!#1!}}
+\makeatother
+
+%%\lstset{escapeinside={(*@}{@*)}}
+\lstset{escapeinside={/*@}{@*/}}
+
+%% stripy code
+\usepackage{lstlinebgrd}
+\definecolor{capri}{rgb}{0.0, 0.75, 1.0}
+
+
 \lstdefinestyle{mystyle}
        {basicstyle=\ttfamily,
 	keywordstyle=\color{codepurple}\bfseries,
 	stringstyle=\color{codegreen},
 	commentstyle=\color{codegreen},
 	morecomment=[s][\color{codedocblue}]{/**}{*/},
-	numbers=left,
+	numbers=none,
 	numberstyle=\tiny\color{black},
 	stepnumber=1,
 	numbersep=10pt,
@@ -54,17 +68,9 @@
 	showstringspaces=false,
         xleftmargin=8mm,
         emphstyle=\color{codeblue}\bfseries,
-        keepspaces
+        keepspaces,
+        linebackgroundcolor={\ifodd\value{lstnumber}\color{capri!3}\fi}
 }
 
 \lstset{language=Scala,
         style=mystyle}
-
-
-\newcommand{\code}[1]{{\lstinline{#1}}}
-\newcommand{\pcode}[1]{\mbox{\lstset{language={},keywordstyle=\color{black}}\lstinline!#1!}}
-\newcommand{\scode}[1]{\mbox{\lstset{language={},basicstyle=\ttfamily\color{codegreen}}\lstinline!#1!}}
-\makeatother
-
-%%\lstset{escapeinside={(*@}{@*)}}
-\lstset{escapeinside={/*@}{@*/}}