Ownsight

?找回密码
?立即注册
搜索
热搜: 活动 交友 discuz
查看: 1321|回复: 0
打印 上一主题 下一主题

c# 上标 下标

[复制链接]

803

主题

903

帖子

3201

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3201
跳转到指定楼层
楼主
发表于 2018-2-5 20:19:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
转自:https://www.cnblogs.com/fzj16888/p/5515661.html 

由于工作的需求,需要在word中插入带入带有上标和下标的字符串,比如这样的一个字符串:SO?2?(mg/L)。在网上搜了好久,终是摸索出点思路。


  解决办法:使用转义字符加Unicode的HexEntity就可以实现了。比如定义一个SO?2?(mg/L)这样的字符串如下:"SO\x2084\x00B2\x207B(mg/L)"。其中x2084为 ?(注意:此处为4的下标) 的Unicode HexEntity,x00B2为 2(注意:此处为2的上标) 的Unicode HexEntity,x207B为 ?(注意:此处为-的上标) 的Unicode HexEntity。


  一些常用字符如下:


Common Arithmetic & Alebgra
Character Name
CharacterEntityNum
Entity
Hex
Entity
LESS THAN<<<<
GREATER THAN>>>>
LESS THAN OR EQUAL TO
GREATER THAN OR EQUAL TO
PLUS OR MINUS±±±±
NOT EQUALS
DIVISION SIGN÷÷÷÷
TIMES X××××
MINUS????
DIVISION SLASH--
FRACTION SLASH?&frasl??
SQUARE ROOT RADICAL
CUBE ROOT?--??
FOURTH ROOT?--??
INFINITY
ALEF INFINITY SYMBOL????
FUNCTION ITALIC F????
PRIME (single quote)
DOUBLE PRIME (double quote)
TRIPLE PRIME (triple quote)?--??
THEREFORE (Triangular Dots)
DOT OPERATOR????
SUPERSCRIPT TWO1111
SUPERSCRIPT TWO2222
SUPERSCRIPT THREE3333
LEFT ANGLE BRACKET???
RIGHT ANGLE BRACKET???
LEFT CEILING BRACKET????
RIGHT CEILING BRACKET????
LEFT FLOOR BRACKET????
RIGHT FLOOR BRACKET????
CIRCLED PLUS (Direct Sum)
CIRCLED TIMES (Vector Product)????


Superscript Chart(上标)
Character NameCharacterNum
Entity
Hex
Entity
SUPERSCRIPT ZERO???
SUPERSCRIPT ONE
Entity Code = 1
111
SUPERSCRIPT TWO
Entity Code = 2
222
SUPERSCRIPT THREE
Entity Code = 3
333
SUPERSCRIPT FOUR???
SUPERSCRIPT FIVE???
SUPERSCRIPT SIX???
SUPERSCRIPT SEVEN???
SUPERSCRIPT EIGHT???
SUPERSCRIPT NINE???
SUPERSCRIPT PLUS SIGN???
SUPERSCRIPT MINUS???
SUPERSCRIPT EQUALS SIGN???
SUPERSCRIPT LEFT PARENTHESIS???
SUPERSCRIPT RIGHT PARENTHESIS???
SUPERSCRIPT LATIN SMALL LETTER I???
SUPERSCRIPT LATIN SMALL LETTER N???


Subscript Codes(下标)
Character NameCharacterNum
Entity
Hex
Entity
SUBSCRIPT ZERO???
SUBSCRIPT ONE???
SUBSCRIPT TWO???
SUBSCRIPT THREE???
SUBSCRIPT FOUR???
SUBSCRIPT FIVE???
SUBSCRIPT SIX???
SUBSCRIPT SEVEN???
SUBSCRIPT EIGHT???
SUBSCRIPT NINE???
SUBSCRIPT PLUS SIGN???
SUBSCRIPT MINUS???
SUBSCRIPT EQUALS SIGN???
SUBSCRIPT LEFT PARENTHESIS???
SUBSCRIPT RIGHT PARENTHESIS???
LATIN SUBSCRIPT SMALL LETTER A???
LATIN SUBSCRIPT SMALL LETTER E???
LATIN SUBSCRIPT SMALL LETTER O???
LATIN SUBSCRIPT SMALL LETTER I???
LATIN SUBSCRIPT SMALL LETTER R???
LATIN SUBSCRIPT SMALL LETTER U???
LATIN SUBSCRIPT SMALL LETTER V???
LATIN SUBSCRIPT SMALL LETTER X???
GREEK SUBSCRIPT SMALL LETTER BETA???
GREEK SUBSCRIPT SMALL LETTER GAMMA???
GREEK SUBSCRIPT SMALL LETTER RHO???
GREEK SUBSCRIPT SMALL LETTER PHI???
GREEK SUBSCRIPT SMALL LETTER CHI???

Superscript and Subscript

Check these references for other methods to implement superscript/subscript and extra fractions



