]> gitweb.michael.orlitzky.com - mjotex.git/commitdiff
Add mjo-listing.tex for SageMath interactive prompt boxes.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 12 Apr 2016 15:05:11 +0000 (11:05 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 12 Apr 2016 15:05:11 +0000 (11:05 -0400)
makefile
mjo-listing.tex [new file with mode: 0644]
mjotex.sty

index 521281ab0a791a4348be6d8d0593a5b473384a3b..1486a26fbff7d5d1b46f01dcf19f8f744c0987c1 100644 (file)
--- a/makefile
+++ b/makefile
@@ -15,9 +15,9 @@ BIBS = references.bib
 # A space-separated list of the mjotex files that you use. The path to
 # mjotex must be contain in your $TEXINPUTS environment variable.
 MJOTEX  = mjo-algorithm.tex mjo-arrow.tex mjo-common.tex mjo-cone.tex
-MJOTEX += mjo-convex.tex mjo-font.tex mjo-linear_algebra.tex mjo-misc.tex
-MJOTEX += mjo-proof_by_cases.tex mjo-theorem.tex mjo-theorem-star.tex
-MJOTEX += mjo-topology.tex
+MJOTEX += mjo-convex.tex mjo-font.tex mjo-linear_algebra.tex mjo-listing.tex
+MJOTEX += mjo-misc.tex mjo-proof_by_cases.tex mjo-theorem.tex
+MJOTEX += mjo-theorem-star.tex mjo-topology.tex
 
 # Use kpsewhich (from the kpathsea suite) to find the absolute paths
 # of the bibtex/mjotex files listed in in $(BIBS)/$(MJOTEX). The SRCS
diff --git a/mjo-listing.tex b/mjo-listing.tex
new file mode 100644 (file)
index 0000000..fc9828c
--- /dev/null
@@ -0,0 +1,31 @@
+%
+% 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
+}
index 68164d18dc96b1594287fe0da83a3c71b4b2ad46..039738b792d403090a6e6ad9a8aeeeea5882fdfc 100644 (file)
@@ -5,6 +5,7 @@
 \input{mjo-convex}
 \input{mjo-font}
 \input{mjo-linear_algebra}
+\input{mjo-listing}
 \input{mjo-misc}
 \input{mjo-proof_by_cases}
 \input{mjo-theorem}