langs.sty
changeset 490 4fee50f38305
parent 480 9e42ccbbd1e6
child 588 a4646557016d
equal deleted inserted replaced
489:e28d7a327870 490:4fee50f38305
    37   morecomment=[n]{/*}{*/},
    37   morecomment=[n]{/*}{*/},
    38   morestring=[b]",
    38   morestring=[b]",
    39   otherkeywords={=,!=,:=,<,>,\%;*,/},
    39   otherkeywords={=,!=,:=,<,>,\%;*,/},
    40 }[keywords,comments,strings]
    40 }[keywords,comments,strings]
    41 
    41 
    42 \lstdefinestyle{mystyle}
       
    43        {basicstyle=\ttfamily,
       
    44 	keywordstyle=\color{codepurple}\bfseries,
       
    45 	stringstyle=\color{codegreen},
       
    46 	commentstyle=\color{codegreen},
       
    47 	morecomment=[s][\color{codedocblue}]{/**}{*/},
       
    48 	numbers=left,
       
    49 	numberstyle=\tiny\color{black},
       
    50 	stepnumber=1,
       
    51 	numbersep=10pt,
       
    52 	tabsize=2,
       
    53 	showspaces=false,
       
    54 	showstringspaces=false,
       
    55         xleftmargin=8mm,
       
    56         emphstyle=\color{codeblue}\bfseries,
       
    57         keepspaces
       
    58 }
       
    59 
       
    60 \lstset{language=Scala,
       
    61         style=mystyle}
       
    62 
       
    63 
    42 
    64 \newcommand{\code}[1]{{\lstinline{#1}}}
    43 \newcommand{\code}[1]{{\lstinline{#1}}}
    65 \newcommand{\pcode}[1]{\mbox{\lstset{language={},keywordstyle=\color{black}}\lstinline!#1!}}
    44 \newcommand{\pcode}[1]{\mbox{\lstset{language={},keywordstyle=\color{black}}\lstinline!#1!}}
    66 \newcommand{\scode}[1]{\mbox{\lstset{language={},basicstyle=\ttfamily\color{codegreen}}\lstinline!#1!}}
    45 \newcommand{\scode}[1]{\mbox{\lstset{language={},basicstyle=\ttfamily\color{codegreen}}\lstinline!#1!}}
    67 \makeatother
    46 \makeatother
    68 
    47 
    69 %%\lstset{escapeinside={(*@}{@*)}}
    48 %%\lstset{escapeinside={(*@}{@*)}}
    70 \lstset{escapeinside={/*@}{@*/}}
    49 \lstset{escapeinside={/*@}{@*/}}
    71 
    50 
    72 
       
    73 
       
    74 %% stripy code
    51 %% stripy code
    75 \usepackage{lstlinebgrd}
    52 \usepackage{lstlinebgrd}
    76 \definecolor{capri}{rgb}{0.0, 0.75, 1.0}
    53 \definecolor{capri}{rgb}{0.0, 0.75, 1.0}
       
    54 
       
    55 
       
    56 \lstdefinestyle{mystyle}
       
    57        {basicstyle=\ttfamily,
       
    58 	keywordstyle=\color{codepurple}\bfseries,
       
    59 	stringstyle=\color{codegreen},
       
    60 	commentstyle=\color{codegreen},
       
    61 	morecomment=[s][\color{codedocblue}]{/**}{*/},
       
    62 	numbers=none,
       
    63 	numberstyle=\tiny\color{black},
       
    64 	stepnumber=1,
       
    65 	numbersep=10pt,
       
    66 	tabsize=2,
       
    67 	showspaces=false,
       
    68 	showstringspaces=false,
       
    69         xleftmargin=8mm,
       
    70         emphstyle=\color{codeblue}\bfseries,
       
    71         keepspaces,
       
    72         linebackgroundcolor={\ifodd\value{lstnumber}\color{capri!3}\fi}
       
    73 }
       
    74 
       
    75 \lstset{language=Scala,
       
    76         style=mystyle}