]> gitweb.michael.orlitzky.com - mjotex.git/blobdiff - mjo-listing.tex
mjo-algebra.tex: describe the file in a comment at the top.
[mjotex.git] / mjo-listing.tex
index aa24b5cc5cadda0490b34277afc43ccb9f9cbe7a..f733be6b4c5d8179e317859b6d3e5735d9699ae2 100644 (file)
@@ -27,7 +27,8 @@
 \lstset{%
   basicstyle=\ttfamily\small,
   columns=fullflexible,
-  keepspaces=true
+  keepspaces=true,
+  showstringspaces=false
 }
 
 % Define a style for interactive sage prompt listings.
   keywordstyle=\color{brilliantlavender},
   stringstyle=\color{brilliantgreen}
 }
+
+
+% Input a SageMath example code listing from a file. You generally
+% want these to be in separate files so that the build system can test
+% them automatically.
+%
+% The sole argument is the "name" of the listing, which ultimately
+% just identifies a file named "sage_listings/<name>.listing".
+\newcommand*{\sagelisting}[1]{\tcbinputlisting{listing only,%
+               colback=codebg,%
+               coltext=codefg,%
+               left=2em,%
+               listing options={language=sage,style=sage},%
+               listing file=sage_listings/#1.listing}}