-
Notifications
You must be signed in to change notification settings - Fork 0
/
readtex-core.sty
105 lines (97 loc) · 3.37 KB
/
readtex-core.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
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz} % Necessary for arc command
\usepackage{graphicx, tipa} % Necessary for arc command
\usepackage{mathrsfs}
%
% Various Helper Commands
%
% For derivatives
\newcommand{\deriv}[1]{\frac{\mathrm{d}}{\mathrm{d}x} (#1)}
% For partial derivatives
\newcommand{\pderiv}[2]{\frac{\partial}{\partial #1} (#2)}
\DeclareMathOperator\erf{\mathscr{E}rf}
% Integral dx
\newcommand{\dx}{\mathrm{d}x}
% Probability commands: Expectation, Variance, Covariance, Bias
\newcommand{\E}{\mathrm{E}}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\Cov}{\mathrm{Cov}}
\newcommand{\Bias}{\mathrm{Bias}}
% Geometry Commands
\newcommand{\arc}[1]{%
\setbox9=\hbox{#1}%
\ooalign{\resizebox{\wd9}{\height}{\texttoptiebar{\phantom{A}}}\cr#1}}
% Column vector
\newcount\colveccount
\newcommand*\colvec[1]{
\global\colveccount#1
\begin{pmatrix}
\colvecnext
}
\def\colvecnext#1{
#1
\global\advance\colveccount-1
\ifnum\colveccount>0
\\
\expandafter\colvecnext
\else
\end{pmatrix}
\fi
}
% Norm
\newcommand{\norm}[1][\cdot]{\left\lVert#1\right\rVert}
% Other useful macros
\newcommand{\N}{{\mathbb N}} % natural numbers
\newcommand{\Z}{{\mathbb Z}} % integers
\newcommand{\Q}{{\mathbb Q}} % rational numbers
\newcommand{\R}{{\mathbb R}} % real numbers
\newcommand{\C}{{\mathbb C}} % complex numbers
\newcommand{\D}{{\mathbb D}} % unit disk
\newcommand{\ov}{\overline} % shorthand for a bar on a symbol
\newcommand{\infinity}{\infty} % infinity
% Relations
\newcommand{\divides}{\mid} % longhand for divides
\newcommand{\notdivides}{\nmid} % longhand for not divides
\newcommand{\identically}{\equiv} % longhand for function is
% identically
\newcommand{\propersubset}{\subsetneqq} % proper subset
\newcommand{\propsubset}{\propersubset}
\newcommand{\congruent}{\equiv} % longhand for congruent
\newcommand{\isom}{\cong} % isomorphic
\newcommand{\intersect}{\cap}
\newcommand{\Intersect}{\bigcap}
\newcommand{\union}{\cup}
\newcommand{\Union}{\bigcup}
\newcommand{\disjunion}{\sqcup} % disjoint union
\newcommand{\Disjunion}{\bigsqcup} % Big disjoint union
\newcommand{\dunion}{\disjunion}
\newcommand{\Dunion}{\Disjunion}
% functions
\newcommand{\from}{\colon} % proper spacing for f: X \to Y. Read ``f
% from X to Y''
\newcommand{\into}{\hookrightarrow} % injective arrow
\newcommand{\onto}{\twoheadrightarrow} % surjective arrow
\newcommand{\correspondsto}{\leftrightarrow} % correspondance arrow
\newcommand{\onetoonecorrespondence}{\overset{1\text{-}1}{\longleftrightarrow}}% one-to-one correspondance arrow
\newcommand{\isomto}{\overset{\sim}{\to}} % isomorphism arrow
% quantifiers
\newcommand{\suchthat}{\mid} % for power set notation
\newcommand{\st}{\suchthat} % shorthand for such that
\newcommand{\unique}{!} % long form for unique
% Operators
\DeclareMathOperator{\Span}{span}
\DeclareMathOperator{\rank}{rank}
\newcommand{\rk}{\rank}
\DeclareMathOperator{\codim}{codim}
% Categories
\newcommand{\catname}[1]{{\normalfont\textbf{#1}}}
\newcommand{\derivcat}{\mathcal{D}}
% Redefining how I want TeX to work
\renewcommand{\emptyset}{{\varnothing}}
\renewcommand{\implies}{\mathrel{\Longrightarrow}}
\renewcommand{\impliedby}{\mathrel{\Longleftarrow}}
\renewcommand{\iff}{\mathrel{\Longleftrightarrow}}
\renewcommand{\subset}{\subseteq}
\renewcommand{\supset}{\supseteq}