\usepackage{listings} \definecolor{background}{RGB}{39, 40, 34} \definecolor{string}{RGB}{230, 219, 116} \definecolor{comment}{RGB}{117, 113, 94} \definecolor{normal}{RGB}{248, 248, 242} \definecolor{identifier}{RGB}{166, 226, 46} \lstdefinestyle{monokaiPython}{ frame=none, language=python, % choose the language of the code numbers=left, % where to put the line-numbers stepnumber=1, % the step between two line-numbers. numbersep=5pt, % how far the line-numbers are from the code numberstyle=\color{white}\ttfamily, backgroundcolor=\color{background}, % choose the background color. You must add \usepackage{color} showspaces=false, % show spaces adding particular underscores showstringspaces=false, % underline spaces within strings showtabs=false, % show tabs within strings adding particular underscores tabsize=2, % sets default tabsize to 2 spaces captionpos=b, % sets the caption-position to bottom breaklines=true, % sets automatic line breaking breakatwhitespace=true, % sets if automatic breaks should only happen at whitespace title=\color{white}\lstname, % show the filename of files included with \lstinputlisting; basicstyle=\color{normal}\ttfamily, % sets font style for the code keywordstyle=\color{magenta}\ttfamily, % sets color for keywords stringstyle=\color{string}\ttfamily, % sets color for strings commentstyle=\color{comment}\ttfamily, % sets color for comments emph={format_string, eff_ana_bf, permute, eff_ana_btr}, emphstyle=\color{identifier}\ttfamily } \usepackage{framed} \definecolor{shadecolor}{named}{background} \newcommand{\pythonBlock}[1] { \begin{shaded} \lstinputlisting[style=monokaiPython]{#1} \end{shaded} }