如何在HTML中编写求和表达式? [英] How to write summation expression in HTML?

查看:514
本文介绍了如何在HTML中编写求和表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为以下Latex编写等效的HTML表达式:

  $$ \sum_ {k = 1} ^ Nk N-K + 1)

图片为:



I这样做:

 Σ< sub> k = 1< / sub> <坐席将N< / SUP> 

但输出是这样的



Σ k = 1 N



我不擅长HTML,我在网上搜索但找不到答案。
请在此帮助。谢谢!

解决方案

如果您在项目中需要很多东西可能会发现 MathJax 有用。否则,如果您只需要这一个公式,请尝试 - DEMO

 < p> 
< span>& Sigma;< / 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:之前{
font-size:12px;
display:block;
绝对位置;
剩下:0;
top:0;
内容:N;
width:22px;
text-align:center;
}

span:在{
font-size:12px;
display:block;
绝对位置;
剩下:0;
bottom:0;
内容:k = 1;
width:27px;
text-align:center;
}


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=1 N

I am not good at HTML and I searched on web but couldn't find answer. Please help on this..Thanks!

解决方案

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>&Sigma;</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;
}
​

这篇关于如何在HTML中编写求和表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