michal-h21 / make4ht

Build system for tex4ht
137 stars 15 forks source link

MathJax output is not generated #37

Closed scimax closed 4 years ago

scimax commented 4 years ago

Hi,

I'm trying to use make4ht with MathJax code being generated instead of png images for formulas. After succesfully installing make4ht (make4ht version v0.3e) and running the code with my .tex file, it works nicely with formulas as pngs. So following the edit of the stackexchange answer regarding this question, I thought it would be sufficient to simply run

 make4ht -f html5+mathjaxnode -d html MyTexFile.tex

(I also exported the result to a subfolder html). Quickly I realized that I'm missing the package mathjax-node-page so after installing it the above command did not complain anymore with 'mjpage' is not recognized as an internal or external command,. Also, the output folder included now an empty file called mathjax-chtml.css. But the pngs were still generated and the main html file included those instead of a mathjax code.

What am I doing wrong here? Do I have to consider the stack exchange answer before the edit, including the mathnode.lua file?

My system is:

michal-h21 commented 4 years ago

The mathjaxnode extension needs MathML output. It isn't requested by default, so you need to pass the mathml option, like this:

 make4ht -f html5+mathjaxnode -d html MyTexFile.tex "mathml"

I've just updated make4ht sources to require this option by default, so you can ommit it if you install the development version.

scimax commented 4 years ago

Thanks a lot! It works now! There was another error thrown by make4ht. But after debugging my code I figured it out. Just a minor mistake in latex: \phi_{\textbf{offset}} which works in pdftex. But I had to change it to \phi_{\text{offset}}, and, in fact, that's what I aimed for originally.

michal-h21 commented 4 years ago

@scimax I think \textbf should work in up-to-date TeX4ht. I've fixed this issue last week.