On Sat, May 16, 2015 at 6:55 AM, Nasser M. Abbasi <[email protected]> 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@base\endcsname.svg
       width="\expandafter\the\csname
          Gin@req@width\endcsname"
           height="\expandafter\the\csname
           Gin@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>

Reply via email to