Fractions

These codes display fractions set to be all within one line with smaller number, but they can be replaced by other ways of typing a fraction (e.g. "1/2").
-- means no HTML entity code exists and that a numeric code must be used.


Character NameCharacterEntityNum
Entity
Hex
Entity
VULGAR FRACTION 1/4????
VULGAR FRACTION 1/2????
VULGAR FRACTION 3/4????
VULGAR FRACTION 1/3?--??
VULGAR FRACTION 2/3?--??
VULGAR FRACTION 1/5?--??
VULGAR FRACTION 2/5?--??
VULGAR FRACTION 3/5?--??
VULGAR FRACTION 4/5?--??
VULGAR FRACTION 1/6?--??
VULGAR FRACTION 5/6?--??
VULGAR FRACTION 1/8?--??
VULGAR FRACTION 3/8?--??
VULGAR FRACTION 5/8?--??
VULGAR FRACTION 7/8?--??



Common Statistics

-- means no HTML entity code exists and that a numeric code must be used.


Character NameCharacterEntityNum
Entity
Hex
Entity
LOWER CASE MU (Mean)μμμμ
LOWER CASE SIGMA (Standard Deviation)σσσσ
LOWER CASE CHIχχχχ
CAPITAL PI N-ARY PRODUCT
N-ARY COPRODUCT (upside down capital pi)?--??

X-Bar, P-Hat and D-Bar

Some codes like that for x? (X-bar) are actually a combination of two codes - the base letter x plus a code for the line above (?: or???). Capital letter may need to be reduced in size to accomodate the placement of the combining diacritic.

Note on Safari: These symbols use combining characters and may not be correctly Safari 2 or other older browsers.


Statistical Symbol Codes
Character NameCharacterHTML Code
X-Bar (Average)x?x?
P-Hatp?p?
D-BarD?D?


Measurement SymbolsCommon Symbols
Character NameCharacterEntityNum
Entity
Hex
Entity
DEGREE SYMBOL°°°°
MICRO MU SYMBOLμμμμ
SINGLE PRIME (feet, degree minutes)?
DOUBLE PRIME (feet, degree minutes)?
PER MILLE (1/1000th)?


CalculusCommon Calculus Entity Codes
Character NameCharacterEntityNum
Entity
Hex
Entity
INTEGRAL
PARTIAL DIFFERENTIAL????
INCREMENT (Difference or capital Delta)ΔΔ??
NABLA (Backward Difference, Grad or upside down triangle)????

Additional Integral Symbols

These symbols have numeric entity codes only.


Character NameCharacterNum
Entity
Hex
Entity
DOUBLE INTEGRAL???
TRIPLE INTEGRAL???
QUADRUPLE INTEGRAL???
CONTOUR INTEGRAL
SURFACE INTEGRAL???
VOLUME INTEGRAL???
CLOCKWISE INTEGRAL???
ANTICCLOCKWISE INTEGRAL???
CLOCKWISE CONTOUR INTEGRAL???
ANTICLOCKWISE CONTOUR INTEGRAL???



Letter Symbols
Character NameCharacterEntityNum
Entity
Hex
Entity
INFINITY (Sideways 8)
ALEF INFINITY SYMBOL????
WEIERSTRASS POWER SET (Script Capital P)????
IMAGINARY NUMBER (Blackletter I)??
REAL NUMBER (Blackletter I)??
DOUBLE-STRUCK REAL NUMBER (Double R)?--??
COMPLEX NUMBERS (Double C)?--??
NATURAL NUMBERS (Double N)?--??
PRIME NUMBERS (Double P)?--??
RATIONAL NUMBERS (Double Q)?--??
INTEGERS (Double Z)?--??


