Reputation:
It is possible, but I don't know how is it done.
Upvotes: 33
Views: 49592
Reputation: 1393
In VsCode download the extension "Fast Unicode Math Characters".
The key inputs for ₂
is \_2
then press space key.
The kep inputs for ²
is \^2
then press space key.
Upvotes: 4
Reputation: 25
There are several solutions. Personally, I simply format the label text in Word, use a screen capture and save it as an image that I use with a label.
Upvotes: -2
Reputation: 25945
Adding more details to complement Hans Passant's answer. Other frequently used sets which can be used as is by copy/paste:
Superscript small case letters: ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻ
Subscript small case letters: ₐ ₑ ₕ ᵢ ⱼ ₖ ₗ ₘ ₙ ₒ ₚ ᵣ ₛ ₜ ᵤ ᵥ ₓ
If you're wondering why few letters are missing in above series then please read below posts:
Upvotes: 7
Reputation: 208
This is how usually I tend to do it on Mac.
This approach should work across most of the apps in the Mac. Tested in MacOS 12.5. (Monterey)
Upvotes: 4
Reputation: 1
use (Ctrl + Shift + P) command to apply superscript and subscript in Visual Studio.
Upvotes: 0
Reputation: 11
Looks like there are some simple tags that you can use to make any text superscript/subscript. The superscript tag is <sup>
and the subscript tag is <sub>
.
https://www.w3schools.com/tags/tag_sup.asp
Upvotes: 1
Reputation: 942040
Use the Windows Charmap.exe applet. In the Font combobox select a font that has a lot of glyphs, Arial Unicode MS is a very good choice. Tick the Advanced view checkbox and type "super" in the Search box. The grid will show all superscript glyphs, select and copy from that and paste into your source code.
Or copy/paste one of these: ¹²³⁴⁵⁶⁷⁸⁹⁰
Subscript characters: ₀₁₂₃₄₅₆₇₈₉
Upvotes: 72
Reputation: 1019
Since there is a tag visual-studio-2012, I assume you are running Windows. There is a great opensource program called WinCompose, which allows to use easy-to-remember and intuitive shortcuts for a huge amount of Unicode symbols, including numerical super- and subscripts. Every shortcut is invoked via a Meta
key (e.g. Right Alt
), for example:
Meta
+ ^
+ 1
gives ¹
; Meta
+ _
+ 9
gives ₉
.WinCompose also supports search, can be run in background, and eliminates tedious procedure of calling Character Map with subsequent copy-pasting or remembering the Unicode charsets (but the latter are also listed):
P. S. I'm not affiliated with this software by any means. Just a happy user.
Upvotes: 5
Reputation: 374
One more way for WPF users,
<TextBlock >
<Run>x</Run>
<Run FontSize="8" BaselineAlignment="TextTop" >2</Run>
</TextBlock>
Change BaselineAlignment to TextBottom if you want to use as subscript.
Upvotes: 3