更新至最新的 TL 2022 后,章节或节标题中的所有数学运算都乱了

更新至最新的 TL 2022 后,章节或节标题中的所有数学运算都乱了

我发现更新到最新 TL 后生成的数学公式存在问题。现在章节和/或部分标题中的所有数学公式都乱了。在我更新到 TL 之前,这个公式显示正常。我以前用过这个很多年,没有出现过任何问题。

不在章节标题中的数学仍然显示 OK。

这是 MWE

\documentclass[12pt]{book}%
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\frontmatter
\title{my book title}
\author{me}
\date{\today}
\maketitle

\ifdefined\HCode 
\Configure{tableofcontents*}{chapter}   
\TocAt{chapter,section}
\TocAt{section,subsection}
\TocAt{subsection,subsubsection}
\TocAt{subsubsection,paragraph}
\fi 

\tableofcontents
\mainmatter

\chapter{First order ode $F\left(  x,y,y^{\prime}\right)  =0$}%

The equation is  $F\left(  x,y,y^{\prime}\right)  =0$

\section{First order linear in derivative $F\left(  x,y,y^{\prime}\right)=0$}%
These are first order ode's which are linear in $y^{\prime}$.
\subsection{Quadrature ode $y^{\prime}=f\left(  x\right)  $}
data
\subsubsection{Introduction}
data
\end{document}

使用编译

 make4ht -ulm default -a debug  index.tex 'mathjax,htm'

这是 HTML

在此处输入图片描述

注意所有这些\o内容。在更新 TL 之前,这一切都运行正常,数学运算在章节标题中显示正常。所以有些事情发生了变化。

这是原始 HTML

<!DOCTYPE html> 
<html lang='en-US' xml:lang='en-US'> 
<head><title>my book title</title> 
<meta charset='utf-8' /> 
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' /> 
<meta content='width=device-width,initial-scale=1' name='viewport' /> 
<link href='index.css' rel='stylesheet' type='text/css' /> 
<meta content='index.tex' name='src' /> 
<script>window.MathJax = { tex: { tags: "ams", }, }; </script> 
 <script async='async' id='MathJax-script' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' type='text/javascript'></script>  
</head><body>
<!-- l. 10 --><p class='indent'>
</p>   
<div class='maketitle'>
<h2 class='titleHead'>my book title</h2>
<div class='author'><span class='ec-lmr-12x-x-120'>me</span></div><br />
<div class='date'><span class='ec-lmr-12x-x-120'>December 26, 2022</span></div>
</div>
<h2 class='likechapterHead' id='contents'><a id='x1-1000'></a>Contents</h2>
<div class='tableofcontents'>   
<span class='chapterToc'>1 <a href='#first-order-ode-fleft-xyy-right-' id='QQ2-1-2'>First order ode \(F\o:left: ( x,y,y^{\prime }\o:right: ) =0\)</a></span>
</div>
<!-- l. 27 --><p class='indent'>
</p>   
<h2 class='chapterHead' id='first-order-ode-fleft-xyy-right-'><span class='titlemark'>Chapter 1</span><br /><a id='x1-20001'></a>First order ode \(F\left ( x,y,y^{\prime }\right ) =0\)</h2>
<div class='chapterTOCS'>   
 <span class='sectionToc'>1.1 <a href='#first-order-linear-in-derivative-fleft-xyy-right-' id='QQ2-1-3'>First order linear in derivative \(F\o:left: ( x,y,y^{\prime }\o:right: )=0\)</a></span>
</div>
<!-- l. 29 --><p class='indent'>   The equation is \(F\left ( x,y,y^{\prime }\right ) =0\)
</p>   
<h3 class='sectionHead' id='first-order-linear-in-derivative-fleft-xyy-right-'><span class='titlemark'>1.1   </span> <a id='x1-30001.1'></a>First order linear in derivative \(F\left ( x,y,y^{\prime }\right )=0\)</h3>
<div class='sectionTOCS'>   
  <span class='subsectionToc'>1.1.1 <a href='#quadrature-ode-y-fleft-xright-' id='QQ2-1-4'>Quadrature ode \(y^{\prime }=f\o:left: ( x\o:right: ) \)</a></span>
</div>
<!-- l. 32 --><p class='indent'>   These are first order ode’s which are linear in \(y^{\prime }\).
</p>   
<h4 class='subsectionHead' id='quadrature-ode-y-fleft-xright-'><span class='titlemark'>1.1.1   </span> <a id='x1-40001.1.1'></a>Quadrature ode \(y^{\prime }=f\left ( x\right ) \)</h4>
<div class='subsectionTOCS'>   
   <span class='subsubsectionToc'><a href='#introduction' id='QQ2-1-5'>Introduction</a></span>
</div>
<!-- l. 34 --><p class='indent'>   data
</p>   
<h5 class='subsubsectionHead' id='introduction'><a id='x1-5000'></a>Introduction</h5>
<div class='subsubsectionTOCS'>   
</div>
<!-- l. 36 --><p class='indent'>   data
</p>   
 
</body> 
</html>

使用

>which tex4ht
/usr/local/texlive/2022/bin/x86_64-linux/tex4ht
>make4ht --version
make4ht version v0.3l

门票https://puszcza.gnu.org.ua/bugs/index.php?589

答案1

当您在 MathJax 模式下遇到 TOC 中的数学命令问题时,通常需要使用命令声明有问题的命令\fixmathjaxtoc。在这种情况下,问题出在\left和 上\right,因此您可以使用以下方式声明它们:

\Preamble{xhtml}
\fixmathjaxtoc\left
\fixmathjaxtoc\right
\begin{document}
\EndPreamble

结果如下:

在此处输入图片描述

相关内容