For a list of BASHing data 2 blog posts see the index page. ![]()
Not on the keyboard. How to type it?
Try typing this in a plain-text editor or in a terminal, one character at a time:
1 m3 of H2O at -40°C
Unless you've done some clever keymapping or have a most unusual keyboard, you can't. That's annoying if you work in STEM, where you often need to enter subscripts, superscripts and the degree symbol.
A workaround I've seen in non-technical media is to type this instead:
1 cu m of H20 at -40C
That uses only standard QWERTY keyboard characters. It's a reformatting that in context is perfectly understandable, but it's not quite what's wanted.
There are other approaches to typing characters that aren't on your keyboard. One is to find the desired character in a special characters program like gucharmap or in an online resource, then copy and paste the character. As a home-grown alternative I have a script for a popup dialog from which I can copy (click the character) and paste (middle-click paste) any one of several special characters. I wrote about the popup's script in a 2019 BASHing data post.
"Copy/paste" is OK but it breaks your typing flow. Another method is to set a "Compose" key on your keyboard. Wikipedia has a good article on the "Compose" key idea, together with a table of standard X.org key combinations. The drawback here is that you set a "Compose" key on a single computer (and the method varies between distros); composing isn't portable.
For an excellent overview of composing for Xfce and LXDE users, see this 2013 post by Duncan Lock.
There's a portable solution. You can enter any Unicode character in a plain-text editor or a terminal by first typing Ctrl + Shift + u, then the characters in the Unicode code point. Here are the Unicode code points for those three special characters in the example text:
superscript 3 = 00b3 (U+00B3) or just "b3"
subscript 2 = 2082 (U+2082)
degree symbol = 00b0 (U+00B0) or just "b0"
The screenshots below show the separate steps I use to type the first part of the example text in my sakura terminal, with the superscript 3:
As noted above, I can also type "b3" instead of "00b3" after the underlined "u" and get the same result.
Although the Ctrl + Shift + u + codepoint method works with popular text editors and terminal emulators in most distros, it apparently has stopped working in some cases. See here and here for reported fails.
With my MX Linux (Xfce) setup I can use Ctrl + Shift + u + codepoint in Geany, Mousepad, LibreOffice documents, YAD entry forms, browser entry forms, Claws Mail and Gnumeric spreadsheet, but not in ModernCSV or ReText.
Next post:
2025-11-14 Format musings 2: CSV vs KVR (key-values in rows)
Last update: 2025-11-07
The blog posts on this website are licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License