I try to make help files for my wxWidgets-based software. wxWidgets supports displaying simple html pages and i use htlatex executable tool to convert my .tex to .html, where equations are rendered as pictures. I learned that i can make .cfg file to edit latex4ht's compilation settings. For example i need to convert inline equations to images too and i also would like to have .gif images on output instead of .png, so i made this mycfg.cfg file:

\Configure{PicMath}{}{}{}{class=’’math’’; align=’’absmiddle’’}

And i invoke htlatex like this: htlatex samplefile.tex "mycfg".

Everything goes smooth, but there is no .gif files. I can see on the end of logs strings like this:

l. 90 Writing samplefile.idv[1] (samplefile0x.gif)
l. 92 Writing samplefile.idv[2] (samplefile1x.gif)
l. 99 Writing samplefile.idv[3] (samplefile2x.gif)
l. 104 Writing samplefile.idv[4] (samplefile3x.gif)

And there is samplefile.idv on output, but i do not know how to extract .gifs from .idv files. Also i would like to get rid of CSS on output. Is it possible to get HTML files without CSS?

UPD: Maybe i'm doing it wrong (trying to get .gif images). Inside the .log file i can also read:

--- Note --- for gif bitmaps of pictures, use the 'gif' command line option. (Character bitmaps are controled only by 'g' records of tex4ht.env and '-g' switches of tex4ht.c)

But i do not know how to include this command-line option. Tried htlatex myfile "gif", it does not work.

  • Something along the lines of htlatex -gif would be a more usual way to specify the option, or htlatex --gif if it behaves more properly! (But I haven't tested this mostly on the grounds that I consider it a minor miracle any I persuade tex4ht to output anything for me at all.)
    – cfr
    May 27, 2014 at 23:49
  • @cfr I tried the way supposed in this answer htlatex smaplefile.tex "mycfg, -css, gif" but it still generates css style and does not change image format.
    – Kirill
    May 28, 2014 at 8:33

1 Answer 1


Your configuration file is correct, in the log file you can see that gif images were requested. idv file is a special dvi file, where only images to be converted are stored. Actual configuration for image conversion is stored in file tex4ht.env. Different versions of this file exist for unix and windows. By default, conversion is done by dvips and imagemagick, so maybe in you case this fails because you don't have some of this tools installed?

See this answer for some information how to configure tex4ht.env file. You may at first copy this file to your current dir, so you don't break anything. I think you should try to use dvipng for conversion, so you have to find <dvipng> section and add spaces before <dvipng> and </dvipng>, and then comment out <convert> section, by removing spaces at the beginning and end of the section.

Example of <dvipng> section:

Gdvipng -T tight -x 1400 -D 72 -bg Transparent -pp %%2:%%2 %%1 -o %3
Gdvipng -T tight -x 1400 -D 72 -bg Transparent -gif -pp %%2:%%2 %%1 -o %%3 
Gdvips -Ppdf -mode ibmvga -D 110 -f %%1 -pp %%2 > zz%%4.ps
Gconvert -crop 0x0 -density 110x110 -transparent '#FFFFFF' zz%%4.ps %%3
Grm zz%%4.ps

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .