How to write superscript / upper index in Visual S

2019-02-12 06:56发布

It is possible, but I don't know how is it done.

enter image description here

5条回答
孤傲高冷的网名
2楼-- · 2019-02-12 07:02

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

查看更多
Explosion°爆炸
3楼-- · 2019-02-12 07:04

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: ₀₁₂₃₄₅₆₇₈₉

查看更多
该账号已被封号
4楼-- · 2019-02-12 07:13

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.

查看更多
欢心
5楼-- · 2019-02-12 07:17

Since there is a tag , 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):

enter image description here

P. S. I'm not affiliated with this software by any means. Just a happy user.

查看更多
叼着烟拽天下
6楼-- · 2019-02-12 07:19

Adding more details to complement @HansPassant'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:

查看更多
登录 后发表回答