0

I having trouble inserting a gif file into my overleaf latex document. Here is the code I used:

 \documentclass[conference,10pt]{IEEEtran}
 \usepackage{graphicx}
 \usepackage[utf8]{inputenc}
 \usepackage{epstopdf}  
 \usepackage{psfrag}    
 \usepackage{subfigure} 
 \usepackage{url}       
 \usepackage{stfloats}  
 \usepackage{amsmath}    
 \interdisplaylinepenalty=2500                    
 \usepackage{balance}

\DeclareGraphicsRule{.gif}{png}{.png}{% \noexpand\epstopdfcall{convert #1 \noexpand\OutputFile}% } \AppendGraphicsExtensions{.gif}

\begin{figure}[h!] \includegraphics[width=\linewidth, angle = 0] {images/Climate_Simulation_of_Surface_Air_Temperature.gif} \caption{NASA's Map of Antarctic Ice Flow} \label{fig:SSBlock} \end{figure}

This did not work so I replaced the \begin section with this line of code:

      \includegraphics[width=\linewidth, angle = 0 {images/Climate_Simulation_of_Surface_Air_Temperature.gif}

Still nothing worked. Please let me know how I can insert my .gif file.

Debbie
  • 111
  • 2
    you would have to enable shell escape, but it is much simpler just to convert the gif to png before you run latex then simply \includegraphics{images/Climate_Simulation_of_Surface_Air_Temperature.png} – David Carlisle Dec 05 '20 at 13:12
  • @DavidCarlisle Thanks, but I want the image to move (just like a image in a gif does) when I create a pdf. Is that possible in Overleaf? – Debbie Dec 05 '20 at 18:57
  • It's not possible in PDF you can not embed an animated gif in a PDF file, the fact that you are using latex does not change that. It is possible to take the frames out of the gif and build embed as a PDF animation for viewers that support that but certainly that is something you want to construct externally not do on the fly in includegraphics – David Carlisle Dec 05 '20 at 19:02

0 Answers0