![显示方程式也需要转换为 HTML 标签 (TeX4ht)](https://linux22.com/image/386583/%E6%98%BE%E7%A4%BA%E6%96%B9%E7%A8%8B%E5%BC%8F%E4%B9%9F%E9%9C%80%E8%A6%81%E8%BD%AC%E6%8D%A2%E4%B8%BA%20HTML%20%E6%A0%87%E7%AD%BE%20(TeX4ht).png)
是否可以在显示数学中获取 HTML 标签中的简单数学?我的标签如下:
\documentclass{book}
\begin{document}
This is for test $a+b=c$
\[
a+b=c\qquad p_1 = \frac{m}{x_1}- p_2.
\]
\[
ab
\]
\end{document}
在内联数学中,简单的数学运算,例如 $a+b=c$ 转换为 HTML 标签,但在显示数学中内容相同,然后它被转换为图像,但我需要简单的数学运算在显示和内联数学中都转换为 HTML 标签?请指教...
答案1
尝试以下配置:
\Preamble{xhtml}
\Configure{[]}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="displaymath">}\bgroup$$\everydisplay{}\everymath{}}{$$\egroup\HCode{</div>}}
\Configure{$$}{\ifvmode\IgnorePar\fi\EndP\HCode{<div class="displaymath">}\bgroup\everydisplay{}\everymath{}}{\egroup\HCode{</div>}}{}
\begin{document}
\EndPreamble
它配置\[\]
和$$...$$
,并将数学放在<div class="displaymath">
元素中。
结果:
<!--l. 5--><p class="noindent" >This is for test <span
class="cmmi-10">a </span>+ <span
class="cmmi-10">b </span>= <span
class="cmmi-10">c</span>
</p>
<div class="displaymath">
<span
class="cmmi-10">a </span>+ <span
class="cmmi-10">b </span>= <span
class="cmmi-10">c p</span><sub><span
class="cmr-7">1</span></sub> = <img
src="sample0x.png" alt="m-
x1" class="frac" align="middle" /> <span
class="cmsy-10">− </span><span
class="cmmi-10">p</span><sub><span
class="cmr-7">2</span></sub><span
class="cmmi-10">.</span>
</div>
<div class="displaymath">
<span
class="cmmi-10">ab</span>
</div>