bugtex4ht - Bugs: bug #457, tex4ht removes space causing...

 
 
Show feedback again

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

bug #457: tex4ht removes space causing mathjax to fail

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Mon 20 Apr 2020 06:56:22 AM EEST  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Mon 20 Apr 2020 07:15:55 PM EEST, comment #1:

Hi Nasser,

I've posted detailed answer on TeX.sx. I've fixed this issue in sources, so it should be available soon.

Best regards,
Michal

Michal Hoftich <michal_h21>
Project Member
Mon 20 Apr 2020 06:56:22 AM EEST, original submission:

reference:

https://tex.stackexchange.com/questions/539597/tex4ht-removes-space-causing-mathjax-to-fail

This MWE

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

$ 2\ x\ {\arcsin x} $

\end{document}
====================

is valid latex. It compiles OK using lualatex to

But when compiled to HTML using mathjax mode

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

The generated latex losses the important white space between x\ { and it becomes x\{. Here is the raw HTML

========================
<!DOCTYPE html>
<html lang="en-US" xml:lang="en-US" >
<head><title></title>
<meta charset="utf-8" />
<meta name="generator" content="TeX4ht (http://www.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 type="text/x-mathjax-config"> MathJax.Hub.Config({ 'fast-preview': {disabled: true}, TeX: { extensions: ["color.js","AMSmath.js"], equationNumbers: { autoNumber: "AMS" } }, extensions: ["tex2jax.js"], tex2jax: { inlineMath: [ ["\\\(","\\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true, processEnvironments: true } }); </script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head><body

>

<!--l. 6--><p class="noindent" >\( 2\ x\{\arcsin x} \)
</p>

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

And because of this mathjax fail to render it.

Manually editing the HTML above and adding the extra white space that was in source, now it works.

<!--l. 6--><p class="noindent" >\( 2\ x\ {\arcsin x} \)

Using TL 2019 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):

     

     

    2 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 06 May 2020 12:56:13 AM EESTmichal_h21StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray