The customized math keyboard layout is designed to streamline your mathematical writing everywhere. With a few easy steps, you will be able to type ∀, ℕ, Σ, ∫, ω and other math symbols as easily as you type alphabet letters.
If you don't have Linux check out math keyboard overlay for Mac or Windows.
The following instructions are checked for Ubuntu 20.04 and 22.04.
Download mth file from this repository.
Paste it to /usr/share/X11/xkb/symbols:
sudo cp /path/to/file/mth /usr/share/X11/xkb/symbols
To change the keyboard overlay execute the following command:
setxkbmap -layout mth
Changes apply immediately.
To switch quickly between layouts you can assign a keyboard shortcut (Settings → Keyboard → Shortcuts) to the following command:
setxkbmap -layout <name of a keyboard layout, like "mth" or "us">
You can also change your keyboard layout by hand in the System → Keyboard → Input Sources.
Edit the mth file (don't forget to make a backup copy):
sudo gedit /usr/share/X11/xkb/symbols/mth
To preview layout:
gkbd-keyboard-display -l mth
The mth
file has no extension. Do not add any extension to this file, like mth.txt
.
The mth layout evolves. You can find deprecated layouts here.
Shout out to Clive from the Math Dot Coffee blog (which, as of 2023, no longer exists) — mth
layout is based on their mdc
layout.
I learned about setxkbmap
on lobrun.de blog, which, as of 2023, no longer exists.