Mon Apr 20 03:56:22 2020, 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
|