Uploading images to LaTeX

I'm in the document class at LaTeX. How to upload an image saved as a .png file?

+6
latex
source share
3 answers

If you are working with pdflatex (direct compilation in pdf), you can use the graphicx package using the \includegraphics command. If your image is called foo.png , you can add the following command to your document.

 \includegraphics{foo} 

However, if you are working with latex (compilation in dvi first), you cannot use the "png" file as an image (with any package). You must first convert your image to "eps". If your image is called foo.png , you can convert it with any graphics software to foo.eps and use the following command to include the image.

 \includegraphics{foo} 

Here is a complete example showing the width:

 \documentclass{article} \usepackage{graphicx} \begin{document} Here is my image. \includegraphics[width=\textwidth]{foo} \end{document} 
+15
source share

Use the graphicx package (included with most LaTeX distributions), which allows you to:

 \includegraphics[width=3in]{foo.png} 

To get started, see the sample page .

+9
source share

I do not use pdflatex. On Ubuntu, I use the convert command that comes with imagemagick to convert from .png to .eps, and then use includegraphics .

+2
source share

All Articles