How to write superscript index in Visual Studio?

Maybe, but I don’t know how to do it.

enter image description here

+14
source share
6 answers

Use the Windows app Charmap.exe. In Font combobox, choose a font with a lot of characters, Arial Unicode MS is a very good choice. Check the "Advanced" box and enter "super" in the search field. All add-in characters will be displayed in the grid, select and copy them and paste into the source code.

Or copy / paste one of them: ¹²³⁴⁵⁶⁷⁸⁹⁰

Subscript characters: ₀₁₂₃₄₅₆₇₈₉

+31
source

Another 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 it as an index.

+2
source

Since there is a tag, I assume that you are using Windows. There is a large openource program called WinCompose that allows you to use easy-to-remember and intuitive shortcuts for a huge number of Unicode characters, including numeric super- and indexes. Each shortcut is called up using the Meta key (for example, Right Alt ), for example:

  • Meta + ^ + 1 gives ¹ ;
  • Meta + _ + 9 gives .

WinCompose also supports searching, can be run in the background and eliminates the tedious procedure of calling a character card, followed by copying or storing Unicode encodings (but also the latter):

enter image description here

R.S. I am not associated with this software in any way. Just a happy user.

+2
source

Adding more details to complement @HansPassant answer. Other commonly used kits that can be used as is by copying / pasting:

ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻ lowercase: ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻ

Lower case letters: ₐ ₑ ₕ ᵢ ⱼ ₖ ₗ ₘ ₙ ₒ ₚ ᵣ ₛ ₜ ᵤ ᵥ ₓ

If you're wondering why a few letters are missing in the above series, read the following posts:

+1
source

It looks like there are some simple tags that you can use to create any superscript / subscript text. The superscript of the <sup> and the subscript of the <sub> .

https://www.w3schools.com/tags/tag_sup.asp

0
source

There are several solutions. Personally, I simply generate text labels in Word, use screen capture and save it as the image that I use with the label.

-2
source

All Articles