Writing about science often involves using symbols. Unfortunately, few of the symbols we need can be found on the keyboard, which presents a problem. It is not difficult to copy and paste symbols needed, but it is tedious and annoying. Here I present a solution that lets you input any symbol by simply typing its name (prepended with a slash).
The solution described below works for Windows (using AutoHotKey) or Linux (using AutoKey). These tools, among other things, can convert sequences of keystrokes to different, desired outputs. For example, if I were to type “/delta” or “/Delta” in any application, it would replace that text with δ or Δ, respectively.
In the example above, I’ve taken a LaTeX-like approach, but with a forward slash in place of the backslash (therefore not obstructing standard LaTeX commands). You don’t need to know a thing about LaTeX, however, to make use of this solution, and extending the delta example to any unicode character (i.e. any character ever) is easy.
If you are unfamilar with AutoHotKey, don’t worry, the instructions below are all you need.
1) Download AutoHotkey.
2) Download my AHK script here (it’s just a plain text file, with an .ahk extension).
3) Save the script in your startup folder so that it will run all the time. (To find your startup folder, simply type “startup” in Windows Explorer’s address bar and press enter.)
Add your own symbols
To add a new symbol is simple: Right-click on the .ahk file, choose “Edit Script”, and scroll to the bottom. By that stage you will see that it is self explanatory and you simply need to copy and paste and adjust to your liking. I recommend Unicode Lookup to search for symbols.
AutoHotKey, Inkscape, and unicode
Writing macros is often easy with AutoHotKey. However, I initially ran into trouble with Inkscape not accepting unicode characters sent by the script. To solve this problem, my script employs a method that sends the unicode character via the clipboard (equivalent to using copy and paste). Credit for this solution goes to Evgeni.
AutoKey, a Linux utility, is in many ways similar to AutoHotKey (not surprising, given the name).
1) Download the Python 3 version of AutoKey. (The original AutoKey used Python 2, which does not integrate as well with unicode characters. This work-around can help if you are stuck with the Python 2 version.)
Edit (April 2018): Autokey now uses Python 3 by default. See installation instructions in the link above. The original installation instructions for Linux Mint, Ubuntu, and possibly others were
# Install the original autokey sudo apt-get install autokey-gtk # Update autokey to python 3 using pip3 pip3 install --user autokey-py3
To run the application, try either
~/.local/bin/autokey-gtk or /usr/bin/autokey-gtk
Depending on your installation and Linux distribution, Autokey may not be installed to either of the locations noted above. Hence, you may need to first determine where it resides.
2) Open AutoKey and choose “New” from the toolbar, then “Phrase” from the dropdown menu
3) Give your phrase a name (e.g., the name of the character).
4) Paste the desired unicode character in the large, blank text box on the right.
5) For best results, select “Clipboard (Ctrl + V)” under the “Paste using” option.
6) At the bottom of the screen, you will see an option to “Set” an “Abbreviation”.
7) Choose Add, then type in your chosen abbreviation, e.g., /Delta for Δ.
8) Choose the appropriate options. The only required option is “Removed typed abbreviation”. I often check two additional boxes.