4
\documentclass{beamer}
%
% Choose how your presentation looks.
%
% For more themes, color themes and font themes, see:
% http://deic.uab.es/~iblanes/beamer_gallery/index_by_theme.html
%
\mode<presentation>
{
  \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
  \usecolortheme{default} % or try albatross, beaver, crane, ...
  \usefonttheme{default}  % or try serif, structurebold, ...
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
  \setbeamertemplate{footline}[frame number]
} 

\usepackage[english]{babel}
\usepackage{bm}
\usepackage{graphicx}
\usepackage[utf8x]{inputenc}
\begin{document}

\begin{frame}{Densities in ASK2ME}
\includegraphics[width = \textwidth]{pic1.png}
\\
\end{frame}

\end{document}

I am new to latex beamer and would like to insert some images into my slides. I am using \includegraphics[width = \textwidth]{pic1.png} which resizes the pic1 to fit my slide. But I still think it's a bit too small and I want it to take up more of the space on the slide.

I've also tried \includegraphics[scale = ?]{pic1.png} and experimented with different numbers but I couldn't find one that is big enough to fit the slide but not big enough so that some of the figure goes off the slide.

Is there a way to make the figure take up more space in the slide?

4
  • You can set width and height in \includegraphics option according to your desire@Adrian
    – Biki Teron
    Commented Jul 25, 2017 at 2:26
  • I see. Do you happen to know what the width and height are for a typical beamer slide? Or does it vary? Just so I have an idea
    – Adrian
    Commented Jul 25, 2017 at 2:39
  • 2
    Using scale is the right way to go, because it preserves the aspect ratio of the image, and if you couldn't find a value that worked, then it means that your image isn't proportioned in a way that can make maximum use of the slide area. If you set the width and height independently then you will distort the image. BTW, you shouldn't have \\ at the end of the slide (or almost anywhere in normal text) and you shouldn't use utf8x (see utf8 vs utf8x.
    – Alan Munn
    Commented Jul 25, 2017 at 2:47
  • 4
    Just to clarify, setting one value (either height or width) is fine, as is scale but setting both height and width independently will distort the image. You could also try adding \hspace*{-.5cm} before the \includegraphics command and using some >1 multiplier for \textwidth e.g. 1.1\textwidth or 1.2\textwidth etc.
    – Alan Munn
    Commented Jul 25, 2017 at 3:01

3 Answers 3

7

The following answer also includes some of the content of Alan Munns comments -> made it a community wiki answer.

If you think \includegraphics[width = \textwidth]{pic1.png} is too small, you can increase the size, for example \includegraphics[width = 1.1\textwidth]{pic1}.

However ever value bigger then 1.0\textwidth will cause the image to protrude into the margin and will most likely be positioned off centre.


Some other remarks:

  • you can omit the file type in \includegraphics[width = \textwidth]{pic1}, in fact this has the advantage that now automatically the preferred file type is chosen if there are multiple versions with the same name.

  • you don't need graphicx with beamer, as beamer already provides this functionality.

  • If you use \\ outside of a tabular, they are probably either unnecessary or wrong. Try not to use them.

  • Don't use utf8x, see utf8x vs. utf8 (inputenc)

2
  • @AlanMunn In case you prefer to write you own answer, I will remove your ideas from this answer Commented Aug 12, 2017 at 13:59
  • 2
    Is there anything akin to \includegraphics[width = \textwidth]{pic1.png} but with a height argument instead e.g. \includegraphics[height = \frameheight]{pic1.png}? Commented Mar 8, 2021 at 4:32
3

see if the following solution gives what you looking for:

\documentclass{beamer}
\usepackage{changepage}

\begin{document}

\begin{frame}{Densities in ASK2ME}
\begin{adjustwidth}{-1ex}{-1ex}
    \includegraphics[width = \linewidth]{example-image}
\end{adjustwidth}
\end{frame}

\end{document}

now images is for 2ex wider:

enter image description here

2

Like the others said, any value bigger than 1.0\textwidth will cause the image to protrude into the margin. But if you are OK with that then you can use tikz to increase the size while maintaining the center alignment. For example:

\documentclass{beamer}
%
% Choose how your presentation looks.
%
% For more themes, color themes and font themes, see:
% http://deic.uab.es/~iblanes/beamer_gallery/index_by_theme.html
%
\mode<presentation>
{
    \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
    \usecolortheme{default} % or try albatross, beaver, crane, ...
    \usefonttheme{default}  % or try serif, structurebold, ...
    \setbeamertemplate{navigation symbols}{}
    \setbeamertemplate{caption}[numbered]
    \setbeamertemplate{footline}[frame number]
} 

\usepackage[english]{babel}
\usepackage{bm}
\usepackage[utf8x]{inputenc}
\usepackage{tikz}
\begin{document}

    \begin{frame}{Densities in ASK2ME}
    \begin{tikzpicture}[remember picture, overlay]
    \node[anchor=north] at ([yshift=-0.8cm]current page.north) {\includegraphics[width = 1.06\textwidth]{example-image}};
    \end{tikzpicture}
    \end{frame}

\end{document}

This produces:

slide

You can change the numbers to suit your needs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .