I'm using htlatex (Miktek 2.9, on windows command prompt) with the command:

htlatex source.tex "3" "" "" "--interaction==nonstopmode"

to generate HTML from existing documents written in LaTeX. I've been coming across a couple of major problems that have me stumped, so I hope someone here can help.

  1. My output creates (very poor quality) .gif equations. I've made the equations into png's in the past but for some reason the convert function (run by t4ht?) seems to be defaulting to .gif. Is there a way I can specify the creation of .png's instead (I'm honestly not sure how they were created in the first place)?

  2. I've tried to specify the HTML output and image output directory without luck. I've read that the imgdir:(location)/ and -d/(location)/ options as follows should change the output directory, but it hasn't seemed to work for me.

    htlatex source.tex "3,imgdir:images/" "" -d/tmp/ "--interaction==nonstopmode"
  3. The image (not equation) scaling is incorrect in the final HTML output. In the document, I use a custom command to place the images (for PDF output):


    and this works normally. After running htlatex, the scaling is not preserved and the images are out of proportion.

  • If you have the chance, install WinEdt 8, open your file in it and run the command Tex | HTML | LaTeX -> HTML. It runs htlatex on your file with a modified tex4ht.env with the options you've mentioned. – karlkoeller Jul 11 '13 at 19:13
  • 1
    Thank you for the suggestion of WinEdit, I was able to solve the second problem (even though its done the same way as command prompt, it worked here), and for some reason it created higher quality equations, however, I am still not having luck with the image scaling problem. – Ryan Jul 12 '13 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.