I want to include gif-files in my latex document.
I tried the following code:
\documentclass[a4paper]{book}
\usepackage{graphicx}
\begin{document}
\DeclareGraphicsExtensions{.gif}
\DeclareGraphicsRule{.gif}{pdf}{.gif.bb}{`giftopnm #1 | pnmtops | ps2pdf
- -}
\chapter{test}
\includegraphics[width=3cm]{ALLG-Logo.gif}
\end{document}
But that doesn't work :(
I created the "ALLG-Logo.gif.bb" file, its contents are:
%%BoundingBox: 12 10 583 832
But pdflatex says:
Error: pdflatex (file ALLG-Logo.gif.bb): unknown type of image
Do you have any idea what might be the reason?
Thanks!
Vitali
> I want to include gif-files in my latex document.
[snip]
> Do you have any idea what might be the reason?
gif is not supported. Use png instead. If you need the gif for moving
images, you can include movies (mpeg, avi and possibly quicktime, with
mpeg probably the most portable) using the movie15 package (available
from CTAN).
Maarten
I know that pdflatex supports only png, tiff and pdf. But I know there
should be a way to convert the included gif images on-the-fly... And one
my acquaintance told me he had included them before and even sent me a
description. But it doesn't work neither under Windows, nor under
Linux/Unix...
Besides, did I get it right that the <command> in:
\DeclareGraphicsRule{<ext>}{<type>}{<size-file>}{`<command>}
stands for a command-line command? Or is it only a function of the
processing driver, in my case - of pdflatex?
> I know that pdflatex supports only png, tiff and pdf. But I know there
> should be a way to convert the included gif images on-the-fly... And one
> my acquaintance told me he had included them before and even sent me a
> description. But it doesn't work neither under Windows, nor under
> Linux/Unix...
> Besides, did I get it right that the <command> in:
>
> \DeclareGraphicsRule{<ext>}{<type>}{<size-file>}{`<command>}
>
> stands for a command-line command? Or is it only a function of the
> processing driver, in my case - of pdflatex?
`command` notation is the way you pass commands to the command line.
Percival
So the
`giftopnm #1 | pnmtops | ps2pdf - -
command will not work under Windows? I mean, normally these progs are
not installed an a Windows-machine...
> I know that pdflatex supports only png, tiff and pdf. But I know there
> should be a way to convert the included gif images on-the-fly...
Look at epstopdf.sty, here eps files are converted on the fly to pdf.
Example:
\documentclass{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\makeatletter
\g@addto@macro\Gin@extensions{,.gif}
\makeatother
\DeclareGraphicsRule{.gif}{png}{.png}{%
`giftopnm '#1'|pnmtopng>`dirname '#1'`/`basename '#1' .gif`.png%
}
\begin{document}
\includegraphics{s1}
\end{document}
Yours sincerely
Heiko <ober...@uni-freiburg.de>
Is \write18 enabled? Try running pdflatex with the -shell-escape option
(or, if you're using MiKTeX, the --enable-write18 option).
HTH,
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pech...@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ ig...@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT
Your macro did work.
Do you happen to know whether there is a version of the netpbm-Package
(which includes the graphics conversion programs giftopnm, pnmtopng
etc.) that works under Windows without cygwin? Or do you accidently know
if there is an open-source alternative that converts gifs to pngs?
Thank you very much!
Your sincerely,
Vitali
> Do you happen to know whether there is a version of the netpbm-Package
> (which includes the graphics conversion programs giftopnm, pnmtopng
> etc.) that works under Windows without cygwin? Or do you accidently know
> if there is an open-source alternative that converts gifs to pngs?
Image conversion screams "ImageMagick" to me:
http://www.imagemagick.org/www/windows.html
Maarten
> Or do you accidently know
> if there is an open-source alternative that converts gifs to pngs?
>
You may find ImageMagick useful:
Laurence Finston
http://www.gnu.org/software/3dldf/LDF.html
>Thank you for your help, Heiko!
>
>Your macro did work.
>Do you happen to know whether there is a version of the netpbm-Package
>(which includes the graphics conversion programs giftopnm, pnmtopng
>etc.) that works under Windows without cygwin? Or do you accidently know
>if there is an open-source alternative that converts gifs to pngs?
http://gnuwin32.sourceforge.net/packages/netpbm.htm
This has some problems[*], but the programs work for me under WinXP (at
the command line). In particular, giftopnm and pnmtopng worked for me
out of the box. Since Windows is known to have a few issues with
pipes, the commands previously suggested might not necessarily work in
all Windows systems for graphics inclusion. (I haven't tried it, I
convert all gifs to png and throw the gif away :-) ImageMagik, as has
been suggested, also works well.
[*] The problems:
The programs are apparently intended to be run under some incarnation
of the sh shell (for example, but not necessarily, from Cygwin or MSYS).
Thus, some of the program files have no .exe extension, but are,
nevertheless, .exe files. I used a file browser to view all files
lacking extensions and renamed them, adding the extension
.exe, .sh or .pl
determined by the string at the start of the file:
"MZ", "#!/bin/sh" or "#!/usr/bin/perl"
Of course you need to have some form of sh to run the few .sh
programs and perl to run the few .pl programs. Adding the extensions
.sh or .pl is not necessary, but helps to keep straight which is which.
However, Windows seems to require the .exe or .com extension on
executable programs.
Dan
--
Dan Luecking Department of Mathematical Sciences
University of Arkansas Fayetteville, Arkansas 72701
To reply by email, change Look-In-Sig to luecking