-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMath.tex
55 lines (50 loc) · 1.84 KB
/
Math.tex
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
% quiver style
\usepackage{tikz-cd}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
.. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
.. (\tikztotarget)\tikztonodes}},
settings/.code={\tikzset{quiver/.cd,#1}
\def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
quiver/.cd,pos/.initial=0.35,height/.initial=0}
% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}
% useful macro for class
\newcommand{\probability}[2]{\mathbb{\MakeUppercase{P}}_{#1} \left(#2\right)}
\newcommand{\variance}[2]{\mathrm{Var}_{#1} \left[ #2 \right]}
\newcommand{\expectation}[2]{\mathbb{\MakeUppercase{E}}_{#1} \left[#2\right]}
\newcommand{\at}[3]{\left.#1\right\vert_{#2}^{#3}}
\newcommand\quotient[2]{
\mathchoice
{% \displaystyle
\text{\raise1ex\hbox{$#1$}\Big/\lower1ex\hbox{$#2$}}%
}
{% \textstyle
#1\,/\,#2
}
{% \scriptstyle
#1\,/\,#2
}
{% \scriptscriptstyle
#1\,/\,#2
}
}
\newcommand{\identity}{\mathrm{id}}
\newcommand{\sinc}{\mathop{\mathrm{sinc}}}
\newcommand{\rect}{\mathop{\mathrm{rect}}}
\newcommand{\tri}{\mathop{\mathrm{tri}}}
\newcommand{\Real}{\mathop{\mathrm{Re}}}
\newcommand{\Homomorphism}{\mathrm{Hom}}
\newcommand{\Morphism}{\mathrm{Mor}}
\newcommand{\Object}{\mathrm{Ob}}
\DeclareMathOperator{\im}{Im}
\DeclareMathOperator{\sgn}{sgn}