How to write equivalent HTML expression for following Latex:
$$\sum_{k=1}^Nk(N-k+1)
The image is:
I did like this:
∑ <sub>k=1</sub> <sup>N</sup>
but output is like this
∑ k=1N
I am not good at HTML and I searched on web but couldn't find answer. Please help on this..Thanks!
to get: ∑k=1N k (N - k + 1) .
A series can be represented in a compact form, called summation or sigma notation. The Greek capital letter, ∑ , is used to represent the sum. The series 4+8+12+16+20+24 can be expressed as 6∑n=14n . The expression is read as the sum of 4n as n goes from 1 to 6 .
You can press the Alt key in combination with numbers on the numeric keypad to insert the Sigma symbol: Press Alt + 229 to enter lower case Sigma (σ) Press Alt + 228 to enter upper case or capital letter Sigma (Σ)
If you need it for a lot of stuff in your project you'll probably find MathJax useful. Otherwise if you need just this one formula then try this - DEMO
<p>
<span>Σ</span>
k ( N - k + 1 )
</p>
CSS
p {
height: 50px;
line-height: 50px;
}
span {
position: relative;
font-size: 2.5em;
display: inline-block;
line-height: .7em;
vertical-align: middle;
}
span:before {
font-size: 12px;
display: block;
position absolute;
left: 0;
top: 0;
content: "N";
width: 22px;
text-align: center;
}
span:after {
font-size: 12px;
display: block;
position absolute;
left: 0;
bottom: 0;
content: "k = 1";
width: 27px;
text-align: center;
}
Whilst MathJax is almost certainly the correct answer (there is even an example of a summation on the homepage), you can use simple HTML elements (however these won't look as good as the final MathJax/LaTeX results).
The summation sign is HTML entity ∑
and the super- and sub-scripts can be marked up with the sup
and sub
elements, so try:
∑<sub>k=1</sub><sup>N</sup> k (N - k + 1)
to get: ∑k=1N k (N - k + 1) .
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