I'm in a documentclass in LaTeX. How do I load an image saved as a .png file?
If you work with pdflatex
(direct compilation to pdf), you can use the graphicx
package using the \includegraphics
command. If your image is called foo.png
, you can add the following command inside your document.
\includegraphics{foo}
However, if you work with latex
(compilation into dvi first), you cannot use 'png' file as image (with any package). You have to convert your image into 'eps' first. If your image is called foo.png
, then you can convert it with any graphics software into foo.eps
, and use the following command to include the image.
\includegraphics{foo}
Here is a complete example with width specification:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
Here is my image.
\includegraphics[width=\textwidth]{foo}
\end{document}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With