-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmacros.sty
executable file
·66 lines (50 loc) · 2.15 KB
/
macros.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
%!TEX encoding = UTF-8 Unicode
\ProvidesPackage{macros}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{mathtools} % \xhookrightarrow
\RequirePackage{thmtools} % \declaretheorem
\RequirePackage{mathrsfs} % \mathscr
\RequirePackage{chemarrow} % \chemarrow
\RequirePackage{siunitx} % \num, \si, \SI
\newcommand*\funarrow{\mathrel{\chemarrow}} % arrow used to declare functions
% Function declaration:
% \fundef[g]XY = g : X -> Y
% \Fundef[g]XY = X --g--> Y
% Default value of optional argument: f
% \fundef XY = f : X -> Y
\newcommand*\fundef[3][f]{{#1}\nolinebreak:{#2}\nolinebreak\funarrow\nolinebreak{#3}}
\newcommand*\Fundef[3][f]{{#2}\nolinebreak\xrightarrow{\ #1\ }\nolinebreak{#3}}
\newcommand*\fundefhook[3][f]{{#1}\nolinebreak:{#2}\nolinebreak\hookrightarrow\nolinebreak{#3}}
\newcommand*\Fundefhook[3][f]{{#2}\nolinebreak\xhookrightarrow{\ #1\ }\nolinebreak{#3}}
\newcommand*\R{\mathbb{R}} % set/field of real numbers
\newcommand*\N{\mathbb{N}} % set of non negative integers
\newcommand*\pset{\mathscr{P}} % power set (set of subsets)
\newcommand*\comp[1]{\bar{#1}} % complementary
% Set definition:
% \setdef[x\in X]{P(x)} = {x ∈ X | P(x)}
% Default value of optional argument: x
% \setdef{P(x)} = {x | P(x)}
\newcommand*\setdef[2][x]{\{{#1}\,|\,{#2}\}}
\newcommand*\Setdef[2][x]{\left\{{#1}\vphantom{#2}\right.\left|\,{#2}\vphantom{#1}\right\}}
\newcommand*\set[1]{\{{#1}\}}
\newcommand*\Set[1]{\left\{{#1}\right\}}
\newcommand*\is{:=} % "equal by definition"
\newcommand*\isis{=:}
\newcommand*\de{\mathrm{d}}
\DeclareMathOperator\cov{Cov} % covariance
\DeclareMathOperator\corr{Corr} % correlation
\DeclareMathOperator\var{Var} % variance
\DeclareMathOperator\cred{Cr} % credibility
\DeclareMathOperator\cvg{C} % coverage
\DeclareMathOperator\erf{erf} % error function
\DeclareMathOperator\atan{atan} % arctangent
\newcommand*\avg[1]{\langle{#1}\rangle}
\newcommand*\Avg[1]{\left\langle{#1}\right\rangle}
\DeclareMathOperator\sgn{sgn}
\newcommand*\transp{\top}
\newcommand*\pdv[2]{\frac{\partial #1}{\partial #2}}
\newcommand*\Pdv[3][2]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
\newcommand*\dv[2]{\frac{\de #1}{\de #2}}
\endinput