forked from ma-anwar/mathfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlyx.talon
368 lines (330 loc) · 8.06 KB
/
lyx.talon
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
app: lyx
app: LyX.exe
app: LyX2.3.exe
app: LyX for Windows
-
#Play around with delays to make them as low as possible, mostly needed for filling matrices
settings():
key_wait = 2
insert_wait = 14
#tag(): user.line_commands}
{user.tex_symbols}:
key(\)
insert(tex_symbols)
key(space)
greek {user.tex_greek_letters}:
key(\)
insert(tex_greek_letters)
key(space)
<number> {user.mathfly_fractions}:
key(alt-m f)
insert(number)
key(down)
insert(mathfly_fractions)
key(right)
#anything that breaks down into cases like absolute value functions
# Add matrix row to add more cases
cases: "\cases "
# Any sequence of letters that needs to be formatted normally in math mode, e.g. log
operator <user.letters>:
insert("\\text ")
sleep(10ms)
# user.insert_formatted(letters, "alldown")
user.insert_formatted(letters, "all down")
edit.right()
#enable sentence formatter in formatters.py dictionary for this to work
#A sequence of letters that needs to be formatted normally with the first letter capital, e.g. Log
capital operator <user.letters>:
insert('\\text ')
sleep(10ms)
# user.insert_formatted(letters, "sentence")
user.insert_formatted(letters, "all cap")
#matrices are surrounded by square brackets
#some edge cases
matrix one by <number>:
key("alt-m [")
insert('\\array ')
key("alt-m c i")
repeat(number-2)
matrix <number> by one:
key("alt-m [")
insert('\\array ')
key("alt-m w i")
repeat(number-2)
matrix <number> by <number>:
key("alt-m [")
insert("\\array ")
key("alt-m w i")
repeat(number_1-2)
key("alt-m c i")
repeat(number_2-2)
#commands to add lines in matrices
line above:
key("alt-m w a")
line below:
key("alt-m w z")
line right:
key("alt-m c z")
line left:
key("alt-m c a")
#matrix surrounded by pipes for cross product
cross <number> by <number>:
key("alt-m |")
insert("\\array ")
key("alt-m w i")
repeat(number_1-2)
key("alt-m c i")
repeat(number_2-2)
# commands to fill matrices with numbers/symbols, use with repetitions inside of a cell, "fill one third"
dump <number>:
insert(number)
key(tab)
fill pipe:
insert('|')
key(tab)
#useful for truth tables
pump <number>:
insert(number)
key(down)
pump alternating:
insert('0')
key(down)
insert('1')
key(down)
justify equal:
insert("\overset =")
key(up)
fraction: key(alt-m f)
over: key(shift-left alt-m f down)
(super script | to the power): key(^)
sub script: key(_)
squared: key(^ 2 right)
cubed: key(^ 3 right)
inverse: key(^ - 1 right)
(prekris | parens | brackets | parents): key(alt-m ()
(brax | square brackets): key(alt-m [)
curly [brackets]: key(alt-m {)
absolute: key(alt-m |)
angles: key(alt-m <)
add matrix row: key(alt-m w i)
(delete | remove) matrix row: key(alt-m w d)
add matrix column: key(alt-m c i)
(delete | remove) matrix column: key(alt-m c d)
accent tilde: key(alt-m &)
accent dot: key(alt-m .)
accent double dot : key("alt-m \")
accent bar: key(alt-m b)
accent vector: key(alt-m v)
summation:
insert("\\stackrelthree ")
key(down)
insert("\\sum ")
key(down)
big union:
insert('\\stackrelthree ')
key(down)
insert('\\bigcup ')
key(down)
blank product: "\\prod "
product:
insert("\\stackrelthree ")
key(down)
insert("\\prod ")
key(down)
limit:
insert("\\underset \\lim ")
key(down)
label above: "\\overset "
label below: "\\underset "
prime:
insert("^\\prime ")
key(right)
degrees:
insert("^\\circ ")
key(right)
#
real numbers:
insert("\\mathbb R")
key(right)
complex numbers:
insert("\\mathbb C")
key(right)
integer numbers:
insert("\\mathbb Z")
key(right)
rational numbers:
insert("\\mathbb Q")
key(right)
natural numbers:
insert("\\mathbb N")
key(right)
finite field:
insert('\\mathbb F')
key(right)
Polynomial Space:
insert('\\mathbb Pf')
key(right)
#
# Program control
#
new file: key(ctrl-n)
open file: key(ctrl-o)
save as: key(ctrl-shift-s)
math: key(ctrl-m)
display mode: key(ctrl-shift-m)
normal mode: key(alt-p s)
view PDF: key(ctrl-r)
update PDF: key(ctrl-shift-r)
next tab: key(ctrl-pgdown)
(prior | previous) tab: key(ctrl-pgup)
# close tab: key(ctrl-w)
move line up: key(alt-up)
move line down: key(alt-down)
#formatting
insert (in line formula | in line): key(alt-i h i)
insert (numbered formula): key(alt-i h n)
insert (display formula | display): key(alt-i h d)
insert equation array: key(alt-i h e)
insert align: key(alt-i h a)
insert AMS align at [environment]: key(alt-i h t)
insert AMS flalign [environment]: key(alt-i h f)
insert (AMS gathered environment | AMS gather): key(alt-i h g)
insert (AMS multline [environment]| multiline): key(alt-i h m)
insert array [environment]: key(alt-i h y)
insert (cases [environment] | piecewise): key(alt-i h c)
insert (aligned [environment] | align): key(alt-i h l)
insert aligned at [environment]: key(alt-i h v)
insert gathered [environment]: key(alt-i h h)
insert split [environment]: key(alt-i h s)
insert delimiters: key(alt-i h r)
insert matrix: key(alt-i h x)
insert macro: key(alt-i h o)
insert [bulleted] list: key(alt-p b)
insert numbered list: key(alt-p e)
insert description: key(alt-p d)
insert part: key(alt-p 0)
insert (section | heading): key(alt-p 2)
insert sub (section | heading): key(alt-p 3)
insert sub sub (section | heading): key(alt-p 4)
insert paragraph: key(alt-p 5)
insert sub paragraph: key(alt-p 6)
insert title: key(alt-p t)
insert author: key(alt-p shift-a)
insert date: key(alt-p shift-d)
insert abstract: key(alt-p a)
insert address: key(alt-p alt-a)
insert bibliography: key(alt-p shift-b)
insert quotation: key(alt-p alt-q)
insert quote: key(alt-p q)
insert verse: key(alt-p v)
insert code: key(alt-p c)
Insert typewriter: key(ctrl-shift-p)
insert unnumbered part: key(alt-p * 0)
insert unnumbered (section | heading): key(alt-p * 2)
insert unnumbered sub (section | heading): key(alt-p * 3)
insert unnumbered sub sub (section | heading): key(alt-p * 4)
#commands for quick subscripts
under (<user.letter>):
key(_)
insert(letter)
edit.right()
under (<number>):
key(_)
insert(number)
edit.right()
<user.letter> under (<number>):
insert(letter)
key(_)
insert(number)
edit.right()
#commands for quick superscripts
super (<number>):
key(^)
insert(number)
edit.right()
super (<user.letter>):
key(^)
insert(letter)
edit.right()
not equal: key(alt-m =)
# zero [matrix | vector]:
# key(alt-m v)
# insert("0")
# edit.right()
#cardinality of a set
state cardinality <user.letter>:
key(ctrl-m)
key(alt-m |)
insert(user.formatted_text(letter, "ALL_CAPS"))
edit.right()
#calligraphic font, must use capital letter
call mode:
insert("\mathcal ")
calligraphic <user.letter>:
insert('\mathcal ')
# user.keys_uppercase_letters(letter)
insert(user.formatted_text(letter, "all cap"))
edit.right()
state done: "\\blacksquare "
#Large zero in matrices
huge zero:
insert("\\text{\huge0")
edit.right()
edit.right()
part real:
insert('\\textnormal Re ')
edit.right()
part imagine:
insert('\\textnormal Im ')
edit.right()
argument:
insert('\\textnormal Arg')
edit.right()
#ceil and floor
mark ceiling:
insert("\lceil ")
insert("\\rceil ")
edit.left()
mark floor:
insert("\lfloor ")
insert("\\rfloor ")
edit.left()
oiler:
insert('e^i')
#useful commands when writing pseudocode in lyx
chiff tab:
key(shift-tab)
#array index
op under:
insert("[]")
edit.left()
push semi:
edit.line_end()
insert(";")
key(enter)
semi:
insert(";")
set complement:
insert("^c ")
multivariable limit:
insert("\\lim _(x,y)\\rightarrow ")
key(alt-m ()
covariance:
insert("\\textrm Cov")
edit.right()
key(alt-m ()
variance:
insert("\\textrm Var")
edit.right()
key(alt-m ()
expectation:
insert("\\textrm E")
edit.right()
key(alt-m ()
correlation:
insert("\\textrm Cor")
edit.right()
key(alt-m ()
text [<user.formatters>] [<user.text>]:
text = user.formatted_text(text or "", formatters or "all down")
insert("\\text {text}")