我的代码如下:
\documentclass{book}
\usepackage{amsmath}
\begin{document}
Test
\begin{equation}
\left.\begin{array}{c} \displaystyle\sum\limits_{t=0}^{T}\pi
\rho^{t}\overset{\textrm{add and subtract 2nd and 3rd
terms}}{\overbrace{=\displaystyle\sum\limits_{t=0}^{T}\pi \rho
^{t}+\displaystyle\sum\limits_{t=T+1}^{\infty }\pi \rho
^{t}-\displaystyle\sum\limits_{t=T+1}^{\infty }\pi \rho ^{t}}}\ \
\overset{\textrm{combine first two
terms}}{\overbrace{=\displaystyle\sum\limits_{t=0}^{\infty }\pi
\rho ^{t}-\displaystyle\sum\limits_{t=T+1}^{\infty }\pi \rho^{t}}}
\\\noalign{\vskip6pt}
\hspace*{-2pc}\underset{\textrm{factor out }\rho^{T+1}\textrm{ from
second term}}{\underbrace{=\displaystyle\sum\limits_{t=0}^{\infty
}\pi \rho^{t}-\rho ^{T+1}\displaystyle\sum\limits_{t=0}^{\infty
}\pi \rho ^{t}}}\ \ \underset{\begin{smallmatrix}\textrm{use formula
for sum of}\\ \textrm{geometric
series}\end{smallmatrix}}{\underbrace{=\frac{1-\rho^{T+1}}{1-\rho
}\pi }}.
\end{array}\right. \label{eq formula geometric series}
\end{equation}
\end{document}
输出如下:
我正在通过标签将其转换HTML
为MathML
htlatex test "xhtml,mathml,mathml-" " -cunihft" "-cvalidate -p"
转换没有显示任何错误,但符号总和的限制更改为侧限制,但我应该将 MathML 输出与 TeX 输出匹配,即上限和下限应保持原样。请指教...
答案1
(评论太长,因此作为答案发布)
您的数学代码相当复杂——我敢说,没有必要那么复杂?请尝试以下经过修改和简化的代码形式。您是否仍然遇到查询中描述的差异问题?
\documentclass{book}
\usepackage{amsmath}
% struts for to even out vertical spacing
\newcommand\BigStrutA{\vphantom{\sum_{t=0}^{T}}}
\newcommand\BigStrutB{\vphantom{\sum_{t=0}^{\infty}}}
\begin{document}
Proposed new form:
\begin{equation}
\begin{split}
\sum_{t=0}^{T} \pi\rho^{t}
&={}
\overbrace{\sum_{t=0}^{T} \pi\rho^{t}
+\sum_{t=T+1}^\infty \pi\rho^{t}
-\sum_{t=T+1}^\infty \pi\rho^{t}}%
^{\textrm{add and subtract 2nd and 3rd terms}}
{}={}
\overbrace{\sum_{t=0}^\infty \pi\rho^{t}
-\sum_{t=T+1}^\infty \pi\rho^{t}\BigStrutA}%
^{\textrm{combine first two terms}}
\\
&={}
\underbrace{\sum_{t=0}^{\infty} \pi\rho^{t}
-\rho^{T+1} \sum_{t=0}^{\infty} \pi\rho^{t}}%
_{\substack{\textrm{factor out $\rho^{T+1}$}\\
\textrm{from 2nd term}}}
{}={}
\underbrace{\frac{1-\rho^{T+1}}{1-\rho}\,\pi\BigStrutB}%
_{\substack{\textrm{formula for}\\
\textrm{sum of geo-\strut}\\
\textrm{metric series}}}.
\end{split}
\label{eq proposed new form}
\end{equation}
\medskip
For comparison, the orginal form:
\begin{equation}
\left.\begin{array}{c} \displaystyle\sum\limits_{t=0}^{T}\pi
\rho^{t}\overset{\textrm{add and subtract 2nd and 3rd
terms}}{\overbrace{=\displaystyle\sum\limits_{t=0}^{T}\pi \rho
^{t}+\displaystyle\sum\limits_{t=T+1}^{\infty }\pi \rho
^{t}-\displaystyle\sum\limits_{t=T+1}^{\infty }\pi \rho ^{t}}}\ \
\overset{\textrm{combine first two
terms}}{\overbrace{=\displaystyle\sum\limits_{t=0}^{\infty }\pi
\rho ^{t}-\displaystyle\sum\limits_{t=T+1}^{\infty }\pi \rho^{t}}}
\\\noalign{\vskip6pt}
\hspace*{-2pc}\underset{\textrm{factor out }\rho^{T+1}\textrm{ from
second term}}{\underbrace{=\displaystyle\sum\limits_{t=0}^{\infty
}\pi \rho^{t}-\rho ^{T+1}\displaystyle\sum\limits_{t=0}^{\infty
}\pi \rho ^{t}}}\ \ \underset{\begin{smallmatrix}\textrm{use formula
for sum of}\\ \textrm{geometric
series}\end{smallmatrix}}{\underbrace{=\frac{1-\rho^{T+1}}{1-\rho
}\pi }}.
\end{array}\right. \label{eq orig form}
\end{equation}
\end{document}