Character NameCharacterEntityNum
Entity
Hex
Entity
FOR ALL (Upside-down A)????
COMPLEMENT (Thin C)?--??
THERE EXISTS (Backwards E)????
THERE DOES NOT EXIST (Backwards E with slash)?--??
EMPTY SET (O slash)????
NOT SYMBOL (Corner)????
TILDE (Alternate Not Symbol)??----
LOGICAL AND (Wedge or Upside down V Symbol)
LOGICAL OR (V Symbol)
XOR?--??
NAND?--??
NOR?--??
INTERSECTION (Cap or Upside Down U)
UNION (Cup or U Symbol)
ELEMENT OF
NOT AN ELEMENT OF????
SMALL ELEMENT OF?--??
CONTAINS AS MEMBER????
DOES NOT CONTAIN AS MEMBER?--??
SMALL CONTAINS AS MEMBER?--??
SET MINUS?--??
SUBSET OF (Sideways U with cap to left)????
SUPERSET OF (Sideways U with cap to right)????
NOT A SUBSET OF (Subset with Slash)????
NOT A SUPERSET OF (Superset with slash)?--??
SUBSET OF OR EQUAL TO (Subset with line below)????
SUPERSET OF OR EQUAL TO (Superset with line below)????
NEITHER A SUBSET OF NOR EQUAL TO?--??
NEITHER A SUPERSET OF NOR EQUAL TO?--??
SUBSET OF WITH NOT EQUAL TO?--??
SUPERSET OF WITH NOT EQUAL TO?--??
DIAMOND OPERATOR
(Possibility)
?--??
ASYMPTOTICALLY EQUAL TO
One to one Correspondence
?--??
NOT ASYMPTOTICALLY EQUAL TO?--??
MULTISET (U with arrow)?--??
MULTISET MULTIPLICATION (U with dot in center)?--??
MULTISET UNION (U with plus in center)?--??
DOUBLE SUBSET?--??
DOUBLE SUPERSET?--??
DOUBLE INTERSECTION?--??
DOUBLE UNION?--??
N-ARY LOGICAL AND?--??
N-ARY LOGICAL OR?--??
N-ARY INTERSECTION&cu?--??
N-ARY UNION?--??
CURLY LOGICAL OR?--??
CURLY LOGICAL AND?--??
CIRCLED PLUS (Direct Sum)
CIRCLED TIMES (Vector Product)????
CIRCLED MINUS?--??
CIRCLED DIVISION SLASH?--??

Other Element Of Symbols
ELEMENT OF WITH LONG HORIZONTAL STROKE???
ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE???
SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE???
ELEMENT OF WITH DOT ABOVE???
ELEMENT OF WITH OVERBAR???
SMALL ELEMENT OF WITH OVERBAR???
ELEMENT OF WITH UNDERBAR???
ELEMENT OF WITH TWO HORIZONTAL STROKES???
CONTAINS WITH LONG HORIZONTAL STROKE???
CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE???
SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE???
CONTAINS WITH OVERBAR???
SMALL CONTAINS WITH OVERBAR???
NOTATION BAG MEMBERSHIP???


Geometric Symbols

Note: The entity code for the Angle Symbol (∠) is &ang; and the code for the perpendicular angle (⊥) is.
Otherwise, these symbols have numeric codes only.

Angles and Lines
Character NameCharacterNum
Entity
Hex
Entity
RIGHT ANGLE
ANGLE
Entity Code =
MEASURED ANGLE???
SPHERICAL ANGLE???
DIVIDES
DOES NOT DIVIDE???
PARALLEL TO
NOT PARALLEL TO???
RIGHT ANGLE WITH ARC???
RIGHT TRIANGLE
UP TACK (Perpendicular)
Entity Code =
RIGHT TACK???
LEFT TACK???
DOWN TACK???

Logical Proofs

Note: The entity code for the Therefore Symbol (∴) is &there4;. Otherwise, these symbols have numeric codes only.


Character NameCharacterNum
Entity
Hex
Entity
THEREFORE (Triangular Dots)
Entity Code = &there4;
BECAUSE (Upside down Triangular Dots)
PROPORTIONAL TO
Entity Code = &prop;
END OF PROOF (solid rectangle)???



Common Equivalence and Proportion OperatorsCommon Equivalence Operators
Character NameCharacterEntityNum
Entity
Hex
Entity
NOT EQUALS
APPROXIMATELY EQUAL????
ALMOST EQUAL (ASYMPTOTIC)
NOT ALMOST EQUAL TO?--??
TILDE SIMILAR TO
IDENTICAL TO (three lines)
NOT IDENTICAL TO?--??

Other Equivalence Symbols

STRICTLY EQUIVALENT TO???
NOT IDENTICAL TO???
LESS-THAN OVER EQUAL TO
GREATER-THAN OVER EQUAL TO
LESS-THAN BUT NOT EQUAL TO???
GREATER-THAN BUT NOT EQUAL TO???
MUCH LESS-THAN???
MUCH GREATER-THAN???
BETWEEN???
NOT EQUIVALENT TO???
NOT LESS-THAN
NOT GREATER-THAN
NEITHER LESS-THAN NOR EQUAL TO???
NEITHER GREATER-THAN NOR EQUAL TO???
LESS-THAN OR EQUIVALENT TO???
GREATER-THAN OR EQUIVALENT TO???
NEITHER LESS-THAN NOR EQUIVALENT TO???
NEITHER GREATER-THAN NOR EQUIVALENT TO???
LESS-THAN OR GREATER-THAN???
GREATER-THAN OR LESS-THAN???
NEITHER LESS-THAN NOR GREATERTHAN???
NEITHER GREATER-THAN NOR LESSTHAN???
NOT TILDE???
MINUS TILDE???
ASYMPTOTICALLY EQUAL TO???
NOT ASYMPTOTICALLY EQUAL TO???
APPROXIMATELY BUT NOT ACTUALLY EQUAL TO???
NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO???
NOT ALMOST EQUAL TO???
ALMOST EQUAL OR EQUAL TO???
TRIPLE TILDE???
ALL EQUAL TO


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表