Beamer is a LaTeX document class that provides extensive functionality to create presentations. Here, I will only show the basics and after reading this guide you will be able to create a simple presentation in LaTeX. I am aware there are a lot of tutorials available out there and this is not different from any other tutorial. I hope however, I can encourage some of you who have hesitated so far, for whatever reason, to create your next presentation with LaTeX. And I’m sure it will be a lot of fun, with similar effort. I should add that the output will obviously be a PDF file (with all its advantages!). Luckily, PDF-viewers (including Adobe Acrobat) provide a fullscreen-mode for presentation purposes.
So lets get started!
\documentclass{beamer}
Now that line is straight forward, not much to say about it. Once that’s done, we have to choose a theme. This website gives a visual overview of the most common themes. I like Singapore:
\usetheme{Singapore}
Next, still in the preamble, we prepare the title page, using a similar set of commands as for other document-classes:
\title{Your Presentation Title} \author{The author} \date{February 4, 2011}
A frame
may have one or several slides. Since PDFs are static, dynamic “effects” such as adding more content to a frame are achieved by two consecutive slides in the output file.
We use the previously defined title page to create our first (single-slided) frame:
\begin{frame} \titlepage \end{frame}
Similar to articles, sections, subsections, etc. are available and can be used to define an outline, printed with \tableofcontents
. For many themes, the outline will be displayed in the header/footer and provides direct access to a certain section of the presentation. Frame-titles are created using \frametitle{Title}
.
Most of the time, a frame will show a list of items created through the well known itemize-environment:
\begin{frame} \frametitle{Title of the Frame} \begin{itemize} \item First item \item Second item \item ... \end{itemize} \end{frame}
Now what if you don’t want to show all the items at once, but one after another. The \pause
-command will take care of it. Just add it anywhere you want to “pause” and will produce 3 slides. In presentation mode, the next bit of information is only shown after you press a key (usually space or arrow keys). So the above code example now looks as follows:
\begin{frame} \frametitle{Title of the Frame} \begin{itemize} \item First item \pause \item Second item \pause \item ... \end{itemize} \end{frame}
Figures are used similarly as within other document-classes:
\usepackage{graphicx} ... \begin{figure} \includegraphics[scale=0.5]{img.jpg} \caption{Sample caption.} \end{figure}
Finally, I will show you something a little more advanced. Two columns, with items on the left and figures on the right side. The idea is to show an item along with an image. We want one item after the other to appear, while the image replaces the previous. Let me give you the code first and then explain some of the details:
\begin{frame}{A More Advanced Example} \begin{columns} \begin{column}{5cm} \begin{itemize} \item&<1-> Figure 1 \item&<2-> Figure 2 \item&<3-> Figure 3 \end{itemize} \vspace{2cm} \end{column} \begin{column}{5cm} \includegraphics<1&>[scale=0.1]{img1.jpg} \includegraphics<2>[scale=0.1]{img2.jpg} \includegraphics<3>[scale=0.1]{img3.jpg} \end{column} \end{columns} \end{frame}
What’s new here is called overlay specification within an environment (itemize) and lets you display different text/content on different slides or a range of slides.
<1->
indicates that this item will be displayed from slide 1 onwards in this frame. We could also have used <1-3>
. Whereas the actual figures will only be displayed on their specific slide, e.g. <1>
.
If there is no environment, the set of things to display has to be enclosed by the overprint-environment: \begin{overprint}...\end{overprint}.
Another thing is the “overlay specification” for commands, e.g. to change the text-color for slides 2 and 3:
\color<2-3>[rgb]{1,0,0} This text is red on slides 2 and 3, otherwise black.
Here, the overlay specification always has to follow the command before any additional arguments. I have to admit, slightly useless, but at least it illustrates the result nicely (example was taken from the user guide page 81).
The following a complete code sample with a few frames containing the various examples described above:
\documentclass{beamer} \usepackage{graphicx} \usetheme{Singapore} \title{Presentation Title} \author{The Author} \date{May 4, 2011} \begin{document} \begin{frame} \titlepage \end{frame} \begin{frame} \frametitle{Outline} \tableofcontents \end{frame} \section{List of Items} \begin{frame} \frametitle{List of Items} \begin{itemize} \item First item \pause \item Second item \pause \item ... \end{itemize} \end{frame} \section{Figure Example} \begin{frame} \frametitle{Figure Example} \begin{figure} \includegraphics[scale=0.1]{img1.jpg} \caption{Sample caption.} \end{figure} \end{frame} \section{Overlay Specification} \begin{frame} \frametitle{Overlay Specification} \begin{columns} \begin{column}{5cm} \begin{itemize} \item<1-> Figure 1 \item<2-> Figure 2 \item<3-> Figure 3 \end{itemize} \vspace{3cm} \end{column} \begin{column}{5cm} \includegraphics<1>[scale=0.1]{img1.jpg} \includegraphics<2>[scale=0.1]{img2.jpg} \includegraphics<3>[scale=0.1]{img3.jpg} \end{column} \end{columns} \end{frame} \end{document}
The packages hyperref, xcolor, color
are automatically loaded when using the beamer class.
A comprehensive user guide can be downloaded from CTAN.
K.Arun Kumar
In latex this is shown as error.explain.please send reply to my email id.please.
tom
Use math mode for everything and it works perfectly:
Cheers, Tom.