# beamer / doc / beamerug-frames.tex

{frametitle}{}|. \begin{element}{frametitle}\yes\yes\yes \colorfontparents{titlelike} When the frame title and subtitle are to be typeset, this template is invoked with the \beamer-color and -font |frametitle| set. This template is \emph{not} invoked when the commands |\frametitle| or |\framesubtitle| are called. Rather, it is invoked when the whole frame has been completely read. Till then, the frame title and frame subtitle text are stored in a special place. This way, when the template is invoked, both inserts are setup correctly. The resulting \TeX-box is then magically put back to the top of the frame. \begin{templateoptions} \itemoption{default}{\oarg{alignment}} The frame is typeset using the \beamer-color |frametitle| and the \beamer-font |frametitle|. The subtitle is put below using the color and font |framesubtitle|. If the color |frametitle| has a background, a background bar stretching the whole frame width is put behind the title. A background color of the subtitle is ignored. The \meta{alignment} is passed on to the |beamercolorbox| environment. In particular, useful options are |left|, |center|, and |right|. As a special case, the |right| option causes the left border of the frame title to be somewhat larger than normal so that the frame title is more in the middle of the frame. \itemoption{shadow theme}{} This option is available if the outer theme |shadow| is loaded. It draws the frame title on top of a horizontal shading between the background colors of |frametitle| and |frametitle right|. A subtitle is, if present, also put on this bar. Below the bar, a shadow'' is drawn. \itemoption{sidebar theme}{} This option is available if the outer theme |sidebar| is loaded and if the headline height is not set to 0pt (which can be done using an option of the |sidebar| theme). With this option, the frame title is put inside a rectangular area that is part of the headline (some negative space'' is used to raise the frame title into this area). The background of the color |frametitle| is not used, this is the job of the headline template in this case. \itemoption{smoothbars theme}{} This option is available if the outer theme |smoothbars| is loaded. It typesets the frame title on a colored bar with the background color of |frametitle|. The top and bottom of the bar smoothly blend over to backgrounds above and below. \itemoption{smoothtree theme}{} Like |smoothbars theme|, only for the |smoothtree| theme. \end{templateoptions} The following commands are useful for this template: \begin{templateinserts} \iteminsert{\insertframetitle} yields the frame title. \iteminsert{\insertframesubtitle} yields the frame subtitle. \end{templateinserts} \end{element} \end{command} \begin{command}{\framesubtitle\sarg{overlay specification}\marg{frame subtitle text}} If present, a subtitle will be shown in a smaller font below the main title. Like the |\frametitle| command, this command can be given anywhere in the frame, since the frame title is actually typeset only when everything else has already been typeset. \example \begin{verbatim} \begin{frame} \frametitle{Frame Title Should Be in Uppercase.} \framesubtitle{Subtitles can be in lowercase if they are full sentences.} Frame contents. \end{frame} \end{verbatim} \articlenote By default, the subtitle is not shown in any way in |article| mode. \begin{element}{framesubtitle}\no\yes\yes \colorfontparents{frametitle} This element provides a color and a font for the subtitle, but no template. It is the job of the |frametitle| template to also typeset the subtitle. \end{element} \end{command} Be default, all material for a slide is vertically centered. You can change this using the following class options: \begin{classoption}{t} Place text of slides at the (vertical) top of the slides. This corresponds to a vertical flush.'' You can override this for individual frames using the |c| or |b| option. \end{classoption} \begin{classoption}{c} Place text of slides at the (vertical) center of the slides. This is the default. You can override this for individual frames using the |t| or |b| option. \end{classoption} \subsubsection{The Background} \label{section-canvas} \label{section-background} Each frame has a \emph{background}, which---as the name suggests---is behind everything.'' The background is a surprisingly complex object: in \beamer, it consists of a \emph{background canvas} and the \emph{main background}. The background canvas can be imagined as a large area on which everything (the main background and everything else) is painted on. By default, this canvas is a big rectangle filling the whole frame whose color is the background of the \beamer-color |background canvas|. Since this color inherits from |normal text|, by changing the background color of the normal text, you can change this color of the canvas. \example The following command changes the background color to a light red. \begin{verbatim} \setbeamercolor{normal text}{bg=red!20} \end{verbatim} The canvas need not be monochrome. Instead, you can install a shading or even make it transparent. Making it transparent is a good idea if you wish to include your slides in some other document. \example The following command makes the background canvas transparent: \begin{verbatim} \setbeamercolor{background canvas}{bg=} \end{verbatim} \begin{element}{background canvas}\yes\yes\yes \colorparents{normal text} The template is inserted behind everything.'' The template should typically be some \TeX\ commands that produce a rectangle of height |\paperheight| and width |\paperwidth|. \begin{templateoptions} \itemoption{default}{} installs a large rectangle with the background color. If the background is empty, the canvas is transparent.'' Since |background canvas| inherits from |normal text|, you can change the background of the \beamer-color |normal text| to change the color of the default canvas. However, to make the canvas transparent, only set the background of the canvas empty; leave the background of normal text white. \itemoption{vertical shading}{\oarg{color options}} installs a vertically shaded background. \emph{Use with care: Background shadings are often distracting!} The following \meta{color options} may be given: \begin{itemize} \item \declare{|top=|\meta{color}} specifies the color at the top of the page. By default, 25\% of the foreground of the \beamer-color |palette primary| is used. \item \declare{|bottom=|\meta{color}} specifies the color at the bottom of the page. By default, the background of |normal text| at the moment of invocation of this command is used. \item \declare{|middle=|\meta{color}} specifies the color for the middle of the page. Thus, if this option is given, the shading changes from the bottom color to this color and then to the top color. \item \declare{|midpoint=|\meta{factor}} specifies at which point of the page the middle color is used. A factor of |0| is the bottom of the page, a factor of |1| is the top. The default, which is |0.5| is in the middle. \end{itemize} \end{templateoptions} \end{element} The main background is drawn on top of the background canvas. It can be used to add, say, a grid to every frame or a big background picture or whatever. If you plan to use a PNG image as a background image, use one with an alpha channel to avoid potential problems with transparency in some PDF viewers. \begin{element}{background}\yes\yes\yes \colorparents{background canvas} The template is inserted behind everything, but on top of the background canvas.'' Use it for pictures or grids or anything that does not necessarily fill the whole background. When this template is typeset, the \beamer-color and -font |background| will be setup. \begin{templateoptions} \itemoption{default}{} is empty. \itemoption{grid}{\oarg{grid options}} places a grid on the background. The following \meta{grid options} may be given: \begin{itemize} \item \declare{|step=|\meta{dimension}} specifies the distance between grid lines. The default is 0.5cm. \item \declare{|color=|\meta{color}} specifies the color of the grid lines. The default is 10\% foreground. \end{itemize} \end{templateoptions} \end{element} \subsection{Frame and Margin Sizes} The size of a frame is actually the paper size'' of a \beamer\ presentation, and it is variable. By default, it amounts to 128mm by 96mm. The aspect ratio of this size is 4:3, which is exactly what most beamers offer these days. It is the job of the presentation program (like |acroread|, |xpdf|, |okular| or |evince|) to display the slides at full screen size. The main advantage of using a small paper size'' is that you can use all your normal fonts at their natural sizes. In particular, inserting a graphic with 11pt labels will result in reasonably sized labels during the presentation. To change paper size'' and aspect ratio, you can use the following class options: \begin{classoption}{aspectratio=1610} Sets aspect ratio to 16:10, and frame size to 160mm by 100mm. \end{classoption} \begin{classoption}{aspectratio=169} Sets aspect ratio to 16:9, and frame size to 160mm by 90mm. \end{classoption} \begin{classoption}{aspectratio=149} Sets aspect ratio to 14:9, and frame size to 140mm by 90mm. \end{classoption} \begin{classoption}{aspectratio=141} Sets aspect ratio to 1.41:1, and frame size to 148.5mm by 105mm. \end{classoption} \begin{classoption}{aspectratio=54} Sets aspect ratio to 5:4, and frame size to 125mm by 100mm. \end{classoption} \begin{classoption}{aspectratio=43} The default aspect ratio and frame size. You need not specify this option. \end{classoption} \begin{classoption}{aspectratio=32} Sets aspect ratio to 3:2, and frame size to 135mm by 90mm. \end{classoption} Aside from using these options, you should refrain from changing the paper size.'' However, you \emph{can} change the size of the left and right margins, which default to 1cm. To change them, you should use the following command: \begin{command}{\setbeamersize\marg{options}} The following \meta{options} can be given: \begin{itemize} \item \declare{|text margin left=|\meta{\TeX\ dimension}} sets a new left margin. This excludes the left sidebar. Thus, it is the distance between the right edge of the left sidebar and the left edge of the text. \item \declare{|text margin right=|\meta{\TeX\ dimension}} sets a new right margin. \item \declare{|sidebar width left=|\meta{\TeX\ dimension}} sets the size of the left sidebar. Currently, this command should be given \emph{before} a shading is installed for the sidebar canvas. \item \declare{|sidebar width right=|\meta{\TeX\ dimension}} sets the size of the right sidebar. \item \declare{|description width=|\meta{\TeX\ dimension}} sets the default width of description labels, see Section~\ref{section-descriptions}. \item \declare{|description width of=|\meta{text}} sets the default width of description labels to the width of the \meta{text}, see Section~\ref{section-descriptions}. \item \declare{|mini frame size=|\meta{\TeX\ dimension}} sets the size of mini frames in a navigation bar. When two mini frame icons are shown alongside each other, their left end points are \meta{\TeX\ dimension} far apart. \item \declare{|mini frame offset=|\meta{\TeX\ dimension}} set an additional vertical offset that is added to the mini frame size when arranging mini frames vertically. \end{itemize} \articlenote This command has no effect in |article| mode. \end{command} \subsection{Restricting the Slides of a Frame} \label{section-restriction} The number of slides in a frame is automatically calculated. If the largest number mentioned in any overlay specification inside the frame is 4, four slides are introduced (despite the fact that a specification like |<4->| might suggest that more than four slides would be possible). You can also specify the number of slides in the frame by hand.'' To do so, you pass an overlay specification to the |\frame| command. The frame will contain only the slides specified in this argument. Consider the following example. \begin{verbatim} \begin{frame}<1-2,4-> This is slide number \only<1>{1}\only<2>{2}\only<3>{3}% \only<4>{4}\only<5>{5}. \end{frame} \end{verbatim} This command will create a frame containing four slides. The first will contain the text This is slide number~1,'' the second This is slide number~2,'' the third This is slide number~4,'' and the fourth This is slide number~5.'' A useful specification is just |<0>|, which causes the frame to have no slides at all. For example, |\begin{frame}| causes the frame to be suppressed in the handout version, but to be shown normally in all other versions. Another useful specification is ||, which causes the frame to be shown normally in |beamer| mode, but to be suppressed in all other versions.