superscript

How do you print superscript in Python?

房东的猫 提交于 2019-11-26 17:56:52
I am aware of the \xb function in python, but it does not seem to work for me. I am aware that I may need to download a third party module to accomplish this, if so, which one would be best? I am a noob with Python, and with StackOverflow hence my basic question. Now a bit about the context... I am currently writing a binomial expansion solver, to try and use skills which I am teaching myself. The problem arises when I attempt to display the user input-ed expansion to the use for confirmation. Currently I am having to print the expression like so: var1 = input("Enter a: ") var2 = input("Enter

Set superscript and subscript in formatted text in wpf

时光怂恿深爱的人放手 提交于 2019-11-26 06:43:34
问题 How can I set some text as subscript/superscript in FormattedText in WPF? 回答1: You use Typography.Variants: <TextBlock> <Run>Normal Text</Run> <Run Typography.Variants="Superscript">Superscript Text</Run> <Run Typography.Variants="Subscript">Subscript Text</Run> </TextBlock> 回答2: You can use something like <TextBlock>5x<Run BaselineAlignment="Superscript">4</Run> + 4</TextBlock> . However, as far as I know, you will have to reduce the font-size yourself. 回答3: I used a layout transform,

Subscript and Superscript a String in Android

天大地大妈咪最大 提交于 2019-11-25 23:18:36
问题 How can you print a string with a subscript or superscript? Can you do this without an external library? I want this to display in a TextView in Android. 回答1: ((TextView)findViewById(R.id.text)).setText(Html.fromHtml("X<sup>2</sup>")); or Common Tasks and How to Do Them in Android 回答2: Example: equation = (TextView) findViewById(R.id.textView1); SpannableStringBuilder cs = new SpannableStringBuilder("X3 + X2"); cs.setSpan(new SuperscriptSpan(), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); cs