# TeXtoGIF - How do I install it?

1. Feb 7, 2005

I need to convert equations inside of a ".tex" file into a ".gif" or ".png" file. I've found this program called Textogif that does exactly that (http://www.fourmilab.ch/webtools/textogif/textogif.html). The main problem is that my PC runs Windows XP, while the author of this program made it specifically to UNIX. In fact, he tells that "given the number of Unix-specific dirty tricks employed by Textogif, it is extremely unlikely it will work under other operating systems without modifications."

I'm not used to doing things in UNIX, so I really need some help. I've downloaded and extracted textogif-1.1.gz, and I also have the requirements: Perl, TeX, LaTeX2e, dvips, Ghostscript, and Netpbm. My Perl is not located in the "/usr/bin/perl" directory, but in "C:\Perl\bin" (again, because I'm running Windows). I tried changing that in the perl script, but it doesn't work.

Any help is highly appreciated.

Last edited: Feb 8, 2005
2. Feb 8, 2005

### dduardo

Staff Emeritus
Last edited by a moderator: Apr 21, 2017
3. Feb 9, 2005

### Triss

TeX (or atleast MikTeX) includes a program to convert dvi -> png:

dvipng.exe -help

Usage: %s [OPTION]... FILENAME[.dvi]
Options are chosen to be similar to dvips' options where possible:
-D # Output resolution
-l # Last page to be output
--mode s MetaFont mode (default 'cx')
-M* Don't make PK fonts
-o f Output file, '%%d' is pagenumber
-O c Image offset
-p # First page to be output
-pp #,#.. Page list to be output
-q* Quiet operation
-r* Reverse order of pages
-T c Image size (also accepts '-T bbox' and '-T tight')
-v* Verbose operation
-x # Override dvi magnification
- Interactive query of options

These do not correspond to dvips options:
-bd # Transparent border width in dots
-bdpi # Set the base (Metafont) resolution
-bg s Background color (TeX-style color)
--depth* Output the image depth on stdout
--dvinum* Use TeX page numbers in output filenames
-fg s Foreground color (TeX-style color)
--height* Output the image height on stdout
--truecolor* Truecolor output
-Q # Quality (T1lib and PK subsampling)
-z # PNG compression level

# = number f = file s = string * = suffix, '0' to turn off

c = comma-separated dimension pair (e.g., 3.2in,-32.1cm)

4. Feb 9, 2005

I don't have much space left in my PC, so it won't be possible to install cygwin. About dvipng, my MikTeX doesn't seem to have it. Whenever I call it, the computer says it cannot be found. Thanks anyway.

I'm now considering using latex2html, since it outputs all the png's (besides the html pages). In theory, it sounds great. However, I'm having a problem. I've installed all the requirements along with latex2html, but an error always occurs while trying to convert the images:

Global symbol "$PNMFILE" requires explicit package name at pstoimg.bat line 1285. I took a look at that line, but it seems ok. I just don't know what to do now. Again, thank you very much. PS: here is line 1285 sub get_image_geometry { my ($pnmfile) = @_;

my ($type,$width,$height); my$out = $PNMFILE$pnmfile;
if($? ||$out =~ /(P[BGP]M)[^0-9]*(\d+)\s*by\s*(\d+)/i) {
$type =$1;
$width =$2;
$height =$3;
print qq{Image "$pnmfile" is$type, ${width}x$height\n} if($opt{debug}); } else { print "$prompt: Error: Could not determine image size: $out\n"; return undef; } ($type,$width,$height);
}

Last edited: Feb 9, 2005
5. Feb 10, 2005

### Triss

Why don't you update your MikTeX, its being exspanded and updated reguarly.