bugtex4ht - Bugs: bug #462, tex4ht problem with mathjax when...

 
 
Show feedback again

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

bug #462: tex4ht problem with mathjax when using array with text{}

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Sat May 9 08:33:38 2020  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed Jun 7 10:25:02 2023, comment #2:

I think we can close this. You must add suitable declarations of \text and \small commands for MathJax. Example of such configuration is here: https://www.kodymirus.cz/tex4ht-doc/Howto.html#mathjax-latex-mode

Michal Hoftich <michal_h21>
Project Member
Sat May 9 19:15:29 2020, comment #1:

Hi Nasser, I think you need to provide correct configuration for \small and \text commands for MathJax, it clearly doesn't like it. And it doesn't like double brackets as well. I am sure examples of command configurations are somewhere in the TeX4ht mailing list archives. I may try to come with something tomorrow.

Michal Hoftich <michal_h21>
Project Member
Sat May 9 08:33:38 2020, original submission:

Reference

https://tex.stackexchange.com/questions/543136/problem-using-tex4ht-in-mathjax-mode-when-using-array-with-text

When compiling this MWE

==============
\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}

\[%
\begin{array}
[c]{c}%
\text{{\small bottom edge}}\\
\text{{\small bottom edge}}\\
\end{array}%
\begin{bmatrix}
\alpha & 2\\
1 & \alpha \\
\end{bmatrix}%
\]
\end{document}

=======================

Using the command

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

it produces bad output (please see screen shot in the above link).

When compiling the same file using lualatex foo.tex the output in pdf is correct.

How to make tex4ht output the same as in the pdf?

The raw HTML generated by tex4ht is

=====================
<!DOCTYPE html>
<html lang="en-US" xml: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 rel="stylesheet" type="text/css" href="foo.css" />
<meta name="src" content="foo.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 type="text/javascript" async="async" id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js"></script>
</head><body

>

<!--l. 18--><p class="noindent" >\[\begin{array} [c]{c}\text{{\small bottom edge}}\\ \text{{\small bottom edge}}\\ \end{array}\begin{bmatrix} \alpha &amp; 2\\ 1 &amp; \alpha \\ \end{bmatrix}\] </p>
</body>
</html>
=================

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 Jun 7 10:25:02 2023michal_h21Open/ClosedOpen=>Closed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray