Hotkey for formulae with superscript

Get help with using AutoHotkey and its commands and hotkeys
Posts: 1
Joined: 22 Feb 2018, 13:51

Hotkey for formulae with superscript

22 Feb 2018, 14:03

I am a complete newbie, to coding in general.
I want to set up just a few hotkeys for chemical formula I use regularly, that include superscript or subscript and special characters. Since notepad and notepad++ don't have an obvious way to write it.
For example, I want to set Alt+C to insert d13C where d is actually a small case greek delta and the 13 is in superscript. I know how to get to charmap to specify the delta, but I can't for the life of me figure out how to get the 13 in superscript. I am sure there must be a way to tell autohotkey using the unicodes for each character including superscript and subscript numbers, I just don't know enough to do it.
User avatar
Posts: 2861
Joined: 17 Oct 2015, 20:28

Re: Hotkey for formulae with superscript

22 Feb 2018, 16:03

I only know of Superscript 1, 2, and 3 -- ¹, ², and ³. I don't know of them for 4-9; and technically not 0, although ° as 0 kind of works. I don't know that Notepad++ supports a superscript like Microsoft Word as a text editor does, or the superscript HTML tags for websites, but you would want to be able to use the native hotkeys in the application or clicking on a button in the toolbar to toggle in and out of super script.

This is the code I use for ¹, ², and ³.

Code: [Select all] [Download] GeSHi © Codebox Plus

3::Send {U+00B3} ; ASC 254 I think is alternative
2::Send {U+00B2} ; ASC 253 I think is alternative
1::Send {U+00B9}

In case it matters, I run the unicode version of AHK.

Also, for creating the δ character, I use this:

Code: [Select all] [Download] GeSHi © Codebox Plus

d::Send {U+03B4} ; delta
User avatar
Posts: 4506
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Hotkey for formulae with superscript

22 Feb 2018, 20:04

- There are two classic ways of doing superscript/subscript: text formatting (that you lose when you paste into Notepad), and hardcoded Unicode characters. I'm not sure how you would do this in Notepad++.
- Btw sometimes I've wanted to do superscript and subscript numbers one on top of the other, but I haven't found a good way to do this, other than formula boxes in MS Word, or using LaTeX, but not in ordinary plaintext in Notepad, or formatted text in WordPad.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Return to “Ask For Help”

Who is online

Users browsing this forum: Kenpt5u, newbieforever, Pardeep Tariyal, Pilu, rooneysoccer and 9 guests