[tex4ht] converting all displaymath to images with make4ht

Michal Hoftich michal.h21 at gmail.com
Fri Feb 5 17:40:49 CET 2021


Ah, I see. It works with amsmath for me, but it is true that we changed 
amsmath's \[ ... \] behavior recently. It is possible that you have an 
older version and that it didn't work correctly. 

You can try this configuration file:

%%%%%%%%%%%%%%%%%%%%%%
\Preamble{xhtml}
\Css{figure.figure img { display: inline; }}

\makeatletter

\DeclareRobustCommand\[{%
\bgroup%
   \mathdisplay at push%
   \st at rredtrue \global\@eqnswfalse%
   \mathdisplay{equation*}%
\csname st:Math\endcsname
}

\DeclareRobustCommand\]{%
\csname ed:Math\endcsname
   \endmathdisplay{equation*}%
   \mathdisplay at pop%
   \ignorespacesafterend%
\egroup
}
\makeatother
\Configure{[]}{\Picture*{}}{\EndPicture}
\begin{document}
\EndPreamble
%%%%%%%%%%%%%%%%%%%%%%%

Save it as mycfg.cfg and compile using 

     make4ht -c mycfg.cfg filename.tex

or 

     tex4ebook -c mycfg.cfg filename.tex

Best regards,
Michal


>Strange. My MWE was almost identical to yours except mine used the awsmath
>package, because I'm working with an author who uses the align and align*
>environments heavily.
>
>When I strip out \usepackage{awsmath}, the equation renders as one image.
>When using amsmath, only the part in parentheses is converted to an image.
>
>Thanks for your help. The amsmath package must be the problem here.
>
>On Fri, Feb 5, 2021 at 10:16 AM Michal Hoftich <michal.h21 at gmail.com> wrote:

>


More information about the tex4ht mailing list.