码迷,mamicode.com
首页 > 其他好文 > 详细

Solution for Latex error: "Cannot determine size of graphic"

时间:2015-12-24 16:27:32      阅读:1201      评论:0      收藏:0      [点我收藏+]

标签:

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:

技术分享

Solution for Latex error: "Cannot determine size of graphic"

标签:

原文地址:http://www.cnblogs.com/Steven-Love-Arlene/p/5073361.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!