Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Fixing Grey Backgrounds in Equation Images

Another important bugfix is needed in the perl script pstoimg (normally located in /usr/bin/). It's a one-character change described by the following ``diff'':

diff -cb pstoimg /usr/bin/pstoimg
*** pstoimg	Sat Dec 16 15:55:09 2006
--- /usr/bin/pstoimg	Sun Dec 11 03:14:00 2005
***************
*** 1021,1027 ****
        }
      my $had_nonwhite;
      if($opt{white}) {
!       $had_nonwhite = ($ps =~ s/(\n\d+ \d+ bop gsave) \d*\.\d+ \
        (TeXcolorgray clippath fill grestore)/$1 1 $2/s);
        }
      $ps_changed = $had_papersize || $had_nonwhite;
      if($ps_changed) {
--- 1021,1027 ----
        }
      my $had_nonwhite;
      if($opt{white}) {
!       $had_nonwhite = ($ps =~ s/(\d+ \d+ bop gsave) \d*\.\d+ \
        (TeXcolorgray clippath fill grestore)/$1 1 $2/s);
        }
      $ps_changed = $had_papersize || $had_nonwhite;
      if($ps_changed) {

The change is to remove the `\n' from the search string that detects whether or not the PostScript image-file being processed has a gray background or not. Without this fix, equation images all have a grey background, even when the option $WHITE_BACKGROUND is set nonzero in ~/.latex2html-init. Some years ago, the TeXcolorgray fill command always started on its own line. Since around the time of Fedora Core 2, this is no longer the case, so expecting it at the beginning of the line fails. The fix is simply to allow a match anywhere in the line.


Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Download webpub.pdf
[Comment on this page via email]

``Tools for Publishing LaTeX Documents on the Web'', by Julius O. Smith III.
Copyright © 2017-06-24 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA