]> gitweb.michael.orlitzky.com - mjotex.git/commitdiff
mjo-listing.tex: implement \sagelisting with \newtcbinputlisting.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 24 Feb 2020 23:45:45 +0000 (18:45 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 24 Feb 2020 23:45:45 +0000 (18:45 -0500)
mjo-listing.tex

index bcfe25f4af5673bfbcd9bf6ab58094fae5343f6a..ccd0d9cf0fb23aaf14f40177959df3a41ed95473 100644 (file)
 %
 % 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,%
-               enlarge bottom finally by=\baselineskip,%
-               enlarge top initially by=\baselineskip,%
-               left=2em,%
-               listing options={language=sage,style=sage},%
-               listing file=sage_listings/#1.listing}}
-
+\newtcbinputlisting{\sagelisting}[2][]{%
+  colback=codebg,%
+  coltext=codefg,%
+  enlarge bottom finally by=\baselineskip,%
+  enlarge top initially by=\baselineskip,%
+  left=2em,%
+  listing only,%
+  listing options={language=sage,style=sage},%
+  listing file=sage_listings/#2.listing,%
+  #1}
 
 \fi