[tex4ht] [bug #485] tex4ht does not handle \ifdefined\HCode in mathjax mode when inside equation

Nasser M. Abbasi puszcza-hackers at gnu.org.ua
Fri Oct 2 06:00:02 CEST 2020


                 Summary: tex4ht does not handle \ifdefined\HCode in mathjax
mode when inside equation
                 Project: tex4ht
            Submitted by: nma123
            Submitted on: Fri 02 Oct 2020 06:59:00 AM EEST
                Category: None
                Priority: 5 - Normal
                Severity: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any



Screen shots at:


This is the first time I found where tex4ht does not process

I put \ifdefined\HCode inside an equation, since I need different code for
HTML vs. pdf mode.

tex4ht does not process the ifdefined and leave it there. When mathjax sees
it, it complains since mathjax offcourse does not know anything about

When the code is compiled not using mathjax it works OK. But I need to use

Here is MWE

       3 i&-3 &0\\ 
       3 &3 i &0

The above compiled OK using lualatex foo3.tex and gives

This is the raw HTML. it shows the \ifdefined\HCode was not processed and left
in there

<!DOCTYPE html> 
<html lang="en-US" xml:lang="en-US" > 
<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="foo3.css" /> 
<meta name="src" content="foo3.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"

<!--l. 23--><p class="noindent" >\[ \ifdefined \HCode \left [
\begin{array}{ccc} \else \left [ \begin{array}{@{}cc|c@{}} \fi 3 i&-3
&0\\ 3 &3 i &0 \end{array} \right ] \]
</p><!--l. 25--><p class="indent" >   test

Compiled using make4ht -ulm default -a debug foo3.tex "htm" works with no

The problems seems that tex4ht does not look inside the equation to see that
there is something to do, and just passes the whole thing to mathjax.

TL 2020


Reply to this item at:


  Message sent via/by Puszcza

More information about the tex4ht mailing list.