2

This question is inspired by an almost complete solution. My aim is to have the figure (placed in a figure environment) occupy the maximum place possible given that it has a caption (without generating any warnings of course) and that there are things like a frame title and a navigation bar. The idea from the linked solution is to use

\includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{picture}

However, this doesn't seem to take into account the fact that I have a frame title and a navigation bar (due to the Warsaw theme). Actually, even if I remove the theme, the frame title and the caption, it still results in a badbox. I've tried compiling with PDFLaTeX and lualatex from inside Texmaker.

Suggestions using additional packages (I already use tikz) or even lua are welcome. Here's the MWE.

\documentclass{beamer}
\usepackage{graphicx}

\usetheme{Warsaw}

\begin{document}

\section{Introduction}

\subsection{General considerations}

\begin{frame}{Definition}

  \begin{figure}
    \includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{statesOfMatter}
    \caption{Classical picture of the states of matter.}
  \end{figure}

\end{frame}

\section{Placeholder I}

\begin{frame}

\end{frame}

\section{Placeholder II}

\begin{frame}

\end{frame}

\end{document}

Figure only Figure surrounded by navigation bar, caption and frame title

Christoph B.
  • 1,901
  • 1
    Please see this excellent answer from diabonas: http://tex.stackexchange.com/a/44298/3954 . – Gonzalo Medina Apr 19 '13 at 19:38
  • Right, thanks for pointing that one out, I had completely missed it. It's a step too involved for my skills, but it seems that if I use height=\dimexpr\contentheight-\contentbottom-X\baselineskip\relax, where X=3 if there's a one-line caption and 0 otherwise, then I get a good enough size without a badbox (if the picture is higher than it is wide). It's a bit black magic to me, but I'll try delving into it a bit more these next few days. – Christoph B. Apr 19 '13 at 20:55

0 Answers0