summaryrefslogtreecommitdiffstats
path: root/mathshit.sty
diff options
context:
space:
mode:
authorsyn <isaqtm@gmail.com>2020-04-12 13:09:33 +0300
committersyn <isaqtm@gmail.com>2020-04-12 13:09:33 +0300
commit406cd62e6c18587b2859bf77434527f2ac87027d (patch)
tree19d040e96c6478bd79fc97929c4a0ecdd734824f /mathshit.sty
parent64ea0cb0fb1bff77d4335c40f3f04085686613bd (diff)
downloadtex2-406cd62e6c18587b2859bf77434527f2ac87027d.tar.gz
Separate math macros & document styles
Diffstat (limited to 'mathshit.sty')
-rw-r--r--mathshit.sty50
1 files changed, 50 insertions, 0 deletions
diff --git a/mathshit.sty b/mathshit.sty
new file mode 100644
index 0000000..5a9cd02
--- /dev/null
+++ b/mathshit.sty
@@ -0,0 +1,50 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{mathshit}[2020/04/04 Math Shit]
+\RequirePackage{framed}
+
+
+\DeclareMathOperator{\dif}{d \!}
+\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
+\newcommand{\dist}[2]{\norm{#1 - #2}}
+
+\makeatletter
+\newenvironment{sqcases}{%
+ \matrix@check\sqcases\env@sqcases
+}{%
+ \endarray\right.%
+}
+\def\env@sqcases{%
+ \let\@ifnextchar\new@ifnextchar
+ \left\lbrack
+ \def\arraystretch{1.2}%
+ \array{@{}l@{\quad}l@{}}%
+}
+\makeatother
+
+\DeclareRobustCommand{\divby}{%
+ \mathrel{\vbox{\baselineskip.65ex\lineskiplimit0pt\hbox{.}\hbox{.}\hbox{.}}}%
+}
+
+\newcommand{\dmquestion}[1]{
+ \begin{center} \textbf{#1} \end{center}
+}
+
+\newcommand{\br}[1]{\left( #1 \right)}
+\newcommand{\brac}[2]{ \br{ \frac{#1}{#2} } }
+\newcommand{\dbrac}[2]{ \br{ \dfrac{#1}{#2} } }
+\newcommand*{\qed}{\hfill\ensuremath{\blacksquare}}
+\newcommand*{\qedempty}{\hfill\ensuremath{\square}}
+
+\newcommand{\explain}[1]{
+ \begin{bmatrix}
+ #1
+ \end{bmatrix}
+}
+
+\newcommand{\probability}[1]{\mathrm{Pr} \left[ #1 \right]}
+\newcommand{\expected}[1]{\mathrm{E} \left[ #1 \right]}
+
+\newcommand{\todo}{\texttt{todo!}}
+
+\newcommand{\osmall}[1]{\overline{o}\left( #1 \right)}
+\newcommand{\symdiff}{\ \triangle \ }