This repository was archived by the owner on Sep 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommands.sty
More file actions
81 lines (65 loc) · 2.08 KB
/
commands.sty
File metadata and controls
81 lines (65 loc) · 2.08 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
% Environments
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lema}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{exercise}[theorem]{Exercise}
\theoremstyle{definition}
\newtheorem*{definition}{Definition}
\newtheorem*{recall}{Recall}
\newenvironment{optimize}[1]
{\begin{equation}\@ifnotmtarg{#1}{\tag{#1}}\begin{aligned}}
{\end{aligned}\end{equation}}
% Operators
\newcommand{\x}{\times}
\renewcommand{\d}{\updelta}
\newcommand{\dout}{\updelta^{\mathit{out}}}
\newcommand{\din}{\updelta^{\mathit{in}}}
% Common Vars
\newcommand{\R}{\mathbb{R}}
\newcommand{\Rp}{\mathbb{R}_+}
\newcommand{\Rpp}{\mathbb{R}_{++}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Zp}{\mathbb{Z_+}}
\newcommand{\Zpp}{\mathbb{Z_{++}}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\mC}{\mathcal{C}}
\newcommand{\mP}{\mathcal{P}}
\newcommand{\mF}{\mathcal{F}}
\newcommand{\mH}{\mathcal{H}}
\newcommand{\mE}{\mathcal{E}}
\newcommand{\mB}{\mathcal{B}}
\newcommand{\ones}{\mathds{1}}
\newcommand{\coloneqq}{\vcentcolon=}
\newcommand{\eqqcolon}{=\vcentcolon}
% Math operators
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\aff}{aff}
\DeclareMathOperator{\conv}{conv}
\DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor}
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
% Extra
\renewcommand{\emph}[1]{\underline{\smash{#1}}}
\newcommand{\true}{\text{true}}
\newcommand{\false}{\text{false}}
% Copied
% Pretty bar
\newsavebox\myboxA
\newsavebox\myboxB
\newlength\mylenA
\newcommand*\xbar[2][0.75]{%
\sbox{\myboxA}{$\m@th#2$}%
\setbox\myboxB\null% Phantom box
\ht\myboxB=1.1\ht\myboxA%
\dp\myboxB=\dp\myboxA%
\wd\myboxB=#1\wd\myboxA% Scale phantom
\sbox\myboxB{$\m@th\overline{\copy\myboxB}$}% Overlined phantom
\setlength\mylenA{\the\wd\myboxA}% calc width diff
\addtolength\mylenA{-\the\wd\myboxB}%
\ifdim\wd\myboxB<\wd\myboxA%
\rlap{\hskip 0.5\mylenA\usebox\myboxB}{\usebox\myboxA}%
\else
\hskip -0.5\mylenA\rlap{\usebox\myboxA}{\hskip 0.5\mylenA\usebox\myboxB}%
\fi}
\newcommand{\xb}{\xbar{x}}