[tex4ht] [bug #558] tex4ht generated HTML chops parts of overbrace depending on what font is used

Nasser M. Abbasi puszcza-hackers at gnu.org.ua
Tue Apr 12 23:21:23 CEST 2022


URL:
  <http://puszcza.gnu.org.ua/bugs/?558>

                 Summary: tex4ht generated HTML chops parts of overbrace
depending on what font is used
                 Project: tex4ht
            Submitted by: nma123
            Submitted on: Tue Apr 12 21:21:23 2022
                Category: None
                Priority: 5 - Normal
                Severity: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Reference and screen shots at

https://tex.stackexchange.com/questions/640581/why-tex4ht-chops-parts-of-overbrace-depending-on-what-font-is-used


I found very strange problem using tex4ht in mathjax mode. I am not sure this
is mathjax issue or tex4ht doing something strange to cause it.

When I set my web page font to \Css{body{ font-family: arial, sans-serif;}}
the braces are chopped off. Here is MWE

\documentclass[12pt]{article}%
\usepackage{amsmath}
\begin{document}
\ifdefined\HCode  
\Css{body{ font-family: arial, sans-serif;}}
\fi 

\begin{align*}
v^{2} &  =v_{x}^{2}+v_{y}^{2}
\end{align*}

Therefore the K.E. from (7) becomes%
\begin{align*}
T &  =\overset{\text{cart K.E.}}{\overbrace{\frac{1}{2}M\dot{x}^{2}}%
}+\overset{\text{translation K.E. of physical pendulum}}{\overbrace{\frac
{1}{2}m\left(  \left(  \dot{x}+\frac{L}{2}\dot{\theta}\cos\theta\right)
^{2}+\left(  \frac{L}{2}\dot{\theta}\sin\theta\right)  ^{2}\right)  }%
}+\overset{\text{rotation K.E.}}{\overbrace{\frac{1}{2}\left(  \frac{1}%
{12}mL^{2}\right)  \dot{\theta}^{2}}}
\end{align*}

\end{document}
Compiling using

make4ht  -ulm default -a debug report.tex "mathjax,htm"
Gives (see screen shot)

Removing \Css{body{ font-family: arial, sans-serif;}} and compiling again
gives correct display (screen shot)

This is not the end of this bizarre behaviour. Keeping the \Css command there,
but now removing the equation above the one with the braces, the braces show
again correctly!

\documentclass[12pt]{article}%
\usepackage{amsmath}
\begin{document}
\ifdefined\HCode  
\Css{body{ font-family: arial, sans-serif;}}
\fi 

Therefore the K.E. from (7) becomes%
\begin{align*}
T &  =\overset{\text{cart K.E.}}{\overbrace{\frac{1}{2}M\dot{x}^{2}}%
}+\overset{\text{translation K.E. of physical pendulum}}{\overbrace{\frac
{1}{2}m\left(  \left(  \dot{x}+\frac{L}{2}\dot{\theta}\cos\theta\right)
^{2}+\left(  \frac{L}{2}\dot{\theta}\sin\theta\right)  ^{2}\right)  }%
}+\overset{\text{rotation K.E.}}{\overbrace{\frac{1}{2}\left(  \frac{1}%
{12}mL^{2}\right)  \dot{\theta}^{2}}}
\end{align*}

\end{document}
Gives

(screen shot)

So I am not sure what is going on. Is this a tex4ht issue or mathjax? Why is
setting the page font makes braces to get chopped off? And why is removing an
equation above makes them show up OK?

TL 2021. Here is the raw HTML of the first example above

<!DOCTYPE html> 
<html lang='en-US' xml:lang='en-US'> 
<head><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='report.css' rel='stylesheet' type='text/css' /> 
<meta content='report.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='noindent'>\begin {align*}  v^{2} &
=v_{x}^{2}+v_{y}^{2}  \end {align*}
</p><!-- l. 12 --><p class='noindent'>Therefore the K.E. from (7)
becomes\begin {align*}  T & =\overset {\text {cart K.E.}}{\overbrace
{\frac {1}{2}M\dot {x}^{2}}}+\overset {\text {translation K.E. of physical
pendulum}}{\overbrace {\frac {1}{2}m\left ( \left ( \dot {x}+\frac {L}{2}\dot
{\theta }\cos \theta \right ) ^{2}+\left ( \frac {L}{2}\dot {\theta }\sin
\theta \right ) ^{2}\right ) }}+\overset {\text {rotation K.E.}}{\overbrace
{\frac {1}{2}\left ( \frac {1}{12}mL^{2}\right ) \dot {\theta }^{2}}}  \end
{align*}
</p>   
 
</body> 
</html>


Should math display depend on font used for the web page?

TL 2021






    _______________________________________________________

Reply to this item at:

  <http://puszcza.gnu.org.ua/bugs/?558>

_______________________________________________
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



More information about the tex4ht mailing list.