-
Notifications
You must be signed in to change notification settings - Fork 0
/
jamwork.cls
452 lines (394 loc) · 12.2 KB
/
jamwork.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Jordan Melendez
% OSU Physics Graduate School Homework Template 2016
% jamhomework.cls
% Based partially on the Altermundus tkz-doc.cls found here:
% http://altermundus.com/pages/downloads/index.html
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*{\PackageName}{jamwork}
\newcommand*{\PackageVersion}{0.3}
\newcommand*{\filedate}{2018/12/19}
% IDENTIFICATION
\NeedsTeXFormat{LaTeX2e}[2016/1/01]
\ProvidesClass{\PackageName}%
[\filedate\space Version:\space\PackageVersion\space Jordan Melendez's Homework & Notes Class]
\LoadClass[twoside]{article}
\PassOptionsToPackage{usenames,dvipsnames,svgnames}{xcolor}
\RequirePackage{etex}
\RequirePackage[utf8]{inputenc}
\RequirePackage{xkeyval}[2005/11/25]
\RequirePackage{framed,eso-pic}
\RequirePackage{textcomp}
% Math packages
\RequirePackage{amsmath,amssymb,amsthm,mathrsfs,mathtools}
% Physics packages
\RequirePackage{physics,simplewick,tensor,slashed,esint}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Main Font
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
% Original font for this package
% \RequirePackage{fourier} % Some like the [upright] option for capital math letters. I do not.
\RequirePackage[T1]{fontenc}
% Fun symbols/pictures
\RequirePackage{marvosym}
\RequirePackage{pifont}
% For problem headings, etc.
\RequirePackage[scaled=0.85]{berasans}
\RequirePackage[scaled=0.85]{beramono}
% Other fonts
\RequirePackage{dsfont}
%%%%%%%%
% I don't like the \mathcal font given by fourier
% This changes the font back and scales it appropriately:
% \DeclareFontFamily{OMS}{fcmsy}{\skewchar\font48 }
% \DeclareFontShape{OMS}{fcmsy}{m}{n}{%
% <-5.5> [.942] cmsy5 <5.5-6.5> [.942] cmsy6
% <6.5-7.5> [.942] cmsy7 <7.5-8.5> [.942] cmsy8
% <8.5-9.5> [.942] cmsy9 <9.5-> [.942] cmsy10
% }{}
% \DeclareFontShape{OMS}{fcmsy}{b}{n}{%
% <-6> [.942] cmbsy5
% <6-8> [.942] cmbsy7
% <8-> [.942] cmbsy10
% }{}
% \DeclareMathAlphabet{\mathcal}{OMS}{fcmsy}{m}{n}
%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
% Units
\RequirePackage{siunitx}
% Other
\RequirePackage[bottom,stable,ragged]{footmisc}
\RequirePackage{comment}
\RequirePackage{enumitem}
\RequirePackage{xifthen}
\RequirePackage{fancyhdr}
\RequirePackage{etoolbox}
\RequirePackage{lipsum}
% Redefine page margins
\RequirePackage[centering,top=1in,bottom=1in,left=1in,right=1in, marginparwidth=.8in, marginparsep=.1in, heightrounded]{geometry}
% Hyperlinks
\RequirePackage{hyperref}
\RequirePackage{subfig}
%=============== Headers/Footers ===============%
\pagestyle{fancy}
\fancyhead[RO,LE]{\small\thepage}
\fancyhead[LO]{\small \@author}% odd page header and number to right top
\fancyhead[RE]{\small \@assignment}%Even page header and number at left top
\fancyfoot[L,R,C]{}
\renewcommand{\headrulewidth}{0pt}% disable the underline of the header part
%=============== Counters ===============%
\newcounter{ProblemNum}
\newcounter{SubProblemNum}[ProblemNum]
\setcounter{ProblemNum}{0}
\renewcommand{\theProblemNum}{\arabic{ProblemNum}}
\renewcommand{\theSubProblemNum}{\alph{SubProblemNum}}
% Makes equations reset with problem number
% and labels as (problem#.eq#)
\numberwithin{equation}{ProblemNum}
% \renewcommand{\theequation}{\arabic{ProblemNum}.\arabic{equation}}
% If the notes option is passed, label equations with
% sections rather than by problem number
\DeclareOption{notes}{\numberwithin{equation}{section}}
% Must be after all \DeclareOption statements
\ProcessOptions\relax
%=============== Fancy Sections (disabled) ===============%
%\begin{comment}
\usepackage{titlesec}
\titleformat{\section}[frame]
{\normalfont}
{\filright\footnotesize\enspace SECTION \thesection\enspace}
{8pt}
{\Large\bfseries\filcenter}
\titleformat{\subsection}[block] {\large\bfseries\filright}{\fbox{\thesubsection}}{2em}{}%
%\end{comment}
%=============== Define keyword command: puts in margin ===============%
\newcommand{\keyword}[1]{\textbf{#1}\marginpar{\textsf{#1}}}
%=============== Tikz stuff ===============%
\RequirePackage{calc}
\RequirePackage{tikz}
% We need lots of libraries...
\usetikzlibrary{%
arrows,%
calc,%
fit,%
patterns,%
plotmarks,%
shapes.geometric,%
shapes.misc,%
shapes.symbols,%
shapes.arrows,%
backgrounds,%
topaths,%
trees,%
matrix,%
folding,%
fadings,%
through,%
positioning,%
scopes,%
decorations.shapes,%
decorations.text,%
decorations.pathreplacing,%
decorations.pathmorphing,%
decorations.markings,%
shadows}
\RequirePackage{multido}
\RequirePackage{lscape}
\RequirePackage{graphicx}
\RequirePackage{array}
\RequirePackage{multicol}
\RequirePackage{multirow}
\RequirePackage{tabularx,ragged2e}
\RequirePackage{booktabs}
\RequirePackage[bottom,stable,ragged]{footmisc}
\raggedbottom
%=============== Colors ===============%
% Color scheme for environments
\colorlet{textcolor}{black}
\colorlet{framecolor}{black}
\colorlet{primarycolor}{blue!30}
\colorlet{secondarycolor}{blue!15}
% Not used...
\definecolor{fondpaille}{cmyk}{0,0,0.1,0}
\definecolor{bistre}{rgb}{.75,.50,.30}
\providecolor{bistre}{rgb}{.75,.50,.30}
\colorlet{graphicbackground}{fondpaille}
\colorlet{codebackground}{fondpaille!92!Maroon}
\colorlet{sectioncolor}{Maroon}
\colorlet{titlecolorbox}{fondpaille!92!Maroon}
\colorlet{titlecolorbox2}{fondpaille!80!black}
\colorlet{pdflinkcolor}{blue}
\colorlet{pdfurlcolor}{blue}
\colorlet{pdffilecolor}{Peach}
\colorlet{stringcolor}{green!40!black!100}
\colorlet{commencolor}{blue!0!black!100}
%=============== Math definitions, etc. ===============%
\newcommand{\Lagr}{\mathcal{L}}
\newcommand{\Ham}{\mathcal{H}}
% Sum + Integral symbol
\DeclareMathOperator*{\SumInt}{%
\mathchoice%
{\ooalign{$\displaystyle\sum$\cr\hidewidth$\displaystyle\int$\hidewidth\cr}}
{\ooalign{\raisebox{.14\height}{\scalebox{.7}{$\textstyle\sum$}}\cr\hidewidth$\textstyle\int$\hidewidth\cr}}
{\ooalign{\raisebox{.2\height}{\scalebox{.6}{$\scriptstyle\sum$}}\cr$\scriptstyle\int$\cr}}
{\ooalign{\raisebox{.2\height}{\scalebox{.6}{$\scriptstyle\sum$}}\cr$\scriptstyle\int$\cr}}
}
% If you want filled black squares for proofs:
%\renewcommand{\qedsymbol}{\hfill\ensuremath{\blacksquare}}
% If you want a bold, upright "Proof." in the proof environment:
%\renewcommand*{\proofname}{\textbf{\textup{Proof.}}}
%=============== Theorem/Example Environments ===============%
\newtheorem{theorem}{Theorem}[section]
\theoremstyle{definition}
\newtheorem{example}{Example}[section]
\newtheorem{definition}{Definition}[section]
%=============== Problem/Exercise Environment ===============%
\let\fram@d=\MakeFramed \let\endfram@d=\endMakeFramed
\newcommand*{\ActivBoxName}{}
\newenvironment{problem}[1][\@nil]{%
%\parindent=0pt % If uncommented, new paragraphs are not indented
\refstepcounter{ProblemNum}%
\def\FrameCommand{\color{framecolor}
{\vrule width 1pt\hspace{5pt}}%
}%
\MakeFramed{\advance\hsize-\width\FrameRestore}%
\noindent
\makebox[0pt][l]{%
\hspace{-6pt}%
\setlength{\fboxrule}{1pt}%
\setlength{\fboxsep}{3pt}%
\fcolorbox{framecolor}{primarycolor}{% Numbered box
\rule{4pt}{0pt}%
\makebox[\width+4pt][l]{%
\strut\textbf{\texttt{{\theProblemNum}}}}%
}%
\def\BoxName{#1}%
\ifx\BoxName\@nnil% If no argument, ignore second box. Otherwise make it.
\else%
\hspace{-1pt}%
\fcolorbox{framecolor}{secondarycolor}{%
\rule{6pt}{0pt}%
\makebox[\width+6pt][l]{%
\strut\textbf{\texttt{{\BoxName}}}}% The text that goes in the box
}%
\fi%
}\\*[.5\baselineskip]
\color{framecolor}}{% The lower bounding of the environment
\par\noindent%
\makebox[0pt][l]{%
\hspace{-6pt}%
\rule{6pt}{1pt}%
\rule{\textwidth}{1pt}%
\hspace{-1pt}%
\rule{1pt}{10pt}%
}%
\endMakeFramed
\noindent
\ignorespacesafterend
%\par\medskip
}
%=============== Boxparts and Parts Environments ===============%
% Useful for numbering solutions without entering an environment like enumerate
% Spacing vertically around words like \strut. I don't think this is used here anymore
\newcommand*{\mystrut}{\rule[-.04\baselineskip]{0pt}{.56\baselineskip}}
\newcommand{\LeftMargin}{0pt}% Start with no indentations
\newcommand{\theLabel}[1]{\gdef\@theLabel{#1}}
\newenvironment{boxparts}[1][\@nil]{%
\def\theArg{#1}%
% Now check the argument and determine the labels
\theLabel{\arabic}
\ifx\theArg\@nnil
\else
\ifthenelse{\equal{\theArg}{a}}{%
\theLabel{\alph}
}{%
\ifthenelse{\equal{\theArg}{r}}{%
\theLabel{\roman}
}{%
\ifthenelse{\equal{\theArg}{A}}{%
\theLabel{\Alph}
}{%
\ifthenelse{\equal{\theArg}{R}}{%
\theLabel{\Roman}
}{%
% If unrecognized argument, use \arabic
}%
}{%
}%
}%
}%
\fi
\begin{enumerate}[% The typesetting options for enumerate
label={{\framebox[13pt]{\@theLabel*}}},% [13pt] sets box width and thus will not stretch
leftmargin=\LeftMargin,%
rightmargin=0pt,%
listparindent=\parindent,%
parsep=0pt,%
labelwidth=20pt%
]%
\renewcommand*{\LeftMargin}{12pt+.5em}% If there are nested boxparts, indent the second
\ignorespaces%
}{%
\end{enumerate}%
\ignorespacesafterend%
}
\newenvironment{parts}[1][\@nil]{%
\def\theArg{#1}%
% Now check the argument and determine the labels
\theLabel{\arabic}
\ifx\theArg\@nnil
\else
\ifthenelse{\equal{\theArg}{a}}{%
\theLabel{\alph}
}{%
\ifthenelse{\equal{\theArg}{r}}{%
\theLabel{\roman}
}{%
\ifthenelse{\equal{\theArg}{A}}{%
\theLabel{\Alph}
}{%
\ifthenelse{\equal{\theArg}{R}}{%
\theLabel{\Roman}
}{%
% If unrecognized argument, use \arabic
}%
}{%
}%
}%
}%
\fi
\begin{enumerate}[% The typesetting options for enumerate
label={(\@theLabel*)},%
leftmargin=\LeftMargin,%
rightmargin=0pt,%
listparindent=\parindent,%
parsep=0pt,%
%labelwidth=20pt%
]%
\renewcommand*{\LeftMargin}{12pt+.5em}% If there are nested parts, indent the second
\ignorespaces%
}{%
\end{enumerate}%
\ignorespacesafterend%
}
%=============== fancyTitle Environment ===============%
% The main component of \maketitle
% More spacing
\newcommand*{\mystrutTwo}{\rule[-.04\baselineskip]{0pt}{.9\baselineskip}}
\newenvironment{fancyTitle}[1][\@nil]{%
\parindent=0pt
\def\FrameCommand{\color{framecolor}
{\vrule width 1pt\hspace{5pt}}% Options for MakeFramed
}%
\MakeFramed{\advance\hsize-\width\FrameRestore}%
\noindent
\makebox[0pt][l]{%
\hspace{-6pt}%
\setlength{\fboxrule}{1pt}%
\setlength{\fboxsep}{3pt}%
\fcolorbox{framecolor}{primarycolor}{% Big box
\rule{0pt}{0pt}%
\makebox[\width][c]{%
\mystrutTwo\Large\ding{118}}% The large symbol in box
}%
\def\BoxName{#1}%
\ifthenelse{\equal{\@course}{\@empty}}{}{% If no argument, ignore second box. Otherwise make it.
\hspace{6pt}%
\makebox[\width+6pt][l]{%
\mystrutTwo\Large\textbf{\textsf{{\BoxName}}}}%
}%
}\\*[.3\baselineskip]
\color{textcolor}}{%
%
\noindent
\makebox[0pt][l]{%
\hspace{-6pt}%
\setlength{\fboxrule}{1pt}%
\setlength{\fboxsep}{3pt}%
\fcolorbox{framecolor}{secondarycolor}{% Small box
\rule{1pt}{3pt}% The small symbols in small box
\makebox[3pt][r]{\rule{1pt}{3pt}}% and here
}%
}
\endMakeFramed
\ignorespacesafterend
}
%=============== Maketitle ===============%
% Defines fields useful for homework, etc.
\newcommand{\email}[1]{\def\@email{#1}}
\newcommand{\course}[1]{\def\@course{#1}}
\newcommand{\assignment}[1]{\def\@assignment{#1}}
% Starts fields as empty unless defined by user
\let\@author\@empty
\let\@email\@empty
\let\@course\@empty
\let\@assignment\@empty
\let\@date\@empty
% Defines a new fancy \maketitle
\renewcommand\maketitle{%
\thispagestyle{empty}% Removes headers/footers from first page
\vspace*{-.82in} % Moves header closer to top of page
\begin{fancyTitle}[\@course]% The course on first line
% If fields are empty, ignore them. Otherwise, place in the maketitle
\noindent\ifthenelse{\equal{\@author}{\@empty}}{}{~\Gentsroom\hspace{2.53mm}\@author\newline}%
\noindent\ifthenelse{\equal{\@email}{\@empty}}{}{\Letter\hspace{1.7mm}\@email\newline}%
%\noindent\ifthenelse{\equal{\@course}{\@empty}}{}{\Info~~\@course\newline}%
\noindent\ifthenelse{\equal{\@assignment}{\@empty}}{}{\ding{47}\hspace{1.52mm}\@assignment\newline}%
\noindent\ifthenelse{\equal{\@date}{\@empty}}{}{\ClockLogo\hspace{2.05mm}\@date\newline}%
\end{fancyTitle}%
}
%%%%%%%%%%%%
\endinput
%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
%
% End of file `jamhomework.cls'.
%
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%