bugtex4ht - Bugs: bug #558, tex4ht generated HTML chops parts...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

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

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Tue Apr 12 21:21:23 2022  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed Apr 13 07:18:04 2022, comment #1:

As discussed at TeX.sx, this seems like rendering issues with certain Browsers - in particular Brave and Edge on Windows. I am afraid there is not that much what can be done on our side.

Michal Hoftich <michal_h21>
Project Member
Tue Apr 12 21:21:23 2022, original submission:

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} &amp; =v_{x}^{2}+v_{y}^{2} \end {align}
</p><!-- l. 12 --><p class='noindent'>Therefore the K.E. from (7) becomes\begin {align} T &amp; =\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

Nasser M. Abbasi <nma123>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by michal_h21 (Posted a comment)
  • -unavailable- added by nma123 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    1 latest change follows.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Apr 16 14:45:46 2022michal_h21Open/ClosedOpen=>Closed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray