[l2h] graphicx, EPS and latex2html

JB_McKitterick JB_McKitterick <jbmck@batc.allied.com>
Thu, 26 Aug 1999 08:53:53 -0400


A simple observation (without any real explanation, 'cause I'm not close
to understanding much):

If your eps graphics have gray in them, the process of turning them
into gif's with transparent background doesn't work properly. In my
work,
I use a graphing program called xmgrace to generate graphs. For the most
part, the generation of gif's work marvelously. But if one of the curves
on the graph is gray (one of the default colors in xmgrace), the gif
comes up with a gray-looking background.

Setting \pagecolor{white} fixes the problem, as does getting rid of the 
gray color in the graph.


Ross MOORE wrote:
> 
> > Currently, my latex2html'ed documents have some problems with grey.
> > Sometimes, grey is painted as white and sometimes, the pictures are
> > printed _on_ grey. Any idea what might be going wrong here?
> 
> No, grey is never used instead of white.
> It *is* used instead of transparent, or "no colour",
> which can cause the effects that you observe.
> 
> If you  \usepackage{color}  and  \pagecolor{white}  then you will
> get a white background, but for graphics that are constructed only
> using text, the default background is a shade of grey.
> The reason for this is to get a better result with anti-aliasing
> around the edges of font-characters.
> 
> The variables to adjust are  $LATEX_COLOR  and  $WHITE_BACKGROUND .
> 
> The latter is also set using  -white  on the command-line,
> but it affects only {figure} and unknown environments,
> which are likely to have graphic elements imported from elsewhere.
> 
> Environments, such as inline-math or accents, or math-displays,
> or {makeimage} or {xy} etc.  which are known to be constructed using
> font glyphs, automatically load the {color} package and set the
> $LATEX_COLOR as background *UNLESS* your document already specifies
> (within the document preamble) that it is loading this package
> and setting a background color.
> 
> Since it is usual to have a transparent background, the grey should
> disappear when viewed from a Web browser.
> For images where this does *not* occur, you can try several things
> 
>  a. explicitly set a background color for your image (in whatever
>     application it was created)
>     --- do *not* assume that empty means white
> 
>  b. try using a \pagecolor{white} command within the environment
>     (this may not work with LaTeX currently)
> 
>     \begin{figure}
>     \begin{latexonly}
>     \pagecolor{white}
>     \end{latexonly}
>     .... what you really want in your figure ...
>     \end{figure}
> 
>  c.  If (b) doesn't work, then do it in stages:
> 
>     A.  process the whole document, so that eveything is perfect except
>         for the background of some images. e.g. img23.gif  img37.gif etc.
> 
>     B.  delete those .gif files, and any .old versions;
>         e.g.  rm <jobname>/img{23,37}.*
> 
>     C.  insert a line   \pagecolor{white}  in the preamble of your source
>         document.
> 
>     D.  reprocess the whole document.
> 
>   Only the missing images will be recreated,
>   now with the correct background color.
> 
>   With this technique, you can use multiple background colours;
>   but you need a separate processing run for each colour,
>   so plan carefully to avoid wasting time, and be sure to reload
>   images from source (not from the browser cache) when viewing the results.
> 
> Hope this helps,
> 
>         Ross Moore
> 
> >
> > Greetings
> > Marc
> >
> > --
> > -------------------------------------- !! No courtesy copies, please !! -----
> > Marc Haber          |   " Questions are the         | Mailadresse im Header
> > Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
> > Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29

-- 
John McKitterick                         jbmck@batc.allied.com
AlliedSignal Microelectronics and Technology Center
Columbia, MD                             (410) 964-4068
 --------------------------------------------------------
| "It's tomorrow that counts. So you worry all the time. |
| It never ends. Lord, baseball is a worrying thing."    |
 --------------------------------------------------------