aboutsummaryrefslogtreecommitdiff
path: root/dissertation.cls
diff options
context:
space:
mode:
Diffstat (limited to 'dissertation.cls')
-rw-r--r--dissertation.cls37
1 files changed, 29 insertions, 8 deletions
diff --git a/dissertation.cls b/dissertation.cls
index 74cd49b..452057b 100644
--- a/dissertation.cls
+++ b/dissertation.cls
@@ -10,7 +10,7 @@
\RequirePackage[letterpaper, margin=1in]{geometry} % 1 inch margins required
\RequirePackage{setspace}
\RequirePackage{afterpage}
-\RequirePackage{color}
+\RequirePackage{xcolor}
\RequirePackage{array}
% --- headers -------------------------------------------------------------------------------------
@@ -49,9 +49,6 @@
\newcommand{\dsignature}[1]{\hfill \normalfont{-- #1}}
-% THE FOLLOWING IS DARK MAGIC THAT I DON'T UNDERSTAND
-% I'M SURE I COULD DO BETTER...
-% - Blaise 2018-03-06
\RequirePackage[shortlabels]{enumitem}
\setlist[enumerate, 1]{nosep}
\setlist[enumerate, 2]{nosep, topsep=-5ex}
@@ -78,11 +75,35 @@
% --- code environment ----------------------------------------------------------------------------
\RequirePackage{etoolbox}
-\RequirePackage[chapter]{minted}
+\RequirePackage[section]{minted}
\usemintedstyle{colorfuli}
-\BeforeBeginEnvironment{minted}{\begin{singlespace}}
-\AfterEndEnvironment{minted}{\end{singlespace}}
-\setminted[python]{linenos=false, frame=lines}
+\setminted[python]{linenos=false, frame=none}
+
+\definecolor{bg}{rgb}{0.95,0.95,0.95}
+
+\setmintedinline[python]{bgcolor=bg}
+
+\RequirePackage[many]{tcolorbox}
+\tcbuselibrary{minted}
+
+\NewTCBListing{codefragment}{mo}{%
+ colback=bg,
+ boxrule=1pt,
+ colframe=bg,
+ arc=0,
+ shadow=false,
+ boxsep=1ex, top=0pt, left=0pt, right=0pt, bottom=0pt,
+ comment={\hfill(\arabic{chapter}.\arabic{equation})},
+ listing outside comment,
+ righthand width=2.5em,
+ sidebyside gap=0pt,
+ minted language=#1,
+ before skip =-0.5\baselinestretch,
+ after skip=2\baselinestretch,
+}
+
+\BeforeBeginEnvironment{codefragment}{\begin{singlespace}\stepcounter{equation}}
+\AfterEndEnvironment{codefragment}{\end{singlespace}}
% --- tables --------------------------------------------------------------------------------------