+%
+% Code listing support, in particular, for the SageMath interactive
+% prompt. You can create a box thingy for displaying code like,
+%
+% \begin{tcblisting}{listing only,
+% colback=codebg,
+% coltext=codefg,
+% listing options={language=sage,style=sage}}
+% sage: x
+% x
+% \end{tcblisting}
+%
+\usepackage{listings}
+\usepackage{tcolorbox}
+
+% Tell tcolorbox to use ``listings'' within the boxes.
+\tcbuselibrary{listings}
+
+% Define the colors that we'll use in our listings.
+\definecolor{codefg}{rgb}{0.9, 0.9, 0.9}
+\definecolor{codebg}{rgb}{0.16, 0.16, 0.16}
+\definecolor{brilliantlavender}{rgb}{0.96, 0.73, 1.0}
+
+% Define a style for interactive sage prompt listings.
+\lstdefinelanguage{sage}{ keywords={sage} }
+\lstdefinestyle{sage}{ keywordstyle=\color{brilliantlavender} }
+\lstset{%
+ basicstyle=\ttfamily\small,
+ columns=fullflexible,
+ keepspaces=true
+}