-
Notifications
You must be signed in to change notification settings - Fork 17
/
watsonbook.cls
178 lines (147 loc) · 4.94 KB
/
watsonbook.cls
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{watsonbook}[2017/06/16 watsonbook class]
\PassOptionsToClass{twoside}{report}
\LoadClassWithOptions{report}
\newif\if@threedoption
\DeclareOption{3D}{\@threedoptiontrue}
\newif\if@bleedoption
\DeclareOption{bleed}{\@bleedoptiontrue}
\newif\if@prettycodeoption
\DeclareOption{prettycode}{\@prettycodeoptiontrue}
\newif\if@shellescapeoption
\DeclareOption{shellescape}{\@shellescapeoptiontrue}
\newif\if@juliaoption
\DeclareOption{julia}{\@juliaoptiontrue}
\newif\if@jlminoption
\DeclareOption{jlmin}{\@jlminoptiontrue}
\ProcessOptions
\RequirePackage[svgnames]{xcolor}
\RequirePackage{hyperref}
\RequirePackage{url}
\RequirePackage{geometry}
\RequirePackage{cprotect}
\if@bleedoption
\geometry{papersize={8.625in,11.25in},
layoutsize={8.875in,11in},
bindingoffset=0.375in,
layoutoffset={-0.125in,0.125in},
margin=1in,
marginpar=0.5in,
marginparsep= -6.925mm, % 2.6mm + 0.125 in
twoside}
\else
\geometry{
margin=1in,
marginpar=0.5in,
marginparsep= 2.6mm,
twoside}
\fi
\RequirePackage{iftex}
\if@juliaoption \RequirePackage{juliatex} \fi
\if@jlminoption \RequirePackage[minimal]{juliatex} \fi
\RequirePackage{calc}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{wrapfig}
\RequirePackage{colonequals}
\RequirePackage{ifthen}
\RequirePackage{array}
\RequirePackage{multirow}
\RequirePackage[labelfont=bf,labelsep=none,justification=RaggedRight]{caption}
\RequirePackage{asymptote}
\RequirePackage{xparse}
\RequirePackage[skins,theorems,breakable,raster,listings,xparse]{tcolorbox}
\RequirePackage[shortlabels]{enumitem}
\RequirePackage{marginnote}
\RequirePackage{tocloft}
\RequirePackage[explicit,calcwidth]{titlesec}
%\RequirePackage[T1]{fontenc}
%\RequirePackage[scaled=0.8]{beramono}
\RequirePackage{listings}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
%----PACKAGE CUSTOMIZATION SETUP---------------------
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} % array
\newcolumntype{N}{@{}m{0pt}@{}} % array
\DeclareCaptionFormat{suggested}{{\small #1#2 #3}} % caption
\captionsetup{hypcap=false, format=suggested} % caption
\renewcommand\cftchapafterpnum{\vskip5pt} % tocloft
\renewcommand\cftsecafterpnum{\vskip5pt} % tocloft
\renewcommand\cftsubsecafterpnum{\vskip5pt} % tocloft
\definecolor{shadecolor}{rgb}{0.92,0.92,0.92} % listings
\RequirePackage{codeboxes}
\RequirePackage{mathmacros}
\RequirePackage{enumboxes}
%----TCOLORBOX SETUP-----------------------------
\RequirePackage{theoremboxes}
\RequirePackage{sectionheadings}
%----ENVIRONMENT HIDING--------------------------
\RequirePackage{hiding}
%----INSETFIGS-----------------------------------
\RequirePackage{insetfigure}
% ---- CUSTOM FORMATTING COMMANDS --------------------
\newcounter{intld}
\setcounter{intld}{0}
\newcounter{comp}
\setcounter{comp}{0}
\newcounter{prob}
\setcounter{prob}{1}
\newcounter{subitm}
\setcounter{subitm}{1}
\newcommand\subitm{(\alph{subitm})\quad\stepcounter{subitm}}
\newcommand{\pairofprobs}[2]{\makebox[0.5\textwidth][l]{\subitm #1}\subitm #2}
\RequirePackage{sidenotes}
%-----------------------------------------------
\usepackage{color}
\definecolor{dg}{RGB}{2,101,15}
\definecolor{dr}{RGB}{80,15,40}
%----- SPACING CUSTOMIZATIONS -----------------
\parindent = 0.0 in
\parskip = 0.2 in
% \reversemarginpar % Set margin notes in left margin
\setlength{\wrapoverhang}{\marginparwidth} % wrapfigure spillover
%----- TITLE FONT CUSTOMIZATION ---------------
\DeclareFixedFont{\titlefont}{T1}{ppl}{b}{it}{32}
\DeclareFixedFont{\subtitlefont}{T1}{ppl}{b}{it}{18pt}
%----- APPENDIX SUBSECTION ---------------------
\newcommand{\asubsection}[1]{
\subsection*{Section \ref{#1}}
\renewcommand{\thesubsection}{A.\ref{#1}}
\setcounter{aexercise}{0}
}
\newcommand{\NewProblemBox}[4]{
\DeclareTColorBox{#1}{O{}}{
title=#2 \itm,
colback=#3,
separator sign none,
parbox = false,
before skip = 8pt,
colframe = #4,
fonttitle=\bfseries,
##1}
}
% ----- FONTS ------------------------------
\RequirePackage{newunicodechar}
\RequirePackage{giambattista}
\ifLuaTeX
\setmainfont{TeX Gyre Pagella}
\setsansfont{Latin Modern Sans}
\setmonofont[Scale=0.8,Ligatures=NoCommon]{Cavalcade Mono}
% \setmonofont[Scale=0.8,Ligatures=NoCommon]{Noto Sans Mono SemiBold}
% \newfontfamily{\alternatemonofont}{DejaVu Sans Mono}
% \newfontfamily{\alternatemonofonttwo}{Cavalcade}
% \newunicodechar{≠}{{\alternatemonofont ≠}}
% \newunicodechar{∇}{{\alternatemonofont ∇}}
% \newunicodechar{ℒ}{{\alternatemonofonttwo ℒ}}
\fi
% ----- JUPYTER NOTEBOOK OUTPUT ------------
\declarecommand{\giturl}{}
\DeclareDocumentCommand{\jupyternotebook}{m O{}}{\sidenote{\fontsize{6}{6}\href{\giturl #1.ipynb}{\texttt{#1.ipynb}}}[#2]}
\newcommand{\closejupyternotebook}{}
% ----- SPECIAL SYMBOLS --------------------
\DeclareRobustCommand{\tabkey}{%
\begingroup\normalfont
\raisebox{0pt}{\includegraphics[height=\fontcharht\font`\e]{tabkey-symbol.pdf}}
\endgroup
}