1

I want to write sigma symbol with value which have bottom with n=0, top n and beside a bn in html. Can any one tell me the proper way to do this?

Mr_Green
  • 40,727
  • 45
  • 159
  • 271
user3628181
  • 155
  • 1
  • 1
  • 14

3 Answers3

2

What you do in HTML to produce two-dimensional formulas is rather limited and produces awkward results (see my treatise Math in HTML (and CSS)). The best you can do with HTML alone is something like this:

<table cellspacing="0" cellpadding="0">
    <tr><td align="center"><i>n</i> <td>
    <tr><td align="center"><big>∑</big> <td><i>b<sub>n</sub></i>
    <tr><td align="center"><i>n</i> = 0 <td>
</table>

Perhaps a little tuning with CSS would help. This is a borderline case: anything more complicated probably gets too complicated for formatting reasonably with HTML and CSS. For more complicated math expressions, MathJax or similar libraries are usually recommended. Using MathJax, you could write

<script src=
"http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
$$\sum_{n=0}^n{b_n}$$

Sample output (the first one from plain HTML code, the second one from MathJax):

enter image description here

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390
  • Thanks jukka for solving these issue. Its working in all major browser – user3628181 Sep 09 '14 at 08:20
  • Note from the future: cdn.mathjax.org is nearing its end-of-life, check https://www.mathjax.org/cdn-shutting-down for migration tips (and perhaps update your answer for future readers). – Peter Krautzberger Apr 21 '17 at 07:16
1

Try MathML or LaTeX with MathJax it should be enough.

JSFiddle link [LaTeX] (Provided by @Blender): http://jsfiddle.net/39tqfc1d/1/

\[
    \sum_{n = 1}^k b_n
\]

JSFiddle link [MathML]: http://jsfiddle.net/39tqfc1d/

<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'>
  <munderover>
    <mo>&sum;</mo>
    <mrow>
      <mi>n</mi>
      <mo>=</mo>
      <mn>0</mn>
    </mrow>
    <mi>k</mi>
  </munderover>
</math>
Community
  • 1
  • 1
mpcabd
  • 1,813
  • 15
  • 20
  • You're right, it is but I didn't know that I can use LaTeX, I first thought of MathML then MathJax for its support. Thanks for the info @Blender – mpcabd Sep 09 '14 at 07:51
  • Thanks for the solution. Could you tell me how to write bn beside "∑" symbol – user3628181 Sep 09 '14 at 08:01
  • 1
    This does not really answer the question (which has “in html” in the title and has been tagged with “html” only). MathML is not HTML, even though it can be embedded in HTML and some browsers support this to some extent. – Jukka K. Korpela Sep 09 '14 at 08:08
  • i checked these in other browsers its not rendering in proper format. – user3628181 Sep 09 '14 at 08:16
1

Try to use jqMath

It uses a TeX-like syntax.

$$∑↙{i=0}↖n b_n
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199