As we all know, LaTeX uses various environments to typeset a document. We are familiar with environments like itemize, enumerate, bibliography, etc., which are commonly used in the article document class. The functionality of these remains the same in the beamer document class as well. Besides these, we have few more environments for creating presentations in beamer.
In this lesson, we will give an overview of the following environments:
- frame environment,
- abstract environment,
- slide environment,
- overlayarea environment,
- overlayprint environment,
- semiverbatim environment.
- theorem environment,
- proof environment,
1. Frame environment
Frame environment creates a presentation slide in beamer. A frame can have one slide or multiple slide depending up on the overlay effects. A frame consists of various components such as headline, footline, frame title, navigation bars, navigation symbols, sidebars, etc. These components are discussed in detail in the ”Elements of a frame” lesson.
We are familiar about creating frames with title and subtitle (Outline slide of a presentation). We create a frame environment in LaTeX as follows:
% Frame environment \begin{frame}[options]{Frame Title}{Frame subtitle} content \end{frame}
The options available under this environment are :
allowdisplaybreaks=(break desirability)
The break desirability value ranges from 0 to 4. Where, 0 means no breaks at all while 4 means can be broken anywhere. This command is typically of use for inserting formulas. The command makes changes only on the current slide and not to the overlay slides.
allowframebreaks=(fraction)
The content on the frame will automatically shift to other slides if it fails to fit on one slide. The argument (fraction) is used to specify the percentage of content on a slide. This fraction ranges from 0 to 1. Where, 1 means 100% content is displayed on a single slide. This will, however, spoil the visual appearance and hamper the readability. It is recommended to used 0.5 which will display only 50% on one slide. This option needs to be used with the above option, otherwise it shall make no sense. Used for long equations and bibliographies.
b, c, t
Here, b stands for bottom, c stands for center, and t stands for top. This option is used to specify the vertical alignment of the frame title. By default, it is always aligned to the top of the frame.
noframenumbering
This option shall suppress the frame number for the current frame.
fragile = singleslide
Used to contain fragile text such as a code snippet. The argument ’singleslide’ means that the frame has only one slide.
label
The label option stores the contents of a frame under the given label. This label can be used to call the same frame at some later point of time in the presentation. \againframe command is used for that purpose. Label is also an important option to declare hyperjump targets. This option can be used along with the fragile option.
plain
This option will suppress all the outer-theme elements, such as headline, footline and sidebars. It can be used for displaying pictures or tables that may occupy full-frame space.
shrink
This option calculates a factor termed as ’shrink factor’ here. This shrink factor is used to scale the text on the frame. If the text is too large or too small then this option can be used to rescale its size. Beamer will first typeset the whole frame and then evaluate the vertical size of the frame text. If this vertical size is larger than the text height minus the frame title height, beamer computes a shrink factor and scales down the frame text by this factor such that the
frame text then fills the frame completely. This option will active the squeeze option by default.
Finding the shrink factor is more or less a trial and error process. Since the shrinking takes place only after everything has been typeset, shrunk frame text will not fill the frame completely horizontally. For this reason, you can specify a <minimum shrink percentage > like 20. If this percentage is specified, the frame will be shrunk at least by this percentage. Since beamer knows this, it can increase the horizontal width proportionally such that the shrunk text once more fills the entire frame. If, however, the percentage is not enough, the text will be shrunk as needed. The best way to use this option is to identify frames that are overly full, but in which all text absolutely has to be fit on a single frame. Then start specifying first shrink=5, then shrink=10, and so on, until no warning is issued any more. However, using the option will change the font size from slide to slide. This shall distort the appearance of the presentation. It is recommended to avoid the used of this command and rather try to restructure the frames.
squeeze
This option will result in squeezing of all the vertical spaces in the text. This is mostly used in the enumerate and the itemize environment. It make makes the vertical space in these environments to zero.
2. abstract environment
In beamer class, abstract is defined as an environment and not as a macro. Thus, it should start and end with a begin and end tag. If the \end{abstract} tag is not used then the slide contents will be continued to the next slide. This environment will create a title ’abstract’ in the information area of the frame. The margins will be wider than other
environments. Here is the corresponding code:
% Abstract environment \begin{abstract} content \end{abstract}
3. slide environment
The following environment:
% Slide environment \begin{slide}[options] content \end{slide}
is similar to the frame environment with fragile=singleslide option active. The slide environment will typeset the frame in that style. The various options available for this environment are :
trans=(prosper transition)
This uses the prosper transitions as transition effects while showing the slides.
toc=(entry)
This option will create an entry of the slide in the table of contents as a subsection. Keeping in mind that display of subsections in table of contents is active.
4. overlayarea environment
The environment
% Overlay area environment \begin{overlayarea}<overlay spec>{area width}{area height} content \end{overlayarea}
is overlay-specification-aware. It is used to dynamically change images or text on different slides using overlay specifications. Everything within the environment will be placed in a rectangular area of the specified size. The area will have the same size on all slides of a frame, regardless of its actual contents. It is used to eliminate the wobbling effect of the slide. The use of the environment with example will be explained in the ”Overlay Specifications” lesson.
5. overlayprint environment
This environment:
% Overlay print environment \begin{overlayprint}<overlay specification>[{area width}] content \end{overlayprint}
is similar to overlayarea environment, except that the area height argument is absent. Here, the area height is equal to the frame height. By default, the area width will be equal to text width. Within this environment, \only and \onslide commands can be used to replace the text content on different slides.
6. semiverbatim environment
The text inside this environment is typeset like verbatim text. However, the characters \, { and } retain their meaning.
% semiverbatim environment \begin{semiverbatim} content \end{semiverbatim}
7. Theorem environment
As the name suggests, it is used to typeset a theorem. This environment corresponds a block environment. But the block body functions as a math environment. All the equations inserted here will be displayed in italics font style by default and block title will be typeset as boldface font. The [additional text] argument shall be shown along with the block title. By default, no theorem numbers are shown in the presentation modes.
% Theorem environment \begin{theorem}<〈action specification〉 >[additional text] content \end{theorem}
8. Proof environment
This environment is used to include a proof in the presentation. The proof will be be typeset inside a block-like environment. The argument (proof name) will replace the block title which is typeset to ”Proof” and display the name of the proof.
% Theorem environment \begin{proof}<〈action specification〉 >[proof name] content \end{proof}
The end line of a the proof is symbolized by a qed symbol. By default, this symbol is an empty sqaure. To suppress or change the shape of this symbol, the following command has to be declared in the preamble:
– Remove Q.E.D symbol from Proof
% Suppress the qed symbol \def\qedsymbol{}
– Modify Q.E.D symbol
% Filled square symbol \setbeamertemplate{qed symbol}{$\blacksquare$}
Summary
In this lesson, we have highlighted the most used environments in Beamer such as frame, abstract, theorem, proof, semiverbatim and slide. These environments will be considered with more details in the next lessons and blog posts.
Next Lesson: 05 Lists in Beamer – Complete Guide