# [tex4ht] what is the fastest way to convert large document to HTML?

Michal Hoftich michal.h21 at gmail.com
Fri Aug 17 09:59:49 CEST 2018

Hi Nasser,

> ------- foo.tex-----
> \documentclass[11pt]{article}
> \usepackage{amsmath,mathtools,amssymb}
>
> %fix for Maple bad latex generated
> %see
> https://tex.stackexchange.com/questions/191479/how-to-automatically-convert-cases-to-begincases-endcases
>
> \let\amscases\cases
> \makeatletter
> \def\cases{\@ifnextchar\bgroup\plaincases\amscases}
> \def\plaincases#1{\begin{cases*}#1\end{cases*}}
> \makeatother
>
> \begin{document}
>
> \begin{align*}
> {\frac {1}{\sqrt { \left| y \right| }}}\mathop{\mathrm{d}y}&=
>         \mathop{\mathrm{d}x}\\
>  \int {\frac {1}{\sqrt { \left| y \right| }}}
>      \mathop{\mathrm{d}y}&= \int \mathop{\mathrm{d}x}\\
> \cases{-2\,\sqrt {-y}&$y\leq 0$\cr 2\,\sqrt {y}&$0<y$\cr}&=x+C_{{1}}\\
> \end{align*}
>
> \end{document}

I am afraid that this issue should be fixed in Maple, don't they have
some issue tracker? The following version of your input compiles fine:

--------------------
\documentclass[11pt]{article}
\usepackage{amsmath,mathtools,amssymb}

\begin{document}

\begin{align*}
{\frac {1}{\sqrt { \left| y \right| }}}\mathop{\mathrm{d}y}&=
\mathop{\mathrm{d}x}\\
\int {\frac {1}{\sqrt { \left| y \right| }}}
\mathop{\mathrm{d}y}&= \int \mathop{\mathrm{d}x}\\
\begin{cases}-2\,\sqrt {-y} & y\leq 0\cr 2\,\sqrt {y} &
0<y\end{cases}&=x+C_{{1}}\\
\end{align*}

\end{document}
------------------

>
> I do not know if this is a known bug or not or if there is something
> to fix it for mathml.
>
> So I am back to square one, trying to find a faster way to
> compile to HTML.
>
> I wish someone could look at and speed up dvisvgm. htlatex is
> fast, until it gets to the stage where dvisvgm kicks in, then
> becomes very slow on large DVI files with lots of math.
>
> Most of the files I have are very large, since they contain lots
> of math generated by CAS and so it takes days to compile files
> to HTML using htlatex where lulatex takes only minutes.
>

You should also try the LaTeX math + MathJax, but I doubt it will
support incorrect input.

Best regards,
Michal