I want to insert this picture :
in to a beamer. I know that there some problems if the picture is in the format of PNG
or jpeg
. So, I convert it into eps
format. When I tried to insert it, it failed with many errors.
Can someone show me how to do this? As you can see that it's a little big. How can it be scaled to suit beamer document?
2 Answers
Try something like this, where figure-name
is the file name of your figure (without the file extension). If you have it in both PDF and EPS formats, then the compiler should automatically choose the right one.
\documentclass{beamer}
\usepackage{graphicx}
\mode<presentation>
\begin{document}
\frame
{
\begin{figure}
\centering
\includegraphics[width = 0.9\textwidth]{./figure-name}
\caption{Awesome figure}
\end{figure}
}
\end{document}
I've included the package graphicx
as it gives some useful options for figures. I've set the width of the figure to 90% of the text width. You can play around with that to get it to fit as you like. I've put the image in the figure
environment and given it a caption, but you don't have to. \centering
won't work outside the environment, but you could use instead:
\begin{center}
\includegraphics[width = 0.9\textwidth]{./figure-name}
\end{center}
If you don't care about centering, then you don't even need to bother with that. Hope that sorts things.
If you have eps
figures, you could try adding:
\usepackage{epstopdf}
in the preamble of your document.
This should automatically convert your eps
into pdfs
when compiling the document.
PNG
(or better yet,PDF
) is the format to go. Why don't you write this directly, instead of using an image?