Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Includegraphics problems with a PNG [closed]

Tags:

image

latex

tex

led

I have problems to insert an image into my .tex file. This is the code:

\begin{figure}
 \includegraphics[width=1\textwidth]{Blockdiagram}
  \caption{Diagram}
  \label{figure:BlockDiagram}
\end{figure}

It says that it cannot find the file! The same with Blockdiagram.png.

The figure is in the same folder. The main .tex is outside this folder, and I tried copying the image there, but the problem persists.

If I type H for help I have:

I could not locate the file with any of these extensions: .eps, .ps....

It's a png! In the file I have both:

\usepackage{graphicx}
\usepackage{epsfig}

And I tried commenting epsfig.... but nothing happens. Same error.

Any ideas?

EDIT: I have several PNG files, is it possible to use PNG files? I am using LEd under WinXP.

like image 679
legami Avatar asked Aug 12 '10 07:08

legami


People also ask

Which image format is best for LaTeX?

JPG: Best choice if we want to insert photos PNG: Best choice if we want to insert diagrams (if a vector version could not be generated) and screenshots PDF: Even though we are used to seeing PDF documents, a PDF can also store images EPS: EPS images can be included using the epstopdf package (we just need to install ...

Which package should be included for using Includegraphics?

The \includegraphics command is part of the graphicx package and can import all the usual file formats including pdf, jpeg, png, etc. The command also accepts other options instead of scale such as rotation, height, width, bounding box, etc.

Why is overleaf not showing images?

To resolve this issue, you can change the PDF viewer from Overleaf to Browser using instructions found here. If the images are still not appearing, there is likely something wrong in your LaTeX. Make sure that you have uploaded the file and specified the file location correctly.

How to include an image in LaTeX?

Including images in your LaTeX document requires adding: \usepackage{graphicx} to the beginning/preamble of your document. \includegraphics{ } command tells LaTeX to insert the image. To upload an image, click the upload button, and upload your image file.


1 Answers

You could use PDFLaTeX instead of LaTeX. PDFLaTeX can import PNG images. You cannot use EPS images in PDFLaTeX, though; you would have to use PDF as a vector image format. I would recommend to use ImageMagick to convert images.

like image 139
Svante Avatar answered Nov 14 '22 22:11

Svante