It seems you can put your macro definitions at the beginning of the HTML page and the macros will be available in all subsequent math environments for MathJax. So what we can try to do is to include a file with custom macros verbatim in the HTML file using TeX4ht.
Try the following file, myconfig.cfg:
OK, this seems like a lot of issues :) I've updated TeX4ht sources with most of the fixes presented here, so they should become unnecessary soon. Some issues were fixed also in make4ht, so you will need the development version.
Issue 1 - huge text.
It is caused by the extarticle class, because the document selects font size of 20pt as the base font size. ...
The main issue is caused by the \parmath command, which is defined in the document text, so it cannot be patched from the configuration file. It looks like this:
The explicit nested math commands seems to explode the MathML code.
I would redefine it in ...