Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In my presentation I put \tikzpicture, cases or \array in \figure, I am wondering if it is possible to resize the whole picture including caption with a factor. It seems that \resizebox{<horizontal size>}{<vertical size>}{...} does not work here...

Could anyone help? Thank you very much!

share|improve this question

2 Answers 2

up vote 2 down vote accepted

I recommend to avoid using figure environments in beamer, because usually the figures are not intended to float in presentations, and they don't do it as Herbert commented. It can avoid confusion with floats in standard LaTeX. If you just use figure because you need captions, you could do it with the \captionof command of the caption package instead.

Here's an example, where a minipage of a small size .3\textwidth is used together with a caption, and enlarged by \resizebox to \textwidth, the whole box including the caption is scaled.

\documentclass{beamer}
\usepackage{caption}
\begin{document}
\begin{frame}
\resizebox{\textwidth}{!}{%
\begin{minipage}{.3\textwidth}
\centering
 $\begin{array}{c}
    \sum\limits_{i=1}^{\infty} x_i
  \end{array}$
\captionof{figure}{Test figure}
\end{minipage}}
\end{frame}
\end{document}

resized figure with caption in beamer frame

It would cause an error if figure with \caption would be used here instead of minipage. Note, by using the caption package you can benefit from further features of this great package.

share|improve this answer
    
inside beamer the figure is not a floating object –  Herbert Aug 29 '11 at 16:32
\documentclass{beamer}
\usepackage{varwidth}
\newsavebox\IBox
\newenvironment{resizefig}[1][\textwidth]
 {\gdef\figWidth{#1}%
  \begin{lrbox}{\IBox}
  \varwidth{\textwidth}
  \figure\centering}
 {\endfigure\endvarwidth\end{lrbox}%
   \resizebox{\figWidth}{!}{\usebox\IBox}}

\begin{document}

\begin{frame}{foo}{bar}
\begin{resizefig}[0.8\textwidth]
 $\begin{array}{c}
    \sum\limits_{i=1}^{\infty} x_i
  \end{array}$
\caption{Test figure}
\end{resizefig}
\end{frame}

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.