-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmathsetup.sty
119 lines (109 loc) · 3.71 KB
/
mathsetup.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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
\usepackage{xspace}
\usepackage{amsmath}
\usepackage{amssymb}
% includes proof env
\usepackage{amsthm}
% provides \mathscr font
\usepackage{mathrsfs}
% provides IEEEeqnarray environment
% included in the texlive-publishers apt-get package
\usepackage[retainorgcmds]{IEEEtrantools}
% labels and refs for enumerate environment
\usepackage{enumitem}
% in the texlive-science apt-get package
% provides the \lightning (contraction) symbol
\usepackage{stmaryrd}
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{prop}[thm]{Proposition}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollary}
\newtheorem*{axiom}{Axiom}
\newtheorem*{defn}{Definition}
\newtheorem*{nota}{Notation}
\newtheorem*{rem*}{\remarknumber}
\providecommand{\remarknumber}{}
\newtheorem*{Ex*}{\exercisenumber}
\providecommand{\exercisenumber}{}
\newtheorem*{exa}{Example}
\newtheorem*{fact}{Fact}
%% ---- RedeclareMathOperator ----
% https://tex.stackexchange.com/questions/175251/how-to-redefine-a-command-using-declaremathoperator
\newcommand\RedeclareMathOperator{%
\@ifstar{\def\rmo@s{m}\rmo@redeclare}{\def\rmo@s{o}\rmo@redeclare}%
}
% this is taken from \renew@command
\newcommand\rmo@redeclare[2]{%
\begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup
\expandafter\@ifundefined\@gtempa
{\@latex@error{\noexpand#1undefined}\@ehc}%
\relax
\expandafter\rmo@declmathop\rmo@s{#1}{#2}}
% This is just \@declmathop without \@ifdefinable
\newcommand\rmo@declmathop[3]{%
\DeclareRobustCommand{#2}{\qopname\newmcodes@#1{#3}}%
}
\@onlypreamble\RedeclareMathOperator
%% ----
\DeclareMathOperator{\st}{\,st.}
\DeclareMathOperator{\iffa}{\Leftrightarrow}
\RedeclareMathOperator{\iff}{\ iff\ }
\DeclareMathOperator{\Ima}{Im}
\DeclareMathOperator{\Int}{Int}
\DeclareMathOperator{\card}{card}
\DeclareMathOperator{\diam}{diam}
\DeclareMathOperator{\nbhd}{nbhd}
\DeclareMathOperator{\subspc}{subspc}
\DeclareMathOperator{\bdry}{\partial}
\DeclareMathOperator{\acc}{acc}
\DeclareMathOperator{\topo}{\tau}
\newcommand{\setcomp}[1]{{#1}^{\mathsf{c}}}
\newcommand{\setint}[1]{{#1}^{\circ}}
% https://tex.stackexchange.com/questions/22252/how-to-typeset-function-restrictions
\newcommand{\restr}[2]{{% we make the whole thing an ordinary symbol
\left.\kern-\nulldelimiterspace % automatically resize the bar with \right
#1 % the function
\vphantom{\big|} % pretend it's a little taller at normal size
\right|_{#2} % this is the delimiter
}}
\newcommand{\loopy}{\circledast}
\newcommand{\attn}{\bigstar}
% as in
% https://tex.stackexchange.com/questions/167030/numbering-of-assumptions
% allow custom labels via \begin{rem}{<label>} of remarks
\newenvironment{rem}[1]{%
%% todo: omit space when #1 undefined, possibly with ifthenelse pkg
\renewcommand{\remarknumber}{Remark #1}%
\begin{rem*}%
\protected@edef\@currentlabel{#1}%
}{%
\end{rem*}
}
\newenvironment{Ex}[1]{%
%% todo: omit space when #1 undefined, possibly with ifthenelse pkg
\renewcommand{\exercisenumber}{Exercise #1}%
\begin{Ex*}%
\protected@edef\@currentlabel{#1}%
}{%
\end{Ex*}
}
% https://tex.stackexchange.com/questions/147812/customizing-equation-numbering-labeling-in-ieeeeqnarray
% ... avoiding pulling in the geometry package for now
\newenvironment{IEEEeqnarraytagged}[2]{%
\begin{equation}
\tag{#2}
\begin{minipage}{\linewidth}
\begin{IEEEeqnarray*}{#1}
}{%
\end{IEEEeqnarray*}
\end{minipage}
\end{equation}
}
\newenvironment{addcomment}{\begin{quote}$\circledast$}{$\circledast$\end{quote}}
\newcommand{\sketch}[1]{
\begin{quote}
\texttt{#1}
\end{quote}
}
%%% https://emacs.stackexchange.com/questions/14971/how-can-i-write-0-1-in-latex-mode-without-breaking-indentation
\newcommand{\openhalf}[2]{\ensuremath{(#1,#2]}}
\newcommand{\halfopen}[2]{\ensuremath{[#1,#2)}}