-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotestyles.sty
113 lines (97 loc) · 3.36 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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{notestyles}[2022/11/09 Kayzels Notes Styles]
% Lists
\RequirePackage{enumitem}
% Language Settings
\RequirePackage[english=nohyphenation]{hyphsubst}
\RequirePackage[english]{babel}
\setlocalecaption{english}{chapter}{Unit}
\sloppy
% Bookmarks
\RequirePackage[bookmarksnumbered]{hyperref}
% 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}
\RequirePackage{multicol}
% Fonts
\RequirePackage[T1]{fontenc}
\RequirePackage{unicode-math}
\setmainfont{XCharter}
\setsansfont{Cabin}
\setmathfont{XCharter Math}
\setmonofont{Source Code Pro}
% Colors
\RequirePackage[dvipsnames,table]{xcolor}
\definecolor{lightGrey}{rgb}{0.9,0.9,0.9}
\colorlet{codeColor}{PineGreen!15!white}
\colorlet{codeBorder}{PineGreen}
\colorlet{definitionColor}{Aquamarine!30!white}
\colorlet{definitionBorder}{Aquamarine!75!black}
\colorlet{definitionCode}{definitionColor!35!white}
\colorlet{exampleColor}{blue!15!white}
\colorlet{exampleTitle}{black}
\colorlet{exampleCode}{exampleColor!35!white}
\colorlet{noteColor}{red!15!white}
\colorlet{noteBorder}{red!75!black}
\colorlet{noteCode}{noteColor!35!white}
% Tables
\RequirePackage{tabularray}
\UseTblrLibrary{booktabs}
\UseTblrLibrary{varwidth}
\SetTblrInner[tblr]{measure=vbox}
\newcommand{\nl}{\\}
% Code
\RequirePackage{minted}
\RequirePackage{etoolbox}
\makeatletter
% replace \medskip before the box with nothing, i.e., remove it
\patchcmd{\minted@colorbg}{\medskip}{}{}{}
\makeatother
% Color Boxes
\RequirePackage{tcolorbox}
\tcbuselibrary{breakable}
\RequirePackage{adjustbox}
\newenvironment{codebox}[2][]
{\tcolorbox[breakable, colback=codeColor, colframe=codeBorder, fonttitle=\bfseries, title={#2}, center title, parbox=false, center, #1]}
{\endtcolorbox}
\newenvironment{definition}[2][]
{\tcolorbox[breakable, colback=definitionColor, colframe=definitionBorder, fonttitle=\bfseries, title={#2}, center title, parbox=false, center, #1]}
{\endtcolorbox}
\newenvironment{example}[1][]
{\tcolorbox[coltitle=exampleTitle, colback=exampleColor, breakable, detach title, before upper={\tcbtitle\quad}, title=\textbf{Example}, parbox=false, center, #1]}
{\endtcolorbox}
\newenvironment{sidenote}[2][]
{\tcolorbox[breakable, colback=noteColor, colframe=noteBorder, fonttitle=\bfseries, title={#2}, center title, parbox=false, center, #1]}
{\endtcolorbox}
% Indented Paragraphs
\RequirePackage{changepage}
\newenvironment{indentparagraph}{\begin{adjustwidth}{2em}{}}{\end{adjustwidth}}
% 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{}
}
% Questions, Concepts and Emphasis Styling
\newcommand{\question}[1]{\textbf{#1}}
\newcommand{\concept}[1]{\textbf{#1}}
% TOC Page Number Spacing
\makeatletter
\renewcommand{\@pnumwidth}{1.75em}
\makeatother