# htlatex puts images for math formula in the wrong place if imgdir option used [closed]

I'm creating html from LaTex using the command htlatex ebook "html,info,imgdir:img/" All images are in the subdirectory img/ and this works perfectly. However I have a footnote containing a formula:

può calcolare come somma di una serie infinita\footnote{$\frac{\pi}{4}=1-\frac{1} {3}+\frac{1}{5}-\frac{1}{7}+\frac{1}{9}-\cdots$}, di cui calcolare la somma di


htlatex creates a html file for the footnote (ebook2.html) linked from the main file and 6 png files (ebook[0-5]x.png) for the various parts of the formula.

The problem is that the png files are created in the same directory as the footnote html file, but inside it the references are to img/ebook0x.png for example.

What should I do to force image creation inside subdir img/ (not good, it pollute the book image dir) or better removing img/ from created image references?

Note that the observed behavior makes sense. I asked all images to be under img/ and in tex4ht.env there is the G line that converts from zz*.ps to png. So seems the only solution is to modify this line to put the result under img/

-
try to configure image inclusion. see tug.org/applications/tex4ht/mn5.html#QQ1-5-20 create custom config file, like tex.stackexchange.com/a/25809/2891 I cannot test it now, but hope it will work –  michal.h21 Jan 16 '12 at 14:55
Thanks, but no change in output. BTW in the cfg file you need to use ' instead of ", otherwise I receive a lot of Undefined sequence errors. –  mvalle Jan 17 '12 at 6:30