Curiously, I wrote a section on picture math for TeX4ht documentation just yesterday.
You can use various TeX4ht options to request the conversion of additional math environments to pictures. See the various pic-... options.
One issue with picture math is the vertical alignment of inline elements. If you use something like $ a = \sqrt{b^2}$, the a character will be placed higher than the surrounding text. This is a well known issue, but I just found a solution, thanks to this configuration file:
\Preamble{xhtml,pic-m,pic-equation,svg}
\ExplSyntaxOn
\Configure{PicMath}{\setbox0=}
{\Css{img[src="\PictureFile"]{vertical-align:-\fp_eval:n{ \dim_to_fp:n{\dp0}/(\dim_to_fp:n{\ht0}+\dim_to_fp:n{\dp0}) * 100}%;}}
\box0}{}
{ class="math" }
\ExplSyntaxOff
\begin{document}
\EndPreamble
The \Preamble{xhtml,pic-m,pic-equation,svg} requires creation of pictures for inline math and equations, also it requires the svg format. Then we use the PicMath configuration, which is called for all inline math, to typeset math inside a box first. We can then use this box to measure the correct vertical alignment. The formula I use is this: box depth / total box height * 100. The resulting value can be used in CSS. You will get something like this in the CSS file:
img[src="sample0x.svg"]{vertical-align:-11.56156598541914%}
Here is a sample file:
\documentclass{article}
\usepackage{amsmath}
\usepackage{preview}
\begin{document}
Hello $a=\sqrt{b}$, and other text xyz (a=\sqrt{b})
$$
a = \frac{a}{b}
$$
\begin{equation}
a = \frac{a}{b}
\end{equation}
\end{document}
Compile using:
$ make4ht -c config.cfg sample.tex
And this is the rendered page:

mathjaxfails to handle. Bothmathjaxandkatexare next to useless for me. – bzm3r Oct 20 '22 at 23:09