枚举 tex4ht 中显示错误的项目

枚举 tex4ht 中显示错误的项目

以下 LaTeX枚举列表之后结束{等式} \\显示错误tex4ht。如何解决?我知道通过 Lua 脚本解决此错误。但我想知道如何修复 .cfg 文件中的此类错误。

\documentclass{article}
\usepackage{latexsym,amsmath,amssymb,amscd}
\begin{document}
\title{title}
\author{author}
\maketitle


In this article we denote 
\begin{equation}
\nu:=\frac{1}{\gamma-1}. \label{Nu}
\end{equation}\\

Let us fix a stratified equilibrium $\rho=\bar{\rho}, P=\bar{P}, S=\bar{S}$, which are functions of $x^3$ only such that .

\begin{enumerate}[10]
\item One should not attempt to prove statements so obvious that nothing more obvious exists with which to prove them.
\item One should prove all theorems which are not quite clear and in the proofs one should use only very obvious axioms or theorems which are accepted or proved.
\end{enumerate}

Let us fix a stratified equilibrium $\rho=\bar{\rho}, P=\bar{P}, S=\bar{S}$, which are functions of $x^3$ only such that .

\end{document}

我的 Lua 脚本是:

for line in io.lines() do
  line = line:gsub("\\end{equation}\\\\", "\\end{equation}")
  line = line:gsub("%^\\mathrm{(.-)}", "^{\\mathrm %1}")
  print(line)
end

答案1

为了避免在 Lua 字符串中转义反斜杠的必要性,您可以使用[[...]]语法。

line = line:gsub([[\end{equation}\\]], [[\end{equation}]])
line = line:gsub([[%^\mathrm{(.-)}]], [[^{\mathrm %1}]])

相关内容