66.8 graphics.sty


graphicx
endfloat

graphics.sty.

<..graphics.4ht..>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % graphics.4ht                          2014-07-12-22:36 %
 % Copyright (C) 1997--2009       Eitan M. Gurari         %
 <.TeX4ht copyright.>
 
    <.fix graphics.>
 \Hinput{graphics}
 \endinput
 -_-_-

<..fix graphics..>
 \expandafter\let\csname includegraphics \endcsname\includegraphics
 \def\includegraphics{\expandafter\protect\csname includegraphics \endcsname}
 -_-_-

[example]

<..fix graphics..>+
 \def\grp:warning#1{\no:bound#1(no BoundingBox)//\:warning{#1}}
 \def\no:bound#1(no BoundingBox)#2//{\gdef\noBoundingBox{#2}\ifx
    \noBoundingBox\empty \global\let\noBoundingBox\:UnDef\fi}
 \let\:tempc=\Gin@setfile
 \pend:defIII\:tempc{\a:graphics
     \global\let\noBoundingBox\:UnDef
     \let\@latex@error=\grp:warning \let\@ehc=\empty}
 \append:defIII\:tempc{\b:graphics\grf:gobble\leavevmode grf:gobble}
 \HLet\Gin@setfile=\:tempc
 \NewConfigure{graphics*}[2]{%
    \expandafter\ifx \csname :.#1\endcsname\relax
       \pend:defIII\n:Gin@setfile:{\csname :.#1\endcsname}%
    \fi
    \def\:temp{#2}\ifx \:temp\empty
      \expandafter\let\csname :.#1\endcsname\:UnDef
    \else
      \expandafter\def\csname :.#1\endcsname{\def\:temp{.#1}%
         \ifx \:temp\Gin@ext  \let\a:graphics=\relax
            \def\G:cnfg{#2}\expandafter\grf:gobble \fi}%
    \fi }
 \NewConfigure{graphics}{2}
 \def\grf:gobble#1\leavevmode#2grf:gobble{%
    \PictureOff#1\PictureOn \G:cnfg \let\G:cnfg=\relax}
 \let\G:cnfg=\relax
 -_-_-

For figures of specific exytensions, we can tailor a configuration with the command ‘\Configure{graphics*}{extension}{action}’. For the other figures, we can use the configuration ‘\Configure{graphics}{before}{aafter}’.

\Configure{epsfig} 
  {\Configure{graphics*} 
    {eps} 
    {\Needs{"eps22jpg ####1 ####2"}% 
     \Needs{File:           ####2}% 
     \def\temp{[####2]}% 
     \Picture       [\temp]{####2}}} 
 {} 

Newer version

 
\Configure{graphics*} 
    {eps} 
    { \Needs{"convert -crop 0x0 -density 110x110 -transparent 
                ’\#FFFFFF’ ##3 \csname Gin@base\endcsname.gif"} 
      \Picture[pict]{\csname Gin@base\endcsname.gif} 
    } 
 
\Configure{graphics*} 
    {gif} 
    {\Picture[pict]{\csname Gin@base\endcsname.gif}} 
 

For xml

\def\Ginclude@graphics#1{\Tg<includegraphics file="#1"/>} 
\def\Gin@setfile#1#2#3{% 
  \ifx\\#2\\\Gread@false\fi 
  \ifGin@bbox\else 
    \ifGread@ 
      \csname Gread@% 
         \expandafter\ifx\csname Gread@#1\endcsname\relax 
           eps% 
         \else 
           #1% 
         \fi 
      \endcsname{\Gin@base#2}% 
    \else 
      \Gin@nosize{#3}% 
    \fi 
  \fi 
  \Gin@viewport@code 
  \Gin@nat@height\Gin@ury bp% 
  \advance\Gin@nat@height-\Gin@lly bp% 
  \Gin@nat@width\Gin@urx bp% 
  \advance\Gin@nat@width-\Gin@llx bp% 
  \Gin@req@sizes 
  \Tg<includegraphics file="#3" width="\the\Gin@req@width" 
        height="\the\Gin@req@height"/> 
}