0

I am trying to insert a diagram in my document, but the image isn't showing up above the caption. Is there something in my code I need to fix?

\usepackage{graphicx}
\begin{figure}[h!]
    \centering
    \includegraphics{images/Keplers_first.gif}
    \caption{Caption}
    \label{fig:Keplers_first}
\end{figure}

So far, this is what my document looks like: enter image description here

David Carlisle
  • 757,742
  • 5
    don't you get an error message in the log about unknown gif extension? – David Carlisle Jul 06 '19 at 13:21
  • 5
    The red square with the number "2" next to the button "Recompile" means that you have 2 errors in your code. Overleaf settings, are in such a way that your code is been forced to compile as far as this is possible... but this doesn't mean that you have to ignore these errors. You have to correct them one by one even if your output is the desired one. This, because a forced (to be compiled) code can give unexpected results and could even be non-compile-able after an update of LaTeX or whatever. Please take care and be careful with such errors. Yellow square means warnings... – koleygr Jul 06 '19 at 13:32
  • 2
    The problem as mentioned above is that you cannot use .gif images in LaTeX. The solution is to save the file as another format (.jpg or .png) on your local computer and then re-upload. If the .gif image is animated then you need to use additional conversions and packages, see for example https://tex.stackexchange.com/questions/5396/is-there-any-way-to-include-an-animated-gif-directly - however this may not work on Overleaf and it is incompatible with several widely used pdf viewers. – Marijn Jul 06 '19 at 14:30

0 Answers0