I use TeX4ht with MathJax to convert tex to HTML/MathML. One issue I have is that delimiters scale depending on the height of the line, even if the tall content is not between the delimiters. For instance, compiling the document
\documentclass{article}
\begin{document}
\[
f(x) = \frac{\frac{x}{1}}{\frac{2}{3}}
\]
\end{document}
with
htlatex test "cf,mathjax"
yields
Here cf.cfg
just contains
\Preamble{html,mathml}
\begin{document}
\EndPreamble
I think the parentheses are too large. Is there a way to control the scaling?
Best Answer
As David Carlisle said, this is a bug in TeX4ht.
<mo>
elements around parentheses should have set thestretchy="false"
attribute. I will fix that in TeX4ht sources. Until this fix is added to TeX Live, you can use the following.cfg
file:BTW, I would recommend to use
make4ht
instead ofhtlatex
, because it fixes some issues with MathML that are impossible to fix on the TeX side. So you can compile your file using:This is the result: