-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtex.miros
313 lines (274 loc) · 6.83 KB
/
tex.miros
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
for thmenv <- @⟨theorem,lemma,exercise,definition,corollary,example⟩
for thmprefix <- @⟨@thmenv:thm,lem,exe,def,cor,exa⟩
block auto start
-- {{{ Environments
string begin
name environment
snip
\begin{$1}
$0
\end{$1}
-- }}}
block auto !math start
-- {{{ Environments & lists & their elements
for env <- @⟨enumerate,itemize,align*⟩
string @⟨@env:olist,ulist,dm⟩
name @⟨@env:ordered list,unordered list,display math⟩
snip
\begin{@env}
$0
\end{@env}
string proof
snip
\begin{proof}$?1⟨[Proof of @^⟨$1⟩]⟩
$0
\end{proof}
string ciff
name cases for ⟺
snip
\begin{enumerate}
\item[$\implies$]$1,
\item[$\impliedby$]$2,
\end{enumerate}
$0
string item
snip \item$|1⟨,[$1] $0⟩
for kind <- @⟨chapter,section,subsection,subsubsection⟩
string @kind
name @kind environment
snip
\\@kind⋄{$1}
$0
-- }}}
block text
import common/math-phrases
-- {{{ References
string ref
snip \ref{$1}$0
string r@thmprefix
snip \ref{@thmprefix:$1}$0
string pref
snip (\ref{$1})$0
string pr@thmprefix
snip (\ref{@thmprefix:$1})$0
-- }}}
block auto
-- {{{ Delimiters
string "
name quote
snip ``$1''$0
string $
name inline math
snip \$$1\$$0
-- }}}
string forcecr
desc Force the content onto a new line
snip {\ \\\}
block math
-- {{{ Sigma/Pi notation
for shorthand <- @⟨sum,prod⟩
for symbol <- @⟨@shorthand:sigma,pi⟩
for operation <- @⟨@shorthand:sum,product⟩
string b@shorthand
name @symbol @operation
desc Write out a @operation using big @symbol notation
snip \\@symbol{$|1⟨$1 = $2,$1⟩}^$|2⟨{$2},\infty$2⟩ $0
-- }}}
-- {{{ Matrices
for matkind <- @⟨matrix,determinant⟩
for matenv <- @⟨@matkind:bmatrix,vmatrix⟩
for shorthand <- @⟨@matkind:mat,det⟩
string 2@shorthand
name 2x2 @matkind
snip
\begin{@matenv}
$1 & $2 \\\\
$3 & $4
\end{@matenv}
string 3@shorthand
name 3x3 @matkind
snip
\begin{@matenv}
$1 & $2 & $3 \\\\
$4 & $5 & $6 \\\\
$7 & $8 & $9
\end{@matenv}
-- }}}
-- {{{ Equations
for createabbr <- @⟨false,true⟩
for operator <- @⟨@createabbr:
@⟨eq,lt,gt⟩,
@⟨neq,defas,leq,geq,iip,iib,iff⟩
⟩
for symbol <- @⟨@createabbr:
@⟨@operator:=,<,>⟩,
@⟨@operator:\neq,\coloneq,\leq,\geq,\implies,\impliedby,\iff⟩
⟩
block auto
abbr @⟨@createabbr:op-@operator,@operator⟩ @symbol
string a@operator
name align at @operator
snip &@symbol $0
block start
string al@operator
name aligned @operator
snip
\\\\ $1 &@symbol $2
$0
string cr@operator
name start with @operator
snip \\\\&@symbol $0
block start
string eqsystem
name system of equations
snip
\left\{
\begin{array}{rl}
$0
\end{array}
\right\}
-- }}}
-- {{{ Explanations
block end
for suffix <- @⟨add,sub,rmul,pow,inv⟩
string ex@suffix
snip
&& \lrb{\square @⟨@suffix:
+ $1,
- $1,
\cdot $1,
^{$1},
^{-1},
⟩}$0
for prefix <- @⟨neg,mul,ln⟩
string ex@prefix
snip && \lrb{@⟨@prefix:-,$1,\ln⟩ \square}$0
string exdiv
snip && \lrb{\frac \square {$1}}$0
string exint
snip && \lrb{\int\square \dif $1}$0
string exdint
snip && \lrb{\int_{$1}^{$2}\square \dif $3}$0
for kind <- @⟨texpl,extrin,exbound,exdef⟩
string @kind
snip
&& \lrb{\text{@⟨@kind:
$1,
triangle inequality on $$1$,
$$1$ is bounded,
definition of $$1$,
⟩}}$0
-- }}}
block auto word
-- {{{ Shorthands
-- {{{ Constants
for constkind <- @⟨default,shortened⟩
for constant <- @⟨@constkind:
@⟨star,delta,Delta,pi,tau,psi,Psi,phi,rho,sigma,alpha,beta,theta,gamma,omega,Omega,half,ordop,land,lor⟩,
@⟨lam,eps,iinf⟩
⟩
for expansion <- @⟨@constkind:
@constant,
@⟨@constant:lambda,epsilon,ifty⟩
⟩
for operator <- @⟨,e,s⟩
string @operator@constant
snip @⟨@operator:,^,_⟩\\@expansion
-- }}}
-- {{{ Logic
abbr frl \forall
abbr exs \exists
abbr nope \bot
abbr yee \top
-- }}}
-- {{{ Set-theory
abbr card \#
abbr ccap \cap
abbr ccup \cup
abbr iin \in
abbr nin \not\in
abbr nuls \varnothing
abbr ortco ^\bot
abbr sdiff \setminus
abbr sinter ^\circ
abbr smul \times
abbr speq \supseteq
abbr spt \supset
abbr sseq \subseteq
abbr sst \subset
-- }}}
-- {{{ Numbers
abbr niinf -\ifty
abbr eniinf ^{-\ifty}
abbr sniinf _{-\ifty}
abbr mul \cdot
abbr nlnl \pm
abbr limsup \lim\sup
-- }}}
-- {{{ Misc
abbr oball \ball
abbr vsm \vecspace
abbr mangle \measuredangle
abbr com \circ
-- }}}
-- {{{ Fonts
abbr bb \mathbb
abbr cal \mathcal
-- }}}
-- }}}
-- {{{ Sets
for set <- @⟨N,Z,Q,I,R,C,P,F⟩
abbr @⟨@set:nats,ints,rats,irats,rrea,comp,ppri,ffie⟩ \mathbb @set
string set
desc Create a set by escaping the brackets
snip \{$1\}
-- }}}
-- {{{ Operators
for noperator <- @⟨ordop,land,lor,equiv,pmod,ldots,cdots,perp,angle,sup⟩
abbr @noperator \\@noperator
for operator <- @⟨cancel,overline,hat,tilde,vec,bar,abs,norm,prob,diprod,sin,cos,sqrt,ln,lrb,zmod,gen,pmob⟩
string @operator
snip \\@operator$|1⟨{$1}, $0⟩
for bioperator <- @⟨iprod,frac,binom,dist⟩
string @bioperator
snip \\@bioperator$|1⟨ $1,{$1}⟩$|2⟨ $2,{$2}⟩ $0
-- }}}
block auto
-- {{{ Subscripts & exponents
pattern (.*)e@⟨t(%a),(%d)⟩
name auto exponent
snip @0^@1 $0
pattern (.*)so(%a)
name auto subscript
snip @0_@1 $0
pattern (\?[%a]+)(%d)
name auto digt subscript
snip @0_@1 $0
string ss
name subscript
snip _{$1} $0
string ee
name exponent
snip ^{$1} $0
-- }}}
-- {{{ Postfix notation
block !word
abbr .inv ^{-1}
abbr .neg _-
abbr .pos _+
abbr .t ^T
-- }}}
-- {{{ Limits & integrals
for limtarget <- @⟨anything,zero,infinity,negative infinity⟩
for prefix <- @⟨@limtarget:,z,i,n⟩
for limtargetsymbol <- @⟨@limtarget:$2,0,\infty,-\infty⟩
string @prefix⋄lim
name limit to @limtarget
snip \lim_{$1 \to @limtargetsymbol} $0
string intd
name definite integral
snip \int_{$|1⟨$1,-\infty$1⟩}^$|2⟨{$2},\infty$2⟩ $3 \dif $0
string inti
name indefinite integral
snip \int $1 \dif $0
-- }}}