# mathdisplay in tex4ebook

i've read this question Choppy equations with tex4ht and currently im displaying math as png pictures with the mybuild.mk4 file

Make:image("png$","dvipng -bg Transparent -T tight -D151 -o${output}  -pp ${page}${source}")
Make:image("svg$","dvisvgm -n -p${page} -c 1.4,1.4 -s ${source} >${output}")


and compiling with

tex4ebook -c config.cfg -f epub3 -e mybuild.mk4 "%N%T"


but apparently this setup only works for the equation command in latex, not for align. Here's an example:

top is align, bottom equation. The equations are not centered and the baselines seem to get messed up. Furthermore, if the equation gets too long, instead of a linebreak or downscaling the label disappears

MWE:

\documentclass{book}

\usepackage{mwe}
\usepackage{amsmath}

\begin{document}

\begin{align}
\varepsilon_{x}=\frac{1}{E}\cdot [\sigma_{x}-\upsilon \cdot(\sigma_{y} + \sigma_{z})] +1 +1 +1 +1 +1 +1 +1 +1
\end{align}

$$\varepsilon_{x}=\frac{1}{E}\cdot [\sigma_{x}-\upsilon \cdot(\sigma_{y} + \sigma_{z})]$$

\end{document}


Is there a way to make it work with align? Unfortunately i already have a lot of align environments in my latex file

You can convert the whole contents of align and equation environments to pictures. It is supported out of the box using pic-align option for align, for equation you must use simple configuration:
\Preamble{xhtml,pic-align}

This configuration will insert equation as a picture inside <div class="equation">. Css is then used to align both environments to the right.