1

When compiling with make4ht and using svg parameter, the equation, drawn from subequation using align environment, is not converted into SVG. If I change to mathjax, the HTML displays the warning: Unknown environment 'subequations'.

Here follows a small sample to reproduce it:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Test
\begin{equation}
H(X) = - \sum_x p_x \log p_x
\end{equation}

\begin{subequations} \begin{align} A&=&B\ D&=&C \label{e:middle}\ E&=&F \end{align} \end{subequations}

\end{document}

Compiling with:

make4ht -u -x test-math.tex "svg"

Changing to eqnarray works fine. Should I use a patch in a configuration file? I tried the following:

\Preamble{xhtml}

\renewenvironment{align}{ \begin{eqnarray} }{ \end{eqnarray} \ignorespacesafterend }

\begin{document}

\EndPreamble

Is it a bug in make4ht? Is there a better solution?

LEo
  • 772

1 Answers1

1

It seems that MathJax doesn't support the subequations environment out of the box. I've found a JavaScript code that should implement it, but I cannot get it to work.

You have few more options - first option is to use images, as you already do. Not all math environments are converted to images by default, but you can use options to require it. The option is usually named pic- + environment name. See the documentation for more supported options. For example pic-align will work in your example:

make4ht -u -x test.tex "svg,pic-align"

Result:

enter image description here

Another option is to use MathML. It needs to be used together with MathJax, because not every browser has MathML support:

make4ht -u -x test.tex "mathml,mathjax"

Result:

enter image description here

michal.h21
  • 50,697