summaryrefslogtreecommitdiff
path: root/18.022.sty
blob: a2fe1df5dbe79bd8820ea1098f347c8df781f7fe (plain)
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
%% 18.022.sty - definitions for 18.022
%%
%% Copyright (C) 2009, 2011 Benjamin Barenblat
%%                          http://benjamin.barenblat.name/
%%
%% This document is licensed under the Creative Commons
%% Attribution-NonCommercial-ShareAlike 3.0 United States License.
%% For more information, see
%% http://creativecommons.org/licenses/by-nc-sa/3.0/us/.

%% Identification
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{18.022}[2011/03/14 Definitions for 18.022]

%% Preliminary declarations
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{mathrsfs}
\RequirePackage{amsbsy}

%% Options

%% Main package code
% Redefine proof environment to make it fit better
% \renewenvironment{proof}[1][\proofname]{\setlength{\parindent}{1em}\par
%   \pushQED{\qed}%
%   \normalfont \topsep6\p@\@plus6\p@\relax
%   \trivlist
%   \item[\hskip\labelsep
%         \itshape
%     #1\@addpunct{.}]\ignorespaces
% }{%
%   \popQED\endtrivlist\@endpefalse
% }

% Styling
\renewcommand{\vec}[1]{\mathbf{#1}}
\newcommand{\gvec}[1]{\boldsymbol{#1}}
\newcommand{\cvec}[1]{\begin{bmatrix}#1\end{bmatrix}}
\newcommand{\bra}{\begin{bmatrix}}
\newcommand{\ket}{\end{bmatrix}}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\newcommand{\abs}[1]{\left\lvert#1\right\rvert}
\newcommand{\Epsilon}{\epsilon}
\renewcommand{\epsilon}{\varepsilon}
\renewcommand{\implies}{\Rightarrow}
\renewcommand{\le}{\leqslant}
\renewcommand{\ge}{\geqslant}
\renewcommand{\iff}{\Leftrightarrow}
\renewcommand{\leq}{\leqslant}
\renewcommand{\geq}{\geqslant}

% Abbreviations
\renewcommand{\v}[1]{\vec{#1}}
\newcommand{\cv}[1]{\cvec{#1}}
\newcommand{\half}{\frac{1}{2}}
\newcommand{\cross}{\times}
\let\flux\dot
\renewcommand{\dot}{\cdot}
\newcommand{\R}{\mathbf{R}}
\newcommand{\0}{\vec{0}}
\newcommand{\of}{\circ}
\newcommand{\at}[1]{\Big\vert_{#1}}
\newcommand{\ds}{\displaystyle}
\newcommand{\grad}{\nabla}
\renewcommand{\div}{\nabla\dot}
\newcommand{\curl}{\nabla\cross}
\newcommand{\laplacian}{\nabla^2}

% \dd is the basic partial derivative command, for forms like
%    n
%   d y
%   --- ,
%     n
%   dx
% the nth derivative of y with respect to x.
\newcommand{\dd}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
\newcommand{\ddx}[1]{\dd{#1}{x}}
\newcommand{\ddy}[1]{\dd{#1}{y}}
\newcommand{\ddz}[1]{\dd{#1}{z}}

% For mixed partials, we have \ddd.
\newcommand{\ddd}[3][]{\frac{\partial^{#1} #2}{\partial #3}}
\newcommand{\dddx}[1]{\dds{#1}{x}}
\newcommand{\dddy}[1]{\dds{#1}{y}}
\newcommand{\dddz}[1]{\dds{#1}{z}}

% For mixed second partials, we have \dds.
\newcommand{\dds}[2]{\ddd[2]{#1}{#2}}

\newcommand{\xo}{x_0}
\newcommand{\yo}{y_0}
\newcommand{\zo}{z_0}

% New stuff
\DeclareMathOperator{\graph}{Graph}
\DeclareMathOperator{\proj}{Proj}
\DeclareMathOperator{\sgn}{sgn}

% Define 18.022 stuff for pset.cls
\def\@course{18.022}
\def\@fullcourse{Multivariate and Vector Calculus}
\def\@department{Department of Mathematics}
\def\@school{Massachusetts Institute of Technology}