Alex Nazarovsky

MATLAB, DSP, Julia, Power quality, Engineering, Metrology

Quick Typing of Commonly Used Math Symbols Using Numeric Keyboard and AutoHotKey

I’m using Autohotkey for keyboard input automation tasks in Windows, like typing repeating sequences of words and so on. I want to share piece of code to automate math symbol input.

There are many math symbols with codes I am too lazy to remember, but I have to use them often. When I am writing tech reports, specifications and requirements, I frequently have to type in characters like δ or σ². I commonly use Microsoft Word for writing, because workflow there is so much faster than in LaTeX. Yeah, I know the benefits of the latter, but in my opinion LaTeX is more suitable for big documents and for publishing, than for daily usage. By the way, Office 2010 supports LaTeX markup in the Formula Editor. But using formulas is an overkill to type for example a degree symbol ° or plus-minus sign ±. So I’ve written a script, which uses numeric keys for fast typing of math symbols. Key NumPlus is used as a selector key. For example if I want to enter ± sign I press on numeric keyboard (+) , then (-), then release both keys.

This is my current character mapping:

Autohotkey script for quick typing of commonly used math symbols
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

; symbol ∠
NumpadAdd & NumPadDot::
    Send, {U+2220}
return

; symbol ≤
NumpadAdd & Numpad7::
    Send, {U+2264}
return

; symbol ≥
NumpadAdd & Numpad9::
    Send, {U+2265}
return

; symbol ∞
NumpadAdd & Numpad8::
    Send, {U+221E}
return

; symbol ≠
NumpadAdd & NumpadDiv::
    Send, {U+2260}
return



; symbol ±
NumpadAdd & NumpadSub::
    Send, {U+00B1}
return

; symbol °
NumpadAdd & NumpadMult::
    Send, {U+00B0}
return

; symbol ≈
NumpadAdd & Numpad4::
    Send, {U+2248}
return


; symbol π
NumpadAdd & Numpad5::
    Send, {U+03C0}
return

; symbol φ
NumpadAdd & Numpad6::
    Send, {U+03C6}
return

; symbol δ
NumpadAdd & Numpad1::
    Send, {U+03B4}
return

; symbol Δ
NumpadAdd & Numpad2::
    Send, {U+0394}
return


; symbol σ²
NumpadAdd & Numpad3::
    Send, {U+03C3}{U+00B2}
return

; symbol γ
NumpadAdd & NumpadEnter::
    Send, {U+03B3}
return


; symbol ←
NumpadAdd & Left::
    Send, {U+2190}
return

; symbol →
NumpadAdd & Right::
    Send, {U+2192}
return

; symbol ↑
NumpadAdd & Up::
    Send, {U+2191}
return

; symbol ↓
NumpadAdd & Down::
    Send, {U+2193}
return

; and this is to enable entering + when you simply press and release NumpadAdd key
NumpadAdd::
    Send {NumpadAdd} 
return