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

Radhakrishnan CV cvr at river-valley.org
Sat May 16 10:27:07 CEST 2015


On Sat, May 16, 2015 at 6:55 AM, Nasser M. Abbasi <nma at 12000.org> wrote:

> 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.
>
> -------------------------------
> \documentclass[12pt]{article}
> \usepackage{graphicx}
> \begin{document}
> \ifdefined\HCode
>  \includegraphics[width=0.5\paperwidth]{p.svg}
> \else
>  \includegraphics[width=0.5\paperwidth]{p.pdf}
> \fi
> \end{document}
> ---------------------------
>

​You may kindly change the above to the following:

documentclass[12pt]{article}
\usepackage{graphicx}

\begin{document}

\makeatletter
\Configure{graphics*}
  {eps}
  {\Picture[pict]{\csname Gin at base\endcsname.svg
       width="\expandafter\the\csname
          Gin at req@width\endcsname"
           height="\expandafter\the\csname
           Gin at req@height\endcsname"
      }%
   }
\makeatother

\ifdefined\HCode
 \includegraphics[width=0.5\paperwidth]{gr1.eps}
\else
 \includegraphics[width=0.5\paperwidth]{gr1.pdf}
\fi

\end{document}

I got the following output for graphics inclusion part:

<p class="noindent">
  <img src="gr1.svg" alt="pict"
   width="307.14749pt" height="307.26057pt" >
</p>

​Hope this is what you have been looking for.  TeX4ht needs .eps format of
the figure since it works with dvips graphics driver and hence cannot
accept any other graphics file format.
​
​Best regards​

-- 
Radhakrishnan
River Valley
<https://maps.google.com/maps?q=River%20Valley,%20Thiruvananthapuram%20Neyyardam%20Road,%20Kerala,%20India&vector=1>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex4ht/attachments/20150516/1c9566b5/attachment.html>


More information about the tex4ht mailing list