1

This is problem specific to tex4ht only.

I noticed when I have some math in section names, sometimes the table of content is corrupted, even though the same math displayed OK in the body of the section.

Here is a MWE

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\tableofcontents
\section{bad section $\sum\limits_{i=1}^n \frac{1}{(x (n-i)+i)^2}$} 
This is my section

$\sum\limits_{i=1}^n \frac{1}{(x (n-i)+i)^2}$

\section{good section $\sin(x)$} 
This is my section

$\sin(x)$
\end{document}

Compiled using make4ht -ulm default foo3.tex "htm,mathjax" gives

enter image description here

When compiled not using mathjax mode, the table of content is correct.

The \DOTSB seems to be generated by tex4ht and not mathjax, since the raw HTML shows this

<span class="sectionToc" >1 <a 
href="#x1-20001" id="QQ2-1-2">bad section \(\DOTSB \sum@ \slimits@ \limits _{i=1}^n \frac{1}{(x (n-i)+i)^2}\)</a></span>
<br /> 

Why does tex4ht generate this extra \(\DOTSB and how to remove it?

Using TL 2020.

(base) >make4ht --version
make4ht version v0.3e
Nasser
  • 20,220

1 Answers1

2

This is the same issue as in an older question of yours. You need to use \fixmathjaxtoc\sum in a config file. I will add it to TeX4ht sources, so it should work out of the box soon. Until then, use this:

\Preamble{xhtml}
\fixmathjaxtoc\sum
\begin{document}
\EndPreamble

This is the result:

enter image description here

michal.h21
  • 50,697
  • thanks Michal. Hard to know what is missing each time for me since this is new case. But good to know you will have the fix in the sources. My .cfg for mathjax is getting very long :) – Nasser May 31 '20 at 22:34