Currently, I tell tex4ht to use svg instead of png for math images. This results in better image quality. However, it is slow in image generation, as it takes about 1-2 seconds for each image to be generated since it has to load the idv file each time to make each image for each math expression.
Is there a way to speed this process up? I'll describe the current process I use for reference.
I edited sudo vi /usr/local/texlive/2014/texmf-dist/tex4ht/base/unix/tex4ht.env and add these 2 lines
G.svg
Gdvisvgm -n -p %%2 -c 1.2,1.2 -s %%1 > %%3
as shown in this image

Next, edited my tex4ht cfg file (called nma.cfg) and added svg entry
\Preamble{ext=htm,charset="utf-8",p-width,pic-align}
\Configure{Picture}{.svg}
\makeatletter
\Configure{graphics*}
{svg}
{
{\Configure{Needs}{File: \Gin@base.svg}\Needs{}}
\Picture[\csname a:GraphicsAlt\endcsname]{\csname Gin@base\endcsname.svg
\csname a:Gin-dim\endcsname}
}
\begin{document}
\EndPreamble
Next, I call tex4ht on the latex file as follows
make4ht -u foo.tex "nma,htm,pic-align,notoc*"
where make4ht is found in https://github.com/michal-h21/make4ht
If you do not have make4ht installed, then the command
htlatex foo.tex "nma,htm,pic-align,charset=utf-8,notoc*" " -cunihtf -utf8"
will work as well. Here is foo.tex with 2 equations which will cause 2 images to be generated
\documentclass[11pt]{article}
\usepackage{graphicx} %must be included
\begin{document}
\[
x = \sin(y)
\]
and
\[
x2 = \sin(y)
\]
\end{document}
Now we see tex4ht loading the idv each time for each image:
......
t4ht.c (2012-07-25-19:28 kpathsea)
t4ht -f/foo.tex
(/usr/local/texlive/2014/texmf-dist/tex4ht/base/unix/tex4ht.env)
Entering foo.lg
System call: dvisvgm -n -p 1 -c 1.2,1.2 -s foo.idv > fo0x.svg
processing page 1
page size: 58.1681pt x 13.0909pt (20.4437mm x 4.60093mm)
page written to <stdout>
1 of 2 pages converted in 0.244021 seconds
System return: 0
System call: dvisvgm -n -p 2 -c 1.2,1.2 -s foo.idv > fo1x.svg
processing page 2
page size: 64.7136pt x 13.0909pt (22.7442mm x 4.60093mm)
page written to <stdout>
1 of 2 pages converted in 0.243742 seconds
System return: 0
Is there a way to speed this up to avoid loading the idv each time for each equation and do them all at once? Currently it takes 4 days to build my large latex file and I need a way to speed this up.

dvisvgm_hashesextension for a fast generation of the SVG files. See themake4htdocumentation for details. – michal.h21 Jan 30 '19 at 19:41tex4ebook -f epub+dvisvgm_hashes filename.tex. You don't needMake:imagein the build file then. You may still need to require theSVGformat using\Configure{Picture}{.svg}in the.cfgfile or using thesvgoption on the command line – michal.h21 Jan 30 '19 at 20:11\Configure{Needs}and\Picturestill necessary in your answer? By the way, maybe it would be a bit beneficial to update that answer. – Yai0Phah Jan 31 '19 at 15:53tex4htfor some time – michal.h21 Jan 31 '19 at 18:35tex4ebook epub+dvisvgm_hashes, and I end up with something like...texmf-dist/scripts/make4ht/extensions/dvisvgm_hashes.lua:251: attempt to concatenate field 't4ht_par' (a nil value)What's wrong with that? – Yai0Phah Mar 29 '19 at 15:58if v.params.t4ht_par == nil then v.params.t4ht_par = "" endafter line 249 in the extension (I don't know the syntax of lua. I guess it from my knowledge of other programming languages).The "not found" error seems harmless: it's shown at `Copy: cp "test100x.svg" "test-epub/OEBPS". It seems that you need to remove these cp's in the code of tex4ebook. – Yai0Phah Mar 29 '19 at 16:58<item id='test###x.svg' ... />etc. I will post a topic here. – Yai0Phah Mar 29 '19 at 17:11