Hi, I am wondering if there is a way to include subscripts or superscripts in Daniweb?

I just answered a question about polynomials and it would have been nice to have more math symbols available to discuss math-related topics when they come up.

For example, instead of writing a polynomial as follows:

a0*x^0 + a1*x^1 + a2*x^2 + a3*x^3 + . . .

it would have been nice to write it with the proper subscripts and superscripts. I tried to use HTML code (<sub> and <sup>), but that didn't work. Am I overlooking something?

Also, another bit of annoying behaviour: when the line above is not wrapped in code tags, the '*' sign is removed and the characters are pushed together. For example, a2*x^2 becomes a2x^2 when the post is actually posted. Is there a way to stop this behaviour?

Recommended Answers

All 2 Replies

I am wondering if there is a way to include subscripts or superscripts in Daniweb?

Not presently. When we were using vBulletin as the back end we allowed TeX formatting, but it was very much unused.

I tried to use HTML code (<sub> and <sup>), but that didn't work.

Yup, straight HTML isn't allowed in our editor for various good reasons. ;)

when the line above is not wrapped in code tags, the '*' sign is removed and the characters are pushed together.

Yes, the * character has special meaning for Markdown, our formatting language. You can escape them with a backslash to disable parsing as a bold or italic starter character: \*

For example, instead of writing a polynomial as follows:

a0*x^0 + a1*x^1 + a2*x^2 + a3*x^3 + . . .

it would have been nice to write it with the proper subscripts and superscripts. I tried to use HTML code (<sub> and <sup>), but that didn't work. Am I overlooking something?

Probably that what you wrote above is understandable and easier to write than using special commands to super- and subscript.

No, I don't think you're overlooking anything.

a0x^0 + a1x^1 + a2x^2 + a3x^3 + . . . Normal

a0*x^0 + a1*x^1 + a2*x^2 + a3*x^3 + . . . Inline Tags

a0*x^0 + a1*x^1 + a2*x^2 + a3*x^3 + . . .  Code Tags

I see what you mean. Use Inline Tags since it is essentially code

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.