I‘m trying to include graphics in my Latex-file, which I compiled with latex+dvipdf on OS X. Latex however returns this error: "Cannot determine size of graphic"
My graphic is exported from PowerPoint, so I have tried both .pdf and .png. I get the same errors for both.
Sample code:
\begin{figure}[htb] \begin{center} \leavevmode \includegraphics[width=0.8\textwidth]{graph.png} \end{center} \end{figure}
Error:
Answers:
The DVI producing
latex
doesn‘t support reading the size of PNG, JPG or PDF images. You need to use pdflatex
for this.
Actually
latex
is pdflatex
in DVI mode in modern distributions, but it can read the sizes only in PDF mode for some reason.
You are however able to state the natural size of the images using
natwidth
and natheight
which will make latex
compile without error.
The produced DVI file will only link to the PDF and the DVI-to-PDF converter will need to include it in the final PDF.
AFAIK
dvpdf
doesn‘t support this but dvipdfm
does.
Do it like the picture‘s method: