-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotestyles.sty
180 lines (159 loc) · 5.03 KB
/
notestyles.sty
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{notestyles}[2022/11/27 Kayzels Notes Styles]
% Maths
\usepackage{amssymb}
\usepackage{amsmath}
% Lists
\usepackage{enumitem}
% Language Settings
\RequirePackage[english]{babel}
\setlocalecaption{english}{chapter}{Unit}
% Bookmarks
\usepackage[bookmarksnumbered]{hyperref}
% Proofs
\RequirePackage[amsmath,amsthm,thmmarks,hyperref]{ntheorem}
\renewcommand\proofSymbol{\ensuremath{\blacksquare}}
\newenvironment{subproof}[1][\proofname]{%
\renewcommand\proofSymbol{\ensuremath{\square}}
\begin{proof}[#1]%
}{%
\end{proof}%
}
% Headers, Footers and Margins
\RequirePackage[margin=2cm, vmargin=3cm]{geometry}
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\nouppercase{\rightmark}}
\fancyhead[LO,RE]{\leftmark}
\fancyfoot[C]{\thepage}
\setlength{\headheight}{14pt}
\setlength{\parindent}{0cm}
\RequirePackage{multicol}
% Fonts
\RequirePackage[T1]{fontenc}
\RequirePackage{charter}
\RequirePackage[varqu,varl]{inconsolata}
\RequirePackage[type1]{cabin}
\RequirePackage[xcharter]{newtxmath}
\RequirePackage{bm}
% Colors
\RequirePackage[dvipsnames,table]{xcolor}
\colorlet{circle area}{Lavender}
\colorlet{example color}{blue!15!white}
\colorlet{example title}{black}
\colorlet{note color}{red!15!white}
\colorlet{note border}{red!75!black}
\colorlet{exercise color}{orange!25!white}
\colorlet{exercise border}{orange!75!black}
\colorlet{theorem color}{MidnightBlue!20!white}
\colorlet{theorem border}{MidnightBlue!75!black}
\colorlet{definition color}{Aquamarine!30!white}
\colorlet{definition border}{Aquamarine!75!black}
% Bold Math
\let\oldtextbf\textbf
\renewcommand{\textbf}[1]{\oldtextbf{\boldmath #1}}
\makeatletter
\g@addto@macro\bfseries{\boldmath}
\makeatother
\makeatletter
\g@addto@macro\normalfont{\unboldmath}
\makeatother
% LaTex Tooling
\RequirePackage{etoolbox}
\RequirePackage{xargs}
% Color Boxes
\RequirePackage{parskip}
\RequirePackage{tcolorbox}
\tcbuselibrary{breakable}
\RequirePackage{adjustbox}
\newenvironment{sidenote}[2][]
{\tcolorbox[breakable, colback=note color, colframe=note border, fonttitle=\bfseries, title={#2}, center title, parbox=false, center, #1]}
{\endtcolorbox}
\newenvironment{exercise}[2][]
{\tcolorbox[breakable, colback=exercise color, colframe=exercise border, fonttitle=\bfseries, title={#2}, center title, parbox=false, center, #1]}
{\endtcolorbox}
\newenvironment{example}[1][]
{\tcolorbox[coltitle=example title, colback=example color, breakable, detach title, before upper={\tcbtitle\quad}, title=\textbf{Example}, parbox=false, center, #1]}
{\endtcolorbox}
\newenvironment{theorem}[2][]
{\tcolorbox[breakable, colback=theorem color, colframe=theorem border, fonttitle=\bfseries, title={#2}, center title, parbox=false, center #1]}
{\endtcolorbox}
\newenvironment{definition}[2][]
{\tcolorbox[breakable, colback=definition color, colframe=definition border, fonttitle=\bfseries, title={#2}, center title, parbox=false, center, #1]}
{\endtcolorbox}
% Include/Input Subfiles
\RequirePackage{xstring}
\RequirePackage{subfiles}
\newcommand{\addfile}[2][include]
{\clearpage\begingroup\pagestyle{empty}\cleardoublepage\endgroup%
\IfEqCase{#1}{%
{include}{\subfileinclude{#2}}%
{input}{\subfile{#2}}
}[\PackageError{addfile}{Undefined option to addfile: #1}{}]%
}
% Horizontal Rules at document ends
\newcommand{\rulebookend}{\vbox{\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt}%
\cfoot{}}
\newcommand{\rulechapterend}{\noindent\rule{\textwidth}{0.4pt}%
\cfoot{}
}
% Indented Paragraphs
\RequirePackage{changepage}
\newenvironment{indentparagraph}{\begin{adjustwidth}{2em}{}}{\end{adjustwidth}}
% Images
\RequirePackage{tikz}
\usetikzlibrary{fit, backgrounds, topaths}
\tikzstyle{every picture}+=[remember picture]
% Venn Diagrams
\RequirePackage{venndiagram}
\makeatletter
\def\addvennback{%
\expandafter\ifpatchable{\fillAll}{]}{%
\expandafter\patchcmd%
{\fillAll}{]}{,.. this/.try]}{}{}%
\pgfutil@namelet{fillAll@orig}{fillAll}%
\newcommand{\fillBack}{%
\tikzset{.. this/.style={fill=white}}%
\csname fillAll@orig\endcsname
}%
}{}%
}
\makeatother
\preto\tikzpicture{\addvennback}{}{}
\newenvironmentx{venntwo}[2][1,2]
{
\begin{venndiagram2sets}[shade=circle area,#1]%
\fillBack%
\ifstrempty{#2}{}{\setpostvennhook
{
\node[above] at (current bounding box.north) {#2};
}}
}%
{\end{venndiagram2sets}}
\newenvironmentx{vennthree}[2][1,2]
{
\begin{venndiagram3sets}[shade=circle area,#1]%
\fillBack%
\ifstrempty{#2}{}{\setpostvennhook
{
\node[above] at (current bounding box.north) {#2};
}}
}%
{\end{venndiagram3sets}}
% Tables
\RequirePackage{tabularray}
\UseTblrLibrary{booktabs}
\UseTblrLibrary{varwidth}
\SetTblrInner[tblr]{measure=vbox}
% Questions and Answers
\newlist{questions}{enumerate}{2}
\setlist[questions, 1]{label=\arabic*., first=\bfseries}
\setlist[questions, 2]{label=(\alph*), first=\bfseries}
\newenvironment{answer}{\normalfont}{}
% Questions, Concepts and Emphasis Styling
\newcommand{\concept}[1]{\textbf{#1}}
% TOC Page Number Spacing
\makeatletter
\renewcommand{\@pnumwidth}{1.75em}
\makeatother