While teaching chemistry this year, I’ve needed a quick way to write chemical formulas. The fastest thing to do is just write it out flat–sans sub and superscripts–like Na+, or CO2-. But that’s not pretty, and introduces another potential element that could confuse.
I found that you can use Lingojam’s sub and superscript generators to copy and paste the official UTF-8 characters for pretty much all the sub and superscripts I need for chemistry, but that takes a while to do.
So instead, I put together, just in time to write my finals, a little ChemEqn app that uses keyboard shortcuts to quickly substitute in the sub and superscripts as you type.
- [Ctrl][number]: give you the number subscripted:
- e.g. [Ctrl][2]: gives ₂
- [Ctrl][Shift][number]: gives superscripts:
- e.g. Ctrl][Shift][2]: gives ²
- [Ctrl][Shift][+]: gives a positive charge (⁺)
- [Ctrl][Shift][-]: gives a negative charge (⁻)
- [Ctrl][>]: gives a forward arrow (→)
- [Ctrl][<]: gives a backward arrow (←)
- [Ctrl][/]: gives the double arrow (⇌)
The method is not perfect, since you still have to decide which comes first when you have both a sub and superscript after an element (O₃²⁻ for example). Another issue is that when I do [Ctrl][Shift][+] and [Ctrl][Shift][-] it zooms into and out of the browser window since we’re using the default zoom shortcuts, but that’s, at least for me, a minor inconvenience.
I do like the app since it still makes for quite readable formulas that can be easily copied and pasted almost anywhere without messing up since it only uses UTF-8 characters that are pretty standard across the web (and most computer programs).