I have managed to make a character superscript using the following lines of code:
Paragraph p=new Paragraph();
Span s = new Span();
s.BaselineAlignment = BaselineAlignment.Superscript;
s.Inlines.Add("2");
p.Inlines.Add(new Run("EXAMPLE 1 : Describe the behaviour of the function f(x)=(x"));
p.Inlines.Add(s);
p.Inlines.Add(new Run("-1)/(x-1) near x=1."));
But is it possible to write a superscript of a superscript? Like the one shown below:
g(x)=(1+x^2)^(1/x^2)
Here the second ^ will be superscript of the superscript. How to achieve this?
Also let me know is it possible to make a program understand that x^2-1 = (x-1)(x+1)
, and anything similar to this equation, even the nth degree equations?
You could combine BaselineAlignment.Superscript with Typography.Variant="superscript" like this:
<Paragraph FontFamily="Palatino Linotype">
<Run>g(x)=(1+x</Run>
<Run Typography.Variants="Superscript">2</Run>
<Run>)</Run>
<Run BaselineAlignment="Superscript">(1/x</Run>
<Run BaselineAlignment="Superscript" Typography.Variants="Superscript">2</Run>
<Run BaselineAlignment="Superscript">)</Run>
</Paragraph>
This will give you an output something like this:
This project looks promising: http://blog.noldorin.com/2010/04/rendering-tex-math-in-wpf/
Your example equation could be written almost un-modified in TeX notation. See: http://www.texrendr.com/?eqn=g(x)%3D(1%2Bx%5E2)%5E%7B(1%2Fx%5E2)%7D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With