如何放置...在类似定理的环境中标记第一个参数

如何放置...在类似定理的环境中标记第一个参数

我正在尝试在 tex4ht 中创建一个环境,但在 html 文件<p>... </p>标签中缺少该环境的第一个段落

我正在使用以下 tex 编码

\documentclass{book}
\newenvironment{exe}{Exercise: }{}
\begin{document}
This version uses the powerful Uniscribe library in order to better handle Unicode and complex language processing.

\begin{exe}
This Theorem explain how it works in the example

This Theorem explain how it works in the example
\end{exe}
This version uses the powerful Uniscribe library in order to better handle Unicode and complex language processing (including support for bidirectional text).

\end{document} 

我在 cfg 文件中使用了以下编码

\ConfigureEnv{exe}
   {\ifvmode\IgnorePar\fi\EndP\HCode{<div class="Theorem">}}
   {\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}
   {}
   {}

html 文件中的输出为:

<p class="noindent" >This version uses the powerful Uniscribe library in order</p>
<div class="Theorem">Exercise:  This Theorem explain how it works in the example
<p class="indent" >This Theorem explain how it works in the example</p>
</div>
<p class="indent" >This version uses the powerful Uniscribe library in order to better handle 
Unicode and complex language processing (including support for bidirectional
text).</p>

我使用以下参数编译该文件

htlatex sample "sample.cfg,xhtml"

请建议如何<p>...</p>在新环境的开头段落中插入 para 标签?

答案1

\par在这种情况下,您需要使用命令插入明确的段落:

\ConfigureEnv{exe}
   {\ifvmode\IgnorePar\fi\EndP\HCode{<div class="Theorem">}\par}
   {\ifvmode\IgnorePar\fi\EndP\HCode{</div>}\par}
   {}
   {}

结果:

  <div class="Theorem">
<p class="indent">   Exercise:  This Theorem explain how it works in the example
</p><p class="indent">   This Theorem explain how it works in the example
</p></div>
<p class="indent">   This version uses the powerful Uniscribe library in order to better handle
Unicode and complex language processing (including support for bidirectional
text).
</p>

相关内容