-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmathmacros.sty
More file actions
104 lines (92 loc) · 4.03 KB
/
Copy pathmathmacros.sty
File metadata and controls
104 lines (92 loc) · 4.03 KB
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mathmacros}[2026/07/04 v1.0 Core math macros for math + economics notes]
% =====================================================================
% mathmacros.sty -- general-purpose math notation
% Loaded by mathprelude.sty; can also be used on its own.
% =====================================================================
% ---- Core math packages ----
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{mathtools} % extends amsmath: \DeclarePairedDelimiter, \coloneqq, \xrightarrow
\RequirePackage{bm} % \bm{...} for bold math
% ---- Number sets (blackboard bold) ----
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\F}{\mathbb{F}}
% (biblatex reserves \Rn and \RN for roman numerals, so write \R^{n} directly.)
\newcommand{\Rplus}{\mathbb{R}_{+}} % nonnegative reals
\newcommand{\Rpp}{\mathbb{R}_{++}} % strictly positive reals
% ---- Paired delimiters (auto-scaling with the star form) ----
% Usage: \abs{x} fixed size | \abs*{x} auto-sized to content
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor}
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
\DeclarePairedDelimiter{\inner}{\langle}{\rangle}
\DeclarePairedDelimiter{\parens}{(}{)}
\DeclarePairedDelimiter{\bracks}{[}{]}
\DeclarePairedDelimiter{\set}{\lbrace}{\rbrace}
% Set-builder with a middle bar that scales: \setb{x \in \R \given x > 0}
\providecommand\given{}
\DeclarePairedDelimiterX\setb[1]{\lbrace}{\rbrace}{%
\renewcommand\given{\nonscript\,\delimsize\vert\nonscript\,}#1}
% ---- Operators ----
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\esssup}{ess\,sup}
\DeclareMathOperator*{\essinf}{ess\,inf}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator{\dom}{dom}
\DeclareMathOperator{\ran}{ran}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\spann}{span}
\DeclareMathOperator{\conv}{conv}
\DeclareMathOperator{\aff}{aff}
\DeclareMathOperator{\dist}{dist}
\DeclareMathOperator{\proj}{proj}
\DeclareMathOperator{\diam}{diam}
\DeclareMathOperator{\intr}{int} % interior (int is the integral sign)
\DeclareMathOperator{\relint}{ri}
% ---- Probability & statistics ----
\newcommand{\E}{\mathbb{E}} % expectation: \E[X], \E_{\theta}[X]
\newcommand{\Prob}{\mathbb{P}} % probability: \Prob(A)
\DeclareMathOperator{\Var}{Var}
\DeclareMathOperator{\Cov}{Cov}
\DeclareMathOperator{\Corr}{Corr}
\DeclareMathOperator{\plim}{plim}
\newcommand{\Ind}{\mathbf{1}} % indicator: \Ind\{x > 0\}
\newcommand{\Normal}{\mathcal{N}}
\DeclareMathOperator{\Unif}{Unif}
\newcommand{\indep}{\perp\!\!\!\perp} % independence: X \indep Y
\newcommand{\iid}{\overset{\text{iid}}{\sim}} % X_i \iid \Normal(0,1)
% ---- Modes of convergence (econometrics) ----
\newcommand{\dto}{\xrightarrow{d}} % in distribution
\newcommand{\pto}{\xrightarrow{p}} % in probability
\newcommand{\asto}{\xrightarrow{\text{a.s.}}} % almost surely
% ---- Derivatives & differentials ----
\newcommand{\dd}{\mathop{}\!\mathrm{d}} % upright d: \int f(x)\,\dd x
\newcommand{\dv}[2]{\frac{\dd #1}{\dd #2}}
\newcommand{\pdv}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\grad}{\nabla}
% ---- Vectors, matrices, transpose ----
\newcommand{\vect}[1]{\bm{#1}}
\newcommand{\mat}[1]{\bm{#1}}
\newcommand{\T}{^{\mathsf{T}}} % transpose: A\T
\newcommand{\inv}{^{-1}} % inverse: A\inv
% ---- Handy shorthands ----
\newcommand{\eps}{\varepsilon}
\newcommand{\ph}{\varphi}
\newcommand{\ol}{\overline}
\newcommand{\ul}{\underline}
\newcommand{\wt}{\widetilde}
\newcommand{\wh}{\widehat}
\newcommand{\defeq}{\coloneqq} % :=
\newcommand{\st}{\;\text{s.t.}\;} % such that / subject to (inline)
\newcommand{\then}{\implies}
\endinput