X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo-listing.tex;h=f898aba13ea886be03258fea0bfc61dd1ee72dd9;hb=fc7cfa7f3d02715cb09eae2e1c6bc501dc2d8d50;hp=5207aa2b83e1721af9ca8378ab72ca8c6a5ae877;hpb=ff61d05732bb49a62b91f6b32ba1e2cdb6d82d19;p=mjotex.git diff --git a/mjo-listing.tex b/mjo-listing.tex index 5207aa2..f898aba 100644 --- a/mjo-listing.tex +++ b/mjo-listing.tex @@ -10,6 +10,10 @@ % x % \end{tcblisting} % +\ifx\havemjolisting\undefined +\def\havemjolisting{1} + + \usepackage{listings} \usepackage{tcolorbox} @@ -38,3 +42,20 @@ 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/.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}} + + +\fi