How can I reduce the font size in beamer instead of wrapping text?
Use shrink=0 ... 100
in the frame option to shrink everything by n percent of a frame, as displayed below.
\documentclass{beamer}
\usepackage{lipsum}
\begin{document}
\begin{frame}[shrink=50] % shrink 50 percent
\lipsum[2]
\end{frame}
\end{document}
If you don't need to shrink the whole frame but just a box in it, you can use fitting
library from tcolorbox
package:
Next example is taken from tcolorbox
manual adapted to beamer
:
\documentclass{beamer}
\usepackage{tcolorbox}
\tcbuselibrary{fitting}
\usepackage{lipsum}
\tcbset{colframe=blue!50!black,colback=red!10!white,
boxsep=0pt,top=1mm,bottom=1mm,left=1mm,right=1mm,
nobeforeafter,width=\linewidth}
\begin{document}
\begin{frame}{Shrinking with \texttt{tcolorbox}}
\begin{columns}[totalwidth=\textwidth]
\begin{column}{.45\textwidth}
\tcboxfit[height=8cm]{\lipsum[1]}
\end{column}
\begin{column}{.45\textwidth}
\tcboxfit[height=4cm]{\lipsum[1]}\\
\tcboxfit[height=3cm]{\lipsum[1]}
\end{column}
\end{columns}
\end{frame}
\end{document}
beamer
already loads graphicx
which you can use to resize content:
\documentclass{beamer}% http://ctan.org/pkg/beamer
\let\Tiny\tiny% http://tex.stackexchange.com/q/58087/5764
\begin{document}
\begin{frame}
This is some very long text that should span at least two lines on this frame.
\resizebox{\linewidth}{!}{This is some very long text that should span at least two lines on this frame.}
\resizebox{\linewidth}{!}{%
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at aliquam massa. Pellentesque
habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut non elit a neque
ullamcorper vulputate. Cras faucibus porta tellus, nec vulputate nibh. Morbi ut orci et augue euismod
ornare non quis diam. Maecenas ac diam eget neque porttitor tempor et at tortor. Sed sit amet varius
tortor. Suspendisse potenti. Proin lacus odio, porta id nunc non, feugiat sagittis lorem. Vestibulum
non nibh purus. Duis leo magna, posuere sed viverra vel, scelerisque a ligula. Sed ullamcorper orci
eu justo ullamcorper tristique.%
}
\resizebox{\linewidth}{!}{Here is some text.}
\end{frame}
\end{document}
\resizebox{<width>}{<height>}{<stuff>}
is used to fit <stuff>
inside a box of width <width>
(and/or height <height>
). If either of these lengths are !
, <stuff>
is sized in a way that maintains the aspect ratio.
Note that this approach will always make <stuff>
fit within \linewidth
(either shrinking or enlarging).