-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple.sty
More file actions
155 lines (127 loc) · 7.47 KB
/
simple.sty
File metadata and controls
155 lines (127 loc) · 7.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
%—————————————————————————————Standardized Imports——————————————————————————————
\RequirePackage[utf8]{inputenc}
%----------------------------Packages for math stuff----------------------------
\RequirePackage{mathtools, amssymb} % For writing math equations and symbols
\RequirePackage{amsthm} % For the proof environment
\RequirePackage{physics} % For vectors and grad, curl, etc.
%-------------------------------------------------------------------------------
\RequirePackage{geometry} % For defining page margins
\RequirePackage{classicthesis} % Amazing beauty *chef's kiss*
\RequirePackage[framemethod=tikz]{mdframed} % Theorem boxes
%------------------------Packages for Images and Diagrams-----------------------
\RequirePackage{tikz} % Diagrams
\RequirePackage{graphicx} % Images
\RequirePackage{float} % Image Positioning
%---------------------------Packages for Code Snippets--------------------------
\RequirePackage[linesnumbered]{algorithm2e}
\RequirePackage{listings}
%-------------------------------Color Definitions-------------------------------
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
%------------------------Defining the Code Listing Style------------------------
\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=4
}
\lstset{style=mystyle}
%-------------------------------------------------------------------------------
\RequirePackage{calligra} %For the font
\RequirePackage[inline]{enumitem} %For customizable numbered lists
\RequirePackage{hyperref} % For hyperlinks
%———————————————————————————————————————————————————————————————————————————————
%—————————————————————————————Setting Up Hyperlinks—————————————————————————————
\hypersetup{
colorlinks=true,
linkcolor=blue,
}
%———————————————————————————————————————————————————————————————————————————————
%——————————————————————————Setting Up The Page Margins——————————————————————————
\geometry{
bottom=2cm,
}
%———————————————————————————————————————————————————————————————————————————————
%————————————————Defining the Theorem and Definition environments———————————————
\newcounter{theorem}[chapter]
\newcounter{definition}[chapter]
\newenvironment{theorem}[1][]{
\stepcounter{theorem}
\ifstrempty{#1}{
\begin{mdframed}[linecolor=blue, backgroundcolor=blue!10, roundcorner=5pt, linewidth=1pt, frametitle={Theorem~\thechapter.\thetheorem.}, frametitlerule=true, frametitleaboveskip=10pt, frametitlebelowskip=5pt, frametitlebackgroundcolor=blue!40]
}
{
\begin{mdframed}[linecolor=blue, backgroundcolor=blue!10, roundcorner=5pt, linewidth=1pt, frametitle={Theorem~\thechapter.\thetheorem.~(#1)}, frametitlerule=true, frametitleaboveskip=10pt, frametitlebackgroundcolor=blue!40]
}
}{\end{mdframed}}
\newenvironment{proposition}[1][]{
\stepcounter{theorem}
\ifstrempty{#1}{
\begin{mdframed}[linewidth=1pt, linecolor=blue!10, backgroundcolor=blue!10]
\bfseries Proposition~\thechapter.\thetheorem.\normalfont
}
{
\begin{mdframed}[linewidth=1pt, linecolor=blue!10, backgroundcolor=blue!10]
\bfseries Proposition~\thechapter.\thetheorem~(#1).\normalfont
}
}{\end{mdframed}}
\newenvironment{definition}[1][]{
\stepcounter{definition}
\ifstrempty{#1}{
\begin{mdframed}[linewidth=1pt, linecolor=gray!15, backgroundcolor=gray!15,]
\bfseries Definition~\thechapter.\thedefinition.\normalfont
}
{
\begin{mdframed}[linewidth=1pt, linecolor=gray!15, backgroundcolor=gray!15,]
\bfseries Definition~\thechapter.\thedefinition~(#1).\normalfont
}
}{\end{mdframed}}
\newenvironment{lemma}[1][]{
\stepcounter{theorem}
\ifstrempty{#1}{
\begin{mdframed}[linewidth=1pt, linecolor=yellow!30, backgroundcolor=yellow!30,]
\bfseries Lemma~\thechapter.\thetheorem.\normalfont
}
{
\begin{mdframed}[linewidth=1pt, linecolor=yellow!30, backgroundcolor=yellow!30,]
\bfseries Lemma~\thechapter.\thetheorem~(#1).\normalfont
}
}{\end{mdframed}}
%———————————————————————————————————————————————————————————————————————————————
% Code Snippet Environments
%\newenvironment{java}{\begin{lstlisting}[language=Java]}{\end{lstlisting}}
%\newenvironment{cpp}{\begin{lstlisting}[language=C++]}{\end{lstlisting}}
%\newenvironment{python}{\begin{lstlisting}[language=Python]}{\end{lstlisting}}
%——————————————Definitions of short commands to promote less typing—————————————
\newcommand{\R}{\mathbb{R}} %The reals
\newcommand{\Q}{\mathbb{Q}} %The rationals
\newcommand{\Z}{\mathbb{Z}} %The integers
\newcommand{\N}{\mathbb{N}} %The natural numbers
\newcommand{\F}{\mathbb{F}} %Any arbitrary field
\newcommand{\e}{\epsilon} %For epsilon-delta proofs
\renewcommand{\L}{\mathcal{L}} %For the Laplace Transform
\newcommand{\ang}[1]{\langle #1 \rangle}
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} %pd is short for ``partial derivative".
\newcommand{\Java}[1]{\lstinline[language=Java]{#1}} %For Java keywords
\newcommand{\CPP}[1]{\lstinline[language=C++]{#1}} %For C++ keywords
\newcommand{\Python}[1]{\lstinline[language=Python]{#1}} %For Python keywords
%———————————————————————————————————————————————————————————————————————————————
%———————————————————————————————Declaring our font——————————————————————————————
\DeclareFontShape{T1}{calligra}{m}{n}{<->s*[2.2]callig15}{}
\DeclareMathAlphabet{\mathcalligra}{T1}{calligra}{m}{n}
%———————————————————————————————————————————————————————————————————————————————
\setlength{\parindent}{0pt} % To prevent unnecessary indentation