bugtex4ht - Bugs: bug #504, tex4ht does not scale math font...

 
 
Show feedback again

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

bug #504: tex4ht does not scale math font along with text when using mathjax

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Tue Mar 30 04:41:48 2021  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed Mar 31 10:54:44 2021, comment #2:

The answer on TeX.sx was accepted so I think we can close this.

Michal Hoftich <michal_h21>
Project Member
Tue Mar 30 08:35:31 2021, comment #1:

Hi Nasser, I've posted my answer with a solution on TeX.sx. You need to use a command that can be patched by TeX4ht. While basic support for font changing switches such as \tiny works, it doesn't work well for cases such as this one.

Michal Hoftich <michal_h21>
Project Member
Tue Mar 30 04:41:48 2021, original submission:

Reference and screen shots at

https://tex.stackexchange.com/questions/590609/tex4ht-does-not-scale-math-font-along-with-text-when-using-mathjax

In this MWE

======================
\documentclass{article}
\usepackage{amsmath}
\begin{document}

\tiny
All of this font should be tiny include the math
\begin{align*}
\sin x &= 1
\end{align*}

\normalsize
All of this font should be normal include the math
\begin{align*}
\sin x &= 1
\end{align*}

\end{document}
================
Both math and text fonts sizes change when compiled to PDF.

But when compiling to HTML using tex4ht and when using mathjax option, only the text size is changed. Math size remains normal.

make4ht -ulm default foo5.tex "mathjax,htm"

The raw HTML generated is

===================
<!DOCTYPE html>
<html xml:lang='en-US' lang='en-US'>
<head><title></title>
<meta charset='utf-8' />
<meta name='generator' content='TeX4ht (https://tug.org/tex4ht/)' />
<meta name='viewport' content='width=device-width,initial-scale=1' />
<link href='foo5.css' type='text/css' rel='stylesheet' />
<meta name='src' content='foo5.tex' />
<script>window.MathJax = { tex: { tags: "ams", inlineMath: [ ["\\\(","\\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true, processEnvironments: true, packages: ['base', 'color', 'ams'] }, loader: { load: ['[tex]/color', '[tex]/ams'] } }; </script>
<script async='async' id='MathJax-script' type='text/javascript' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js'></script>
</head><body>
<!-- l. 6 --><p class='noindent'><span class='rm-lmr-5'>All of this font should be tiny include the math </span>\begin {align} \sin x &amp;= 1 \end {align}
</p><!-- l. 11 --><p class='indent'> All of this font should be normal include the math \begin {align} \sin x &amp;= 1 \end {align}
</p>

</body>
</html>
=============

Is this tex4ht issue or mathjax? And how to make both text and math change size at same time as the case is when compiling to PDF?

Using TL 2020 on Linux.

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
    Wed Mar 31 10:54:44 2021michal_h21Open/ClosedOpen=>Closed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray