3

I'm working on a Latex document with which i generate both, an ebook and a pdf document. To include graphics i use the following config.cfg:

\Preamble{xhtml}

\Configure{graphics*}
{jpg}
{%  
   \Picture[pict]{\csname Gin@base\endcsname .jpg
      \space width="\the\dimexpr \expandafter\csname
Gin@req@width\endcsname *2"
}%  
  \special{t4ht+@File: \csname Gin@base\endcsname.jpg}
 }

\Configure{graphics*}
{png}
{%  
   \Picture[pict]{\csname Gin@base\endcsname .png
      \space width="\the\dimexpr \expandafter\csname
Gin@req@width\endcsname *2"
}%  
  \special{t4ht+@File: \csname Gin@base\endcsname.png}
 }

\begin{document}
\CssFile[custom.css] 
/* css.sty */
\EndCssFile
\Configure{CoverMimeType}{image/jpg}
\DeclareGraphicsExtensions{.eps,.png,.jpg,.gif,}
\EndPreamble

To include pdf graphics i converted all files to eps and leave out the file extensions in the latex document, so eps files are included when generating an ebook and pdf files are included when generating a pdf document. Is there a way to expand the eps graphics in the ebook, just as it was done above with jpg and png? It's not working if i just insert 'eps'

1 Answer 1

2

You can use the following configuration:

\Configure{graphics*}
{eps}
{%  
\openin15=\csname Gin@base\endcsname\PictExt\relax 
  \ifeof15 
  \Needs{"convert \csname Gin@base\endcsname.eps 
    \csname Gin@base\endcsname\PictExt"}% 
  \fi 
  \closein15 
   \Picture[pict]{\csname Gin@base\endcsname \PictExt
      \space width="\the\dimexpr \expandafter\csname
Gin@req@width\endcsname *2"
}%  
  \special{t4ht+@File: \csname Gin@base\endcsname\PictExt}
 }

(it is inspired by the tex4ht troubleshooting page

It tests for the existence of a version of the included file in the current output picture format (PNG or SVG) and calls ImageMagick's convert command only if it doesn't exist.

You must log in to answer this question.

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