[tex4ht] TeX4ht warning --- Cannot determine size of graphic in svg graphics. Does tex4ht support bounding box on svg?

Nasser M. Abbasi nma at 12000.org
Sat May 16 03:25:58 CEST 2015

Currently I use svg graphics for all images since it looks better
than png on the web. Here is a typical latex file. I use
pdf version of the image for pdflatex and use the svg version
for htlatex.

I convert the pdf to svg using the program  pdf2svg which works
much better thank inkscape I found.


The only problem is that I can't resize the svg image, so it shows
up in its original size on the web page.

The errors are

l.5 --- TeX4ht warning --- Cannot determine size of graphic in p.svg (no Boundi
ngBox) ---
[1] (./foo.aux) )
Output written on foo.dvi (1 page, 9672 bytes).
Transcript written on foo.log.

I think this is becuase htlatex does not see the bounding box?
However, looking at the svg file, I see the following

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
width="401.982pt" height="347.121pt" viewBox="0 0 401.982 347.121"

Is the above not a bounding box using svg syntax?

My question is: How can one tell htlatex to resize the SVG graphics
similar to when using pdf with pdflatex?

Here are the commands to build the above file

htlatex foo.tex "nma,htm"

the nma.cfg contains this:

   {\Configure{Needs}{File: \Gin at base.svg}\Needs{}}
   \Picture[\csname a:GraphicsAlt\endcsname]{\csname
       Gin at base\endcsname.svg \csname a:Gin-dim\endcsname}

I put all the files (.tex, svg, pdf, nma.cfg) in one folder, and
put it in one zip file. THe zip file can be downloaded from


Any sugegstions on what to do or try are welcome.
I am using tex4ht from tex live 2014 on Linux box.


More information about the tex4ht mailing list