-
Notifications
You must be signed in to change notification settings - Fork 1
/
shortcuts.sty
337 lines (317 loc) · 12.7 KB
/
shortcuts.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
%---- ENVIRONMENTS ----
%
%\newenvironment{diagram*}[1][]{\begin{center}\begin{tikzpicture}[line join=round, line cap=round,#1]}{\end{tikzpicture}\end{center}}
\NewDocumentEnvironment{diagram*}{O{} O{}}{\diagramenvv{#1}{#2}}{\enddiagramenvv}
\NewEnviron{diagramenvv}[2]{\begin{align*}#2\begin{tikzpicture}[line cap=round, line join=round,#1]\BODY\end{tikzpicture}\end{align*}}
\NewDocumentEnvironment{diagram}{O{} O{}}{\diagramenv{#1}{#2}}{\enddiagramenv}
\NewEnviron{diagramenv}[2]{\begin{align}#2\begin{tikzpicture}[line cap=round, line join=round,#1]\BODY\end{tikzpicture}\end{align}}
%\NewDocumentEnvironment{diagram*}{O{} O{}}{\diagramenvv{#1}{#2}}{\enddiagramenvv}
%\NewEnviron{diagramenvv}[2]{\begin{align*}#2\begin{tikzpicture}[line cap=round, line join=round,#1]\BODY\end{tikzpicture}\end{align*}}
\newlength{\arrowlength}
\settowidth{\arrowlength}{$\longrightarrow$}
%---- MANY ALPHABETS ----
%
\renewcommand{\phi}{\varphi}
\renewcommand{\epsilon}{\varepsilon}
\newcommand{\Aa}{\mathcal{A}}
\newcommand{\Bb}{\mathcal{B}}
\newcommand{\Cc}{\mathcal{C}}
\newcommand{\Dd}{\mathcal{D}}
\newcommand{\Ee}{\mathcal{E}}
\newcommand{\Ff}{\mathcal{F}}
\newcommand{\Gg}{\mathcal{G}}
\newcommand{\Hh}{\mathcal{H}}
\newcommand{\Ii}{\mathcal{I}}
\newcommand{\Jj}{\mathcal{J}}
\newcommand{\Kk}{\mathcal{K}}
\newcommand{\Ll}{\mathcal{L}}
\newcommand{\Mm}{\mathcal{M}}
\newcommand{\Nn}{\mathcal{N}}
\newcommand{\Oo}{\mathcal{O}}
\newcommand{\Pp}{\mathcal{P}}
\newcommand{\Qq}{\mathcal{Q}}
\newcommand{\Rr}{\mathcal{R}}
\newcommand{\Ss}{\mathcal{S}}
\newcommand{\Tt}{\mathcal{T}}
\newcommand{\Uu}{\mathcal{U}}
\newcommand{\Vv}{\mathcal{V}}
\newcommand{\Ww}{\mathcal{W}}
\newcommand{\Xx}{\mathcal{X}}
\newcommand{\Yy}{\mathcal{Y}}
\newcommand{\Zz}{\mathcal{Z}}
\newcommand{\IA}{\mathbb{A}}
\newcommand{\IB}{\mathbb{B}}
\newcommand{\IC}{\mathbb{C}}
\newcommand{\ID}{\mathbb{D}}
\newcommand{\IE}{\mathbb{E}}
\newcommand{\IF}{\mathbb{F}}
\newcommand{\IG}{\mathbb{G}}
\newcommand{\IH}{\mathbb{H}}
%\newcommand{\II}{\mathbb{I}}
%\newcommand{\IJ}{\mathbb{J}}
\newcommand{\IK}{\mathbb{K}}
\newcommand{\IL}{\mathbb{L}}
\newcommand{\IM}{\mathbb{M}}
\newcommand{\IN}{\mathbb{N}}
\newcommand{\IO}{\mathbb{O}}
\newcommand{\IP}{\mathbb{P}}
\newcommand{\IQ}{\mathbb{Q}}
\newcommand{\IR}{\mathbb{R}}
\newcommand{\IS}{\mathbb{S}}
\newcommand{\IT}{\mathbb{T}}
\newcommand{\IU}{\mathbb{U}}
\newcommand{\IV}{\mathbb{V}}
\newcommand{\IW}{\mathbb{W}}
\newcommand{\IX}{\mathbb{X}}
\newcommand{\IY}{\mathbb{Y}}
\newcommand{\IZ}{\mathbb{Z}}
\renewcommand{\AA}{\mathfrak{A}}
\newcommand{\BB}{\mathfrak{B}}
\newcommand{\CC}{\mathfrak{C}}
\newcommand{\DD}{\mathfrak{D}}
\newcommand{\EE}{\mathfrak{E}}
\newcommand{\FF}{\mathfrak{F}}
\newcommand{\GG}{\mathfrak{G}}
\newcommand{\HH}{\mathfrak{H}}
\newcommand{\II}{\mathfrak{I}}
\newcommand{\JJ}{\mathfrak{J}}
\newcommand{\KK}{\mathfrak{K}}
\newcommand{\LL}{\mathfrak{L}}
\newcommand{\MM}{\mathfrak{M}}
\newcommand{\NN}{\mathfrak{N}}
\newcommand{\OO}{\mathfrak{O}}
\newcommand{\PP}{\mathfrak{P}}
\newcommand{\QQ}{\mathfrak{Q}}
\newcommand{\RR}{\mathfrak{R}}
\renewcommand{\SS}{\mathfrak{S}}
\newcommand{\TT}{\mathfrak{T}}
\newcommand{\UU}{\mathfrak{U}}
\newcommand{\VV}{\mathfrak{V}}
\newcommand{\WW}{\mathfrak{W}}
\newcommand{\XX}{\mathfrak{X}}
\newcommand{\YY}{\mathfrak{Y}}
\newcommand{\ZZ}{\mathfrak{Z}}
\renewcommand{\aa}{\mathfrak{a}}
\newcommand{\bb}{\mathfrak{b}}
\newcommand{\cc}{\mathfrak{c}}
\newcommand{\dd}{\mathfrak{d}}
\newcommand{\ee}{\mathfrak{e}}
\newcommand{\ff}{\mathfrak{f}}
\let\gge\gg
\renewcommand{\gg}{\mathfrak{g}}
\newcommand{\hh}{\mathfrak{h}}
\newcommand{\ii}{\mathfrak{i}}
\newcommand{\jj}{\mathfrak{j}}
\newcommand{\kk}{\mathfrak{k}}
\let\lle\ll
\renewcommand{\ll}{\mathfrak{l}}
\newcommand{\mm}{\mathfrak{m}}
\newcommand{\nn}{\mathfrak{n}}
\newcommand{\oo}{\mathfrak{o}}
\newcommand{\pp}{\mathfrak{p}}
\newcommand{\qq}{\mathfrak{q}}
\newcommand{\rr}{\mathfrak{r}}
%\newcommand{\ss}{\mathfrak{s}}
%\newcommand{\tt}{\mathfrak{t}}
\newcommand{\uu}{\mathfrak{u}}
\newcommand{\vv}{\mathfrak{v}}
\newcommand{\ww}{\mathfrak{w}}
\newcommand{\xx}{\mathfrak{x}}
\newcommand{\yy}{\mathfrak{y}}
\newcommand{\zz}{\mathfrak{z}}
%---- OPERATORS
%
\newcommand{\newoperator}[1]{\expandafter\def\csname #1\endcsname{\operatorname{#1}}}
\newcommand{\Ann}{\operatorname{Ann}}
\newcommand{\Aut}{\operatorname{Aut}}
\newcommand{\cha}{\operatorname{char}}
\newcommand{\codim}{\operatorname{codim}}
\newcommand{\End}{\operatorname{End}}
\newcommand{\Gal}{\operatorname{Gal}}
\newcommand{\Hom}{\operatorname{Hom}}
\newcommand{\hoehe}{\operatorname{ht}}
\newcommand{\id}{\operatorname{id}}
\newoperator{lcm}
\renewcommand{\Im}{\operatorname{Im}}
\newcommand{\mSpec}{\mm\operatorname{-Spec}}
\newoperator{Ob}
\newoperator{GL}
\newoperator{Min}
\newoperator{Sheaf}
\newcommand{\sh}{\mathrm{sh}}
\newcommand{\red}{\mathrm{red}}
\newcommand{\alt}{\mathrm{alt}}
\newoperator {Cl}
\newoperator{Pic}
\renewcommand{\det}{\operatorname{det}}%otherwise, det_K behaves strangely in displaymode
\newoperator{Mat}
\newoperator{Tr}
\newcommand{\norm}{\operatorname{N}}
\newcommand{\op}{\mathrm{op}}
\newoperator{sep}
\newoperator{rad}
\newoperator{Cov}
\newoperator{Con}
\newoperator{Der}
\newoperator{Funct}
\newoperator{Coeq}
\newoperator{Eq}
\newoperator{Bil}
\newoperator{coker}
\newoperator{supp}
\newoperator{gr}
\newoperator{Tor}
\newoperator{Ext}
\newoperator{sgn}
\DeclareMathOperator{\SPEC}{\mathbf{Spec}}
\DeclareMathOperator{\PROJ}{\mathbf{Proj}}
\newcommand{\proj}{\mathrm{proj}}
\newcommand{\aff}{\mathrm{aff}}
\newcommand{\nil}{\operatorname{nil}}
\newcommand{\Spec}{\operatorname{Spec}}
\newoperator{Proj}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\cat}[1]{\operatorname{#1}}%style of categories
%inductive limit
\newcommand\colimit[1][]{
\mathchoice{\underset{\substack{\displaystyle{\longrightarrow}\\[-1pt]#1}}{\lim}}%displaystyle
{\underset{\textstyle\longrightarrow}{\lim}\underset{#1}{}}%textstyle
{\underset{\scriptstyle\longrightarrow}{\lim}\underset{#1}{}}
{\underset{\longrightarrow}{\lim}\underset{#1}{}}\ %
}
%projective limit
\newcommand\limit[1][]{
\mathchoice{\underset{\substack{\displaystyle{\longleftarrow}\\[-1pt]#1}}{\lim}}%displaystyle
{\underset{\textstyle\longleftarrow}{\lim}\underset{#1}{}}%textstyle
{\underset{\scriptstyle\longleftarrow}{\lim}\underset{#1}{}}
{\underset{\longleftarrow}{\lim}\underset{#1}{}}\ %
}
%---- FANCY ARROWS ----
%
\newcommand{\longto}{\longrightarrow}
\newcommand{\longot}{\longleftarrow}
\newcommand{\isomorphism}[1][]{
\mathrel{\tikz[baseline=(a.base)] \node (a) at (0,0) {$\!\!\longrightarrow\!\!$} node[above=-0.25ex] {\tiny $\sim$} node[below=-0.25ex] {$\scriptstyle #1$};}}
\newcommand{\lisomorphism}[1][]{
\mathrel{\tikz[baseline=(a.base)] \node (a) at (0,0) {$\!\!\longleftarrow\!\!$} node[above=-0.25ex] {\tiny $\sim$} node[below=-0.25ex] {$\scriptstyle #1$};}}
\NewDocumentCommand{\doublemorphism}{O{} O{}}{\mathrel{\overset{#1}{\underset{#2}{\substack{\textstyle\longrightarrow\\[-0.67ex]
\textstyle\longrightarrow}}}}}
\NewDocumentCommand{\doublelmorphism}{O{} O{}}{\mathrel{\overset{#1}{\underset{#2}{\substack{\textstyle\longleftarrow\\[-0.67ex]
\textstyle\longleftarrow}}}}}
\NewDocumentCommand{\doublelrmorphism}{O{} O{}}{\mathrel{\overset{#1}{\underset{#2}{\substack{\textstyle\longrightarrow\\[-0.67ex]
\textstyle\longleftarrow}}}}}
\NewDocumentCommand{\xdoublemorphism}{O{} O{}}{\mathrel{\substack{\textstyle\xrightarrow[\hphantom{#2}]{#1}\\[-2.45ex]
\textstyle\xrightarrow[#2]{\hphantom{#1}}}}}
\NewDocumentCommand{\xdoublelmorphism}{O{} O{}}{\mathrel{\substack{\textstyle\xleftarrow{#1}\\[-0.67ex]
\textstyle\xleftarrow[#2]{}}}}
\NewDocumentCommand{\xdoublelrmorphism}{O{} O{}}{\mathrel{\substack{\textstyle\xleftrightarrow{#1}\\[-0.67ex]
\textstyle\xleftrightarrow[#2]{}}}}
\newcommand{\IsArgEmpty}[3]{%
\if\relax\detokenize{#1}\relax%
#2%
\else%
#3%
\fi}
\DeclareRobustCommand\longtwoheadrightarrow
{\relbar\joinrel\twoheadrightarrow}
\DeclareRobustCommand\longtwoheadleftarrow
{\twoheadleftarrow\joinrel\relbar}
\newcommand{\morphism}[1][]{%
\mathchoice{\overset{#1}{\longto}}%
{\IsArgEmpty{#1}{\rightarrow}{\overset{#1}{\longrightarrow}}}%
{\IsArgEmpty{#1}{\rightarrow}{\overset{#1}{\longrightarrow}}}%
{\IsArgEmpty{#1}{\rightarrow}{\overset{#1}{\longrightarrow}}}%
}
\newcommand{\lmorphism}[1][]{%
\mathchoice{\overset{#1}{\longot}}%
{\IsArgEmpty{#1}{\leftarrow}{\overset{#1}{\longleftarrow}}}%
{\IsArgEmpty{#1}{\leftarrow}{\overset{#1}{\longleftarrow}}}%
{\IsArgEmpty{#1}{\leftarrow}{\overset{#1}{\longleftarrow}}}%
}
\newcommand{\lrmorphism}[1][]{%
\mathchoice{\overset{#1}{\longleftrightarrow}}%
{\IsArgEmpty{#1}{\leftrightarrow}{\overset{#1}{\longleftrightarrow}}}%
{\IsArgEmpty{#1}{\leftrightarrow}{\overset{#1}{\longleftrightarrow}}}%
{\IsArgEmpty{#1}{\leftrightarrow}{\overset{#1}{\longleftrightarrow}}}%
}
\newcommand{\monomorphism}[1][]{%
\mathchoice{\overset{#1}{\mathrel{\smash{\longhookrightarrow}\vphantom{\rightarrow}}}}%
{\IsArgEmpty{#1}{\hookrightarrow}{\overset{#1}{\mathrel{\smash{\longhookrightarrow}\vphantom{\rightarrow}}}}}%
{\IsArgEmpty{#1}{\hookrightarrow}{\overset{#1}{\mathrel{\smash{\longhookrightarrow}\vphantom{\rightarrow}}}}}%
{\IsArgEmpty{#1}{\hookrightarrow}{\overset{#1}{\mathrel{\smash{\longhookrightarrow}\vphantom{\rightarrow}}}}}%
}
\newcommand{\lmonomorphism}[1][]{%
\mathchoice{\overset{#1}{\mathrel{\smash{\longhookleftarrow}\vphantom{\rightarrow}}}}%
{\IsArgEmpty{#1}{\hookleftarrow}{\overset{#1}{\mathrel{\smash{\longhookleftarrow}\vphantom{\rightarrow}}}}}%
{\IsArgEmpty{#1}{\hookleftarrow}{\overset{#1}{\mathrel{\smash{\longhookleftarrow}\vphantom{\rightarrow}}}}}%
{\IsArgEmpty{#1}{\hookleftarrow}{\overset{#1}{\mathrel{\smash{\longhookleftarrow}\vphantom{\rightarrow}}}}}%
}
\newcommand{\epimorphism}[1][]{%
\mathchoice{\overset{#1}{\mathrel{\smash{\longtwoheadrightarrow}\vphantom{\rightarrow}}}}%
{\IsArgEmpty{#1}{\twoheadrightarrow}{\overset{#1}{\mathrel{\smash{\longtwoheadrightarrow}\vphantom{\rightarrow}}}}}%
{\IsArgEmpty{#1}{\twoheadrightarrow}{\overset{#1}{\mathrel{\smash{\longtwoheadrightarrow}\vphantom{\rightarrow}}}}}%
{\IsArgEmpty{#1}{\twoheadrightarrow}{\overset{#1}{\mathrel{\smash{\longtwoheadrightarrow}\vphantom{\rightarrow}}}}}%
}
\newcommand{\lepimorphism}[1][]{%
\mathchoice{\overset{#1}{\mathrel{\smash{\longtwoheadleftarrow}\vphantom{\rightarrow}}}}%
{\IsArgEmpty{#1}{\twoheadleftarrow}{\overset{#1}{\mathrel{\smash{\longtwoheadleftarrow}\vphantom{\rightarrow}}}}}%
{\IsArgEmpty{#1}{\twoheadleftarrow}{\overset{#1}{\mathrel{\smash{\longtwoheadleftarrow}\vphantom{\rightarrow}}}}}%
{\IsArgEmpty{#1}{\twoheadleftarrow}{\overset{#1}{\mathrel{\smash{\longtwoheadleftarrow}\vphantom{\rightarrow}}}}}%
}
%---- MODIFIERS ----
%
\newcommand{\ov}{\overline}
\newcommand{\hacek}[1]{\check{#1}\hspace{0.06125em}}
\DeclareMathSymbol{\widehatsym}{\mathord}{largesymbols}{"62}
\newcommand\lowerwidehatsym{%
\text{\smash{\raisebox{-1.3ex}{%
$\widehatsym$}}}}
\newcommand\fixwidehat[1]{\accentset{\displaystyle\lowerwidehatsym}{#1}}%
%\mathchoice
%{\accentset{\displaystyle\lowerwidehatsym}{#1}}
%{\accentset{\textstyle\lowerwidehatsym}{#1}}
%{\accentset{\scriptstyle\lowerwidehatsym}{#1}}
%{\accentset{\scriptscriptstyle\lowerwidehatsym}{#1}}
%}
\DeclareMathSymbol{\widetildesym}{\mathord}{largesymbols}{"65}
\newcommand\lowerwidetildesym{%
\text{\smash{\raisebox{-1.3ex}{%
$\widetildesym$}}}}
\newcommand\fixwidetilde[1]{\accentset{\displaystyle\lowerwidetildesym}{#1}}%
%\mathchoice
%{\accentset{\displaystyle\lowerwidetildesym}{#1}}
%{\accentset{\textstyle\lowerwidetildesym}{#1}}
% {\accentset{\scriptstyle\lowerwidetildesym}{#1}}
%{\accentset{\scriptscriptstyle\lowerwidetildesym}{#1}}
%}
\newcommand{\snake}[1]{\fixwidetilde{#1}}%space adjusting hack
%---- MISCELLANEOUS ----
%
\newcommand{\defemph}[1]{\textbf{\upshape#1}} %emphasize style of a to-be-defined object in a definition
\newcommand{\itememph}[1]{$(#1)$} %style of alphabetically ordered items
\newcommand{\NAK}{\hyperref[prop:NAK]{[NAK]}}
\newcommand{\ldotspam}{,\ldots,}
\newcommand{\ordinalst}{^{\text{st}}}
\newcommand{\ordinalrd}{^{\text{rd}}}
\newcommand{\ordinalth}{^{\text{th}}}
\newcommand{\st}{\ \middle|\ }
%\newcommand{\dashed}{dash pattern = on 2pt off 2pt}
\def\clap#1{\hbox to 0pt{\hss#1\hss}}
\def\mathllap{\mathpalette\mathllapinternal}
\def\mathrlap{\mathpalette\mathrlapinternal}
\def\mathclap{\mathpalette\mathclapinternal}
\def\mathllapinternal#1#2{%
\llap{$\mathsurround=0pt#1{#2}$}}
\def\mathrlapinternal#1#2{%
\rlap{$\mathsurround=0pt#1{#2}$}}
\def\mathclapinternal#1#2{%
\clap{$\mathsurround=0pt#1{#2}$}}
%nice sqrt
\LetLtxMacro{\oldsqrt}{\sqrt}
\renewcommand{\sqrt}[1][\ ]{%
\def\DHLindex{#1}\mathpalette\DHLhksqrt}
\def\DHLhksqrt#1#2{%
\setbox0=\hbox{$#1\oldsqrt[\DHLindex]{#2\,}$}\dimen0=\ht0
\advance\dimen0-0.2\ht0
\setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
{\box0\lower0.71pt\box2}}