gpt4 book ai didi

html - 如何用HTML写求和表达式?

转载 作者:技术小花猫 更新时间:2023-10-29 12:39:07 28 4
gpt4 key购买 nike

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

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

图像是:

enter image description here

我喜欢这样:

∑ <sub>k=1</sub> <sup>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: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 - 如何用HTML写求和表达式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13626132/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com