tex4ht:小節和定理之後的內聯方程

tex4ht:小節和定理之後的內聯方程

微量元素:

\documentclass{amsart}
\newtheorem{theorem}{Theorem}
\begin{document}
\section{SecTmp}
\subsection{SubsecTmp}
\subsubsection{SubsubsecTmp}
\begin{theorem}
\end{theorem}
Here, \(H_n^i(X)\)
\end{document}

編譯後tex4ebook,結果將 的每個符號展開\(H_n^i(X)\)為一行。我想知道為什麼會發生這種情況,以及修復方法。

答案1

此問題是由 TeX4ht 中定理處理的錯誤所引起的。定理結束後,段落處理似乎很混亂。通常,一個段落應該在“這裡”一詞之前開始。但在這種情況下,數學中插入了幾個段落,這導致該表達式的部分內容分成多行。

我已經在 TeX4ht 原始碼中修復了它。同時,您可以使用以下.cfg文件:

\Preamble{xhtml}
% \Configure{()}{\PicMath$}{$\EndPicMath}

\Configure{newtheorem}
   {\ifvmode\IgnorePar\fi\EndP
     \HCode{<div class="newtheorem">}\par\noindent\HCode{<span class="head">}}
   {\HCode{</span>}}
   {\ifvmode\IgnorePar\fi\EndP\HCode{</div>}\par\indent\ShowPar}
\let\MathPar\empty
\Configure{PicDisplay}
  {\edef\MathPar{\ifvmode par-\fi}\IgnorePar\endgraf\EndP
   \HCode{<div class="\MathPar math-display" \csname a:LRdir\endcsname >}}
  {\HCode{</div>}\par\ShowPar}  {}  {class="\MathPar math-display" }
\Css{div.par-math-display, div.math-display{margin-left: auto; margin-right: auto;text-align:center;}}
\begin{document}
\EndPreamble

這是結果:

在此輸入影像描述

相關內容