LaTeX: The LaTeX Beamer Class

This tutorial will take you a little more deeper into interesting tools. The beamer class is a very nice feature of that will enhance your skills more and more. We will discuss it here as a starting point for you but later on you can add on your knowledge through simple internet search.

Presentation is one of the most effective means of communication for a small audience with diverse backgrounds. Both in the industry and the academia, it is becoming increasingly important to create affective and compelling presentations. Not surprisingly then, the presentation tool you use becomes very important in the work place.

The beamer class is a LaTeX class that allows you to create a beamer presentation. It can also be used to create slides. It behaves similarly to other packages like Prosper, but has the advantage that it works together directly with pdflatex, but also with dvips. Once you have installed the beamer class, the basic steps to create a beamer presentation are the following:

  • Specify beamer as document class instead of article.
  • Structure your LaTeX text using \section and \subsection commands.
  • Place the text of the individual slides inside \frame commands.
  • Run pdflatex on the text (or latex and dvips).

The beamer class has several useful features: You do not need any external programs to use it other than pdflatex, but it works also with dvips. You can easily and intuitively create sophisticated overlays. Finally, you can easily change the whole slide theme or only parts of it.

In the beginning we have to talk a little bit about what makes a good presentation? (Note: We are not talking now about the public speaking aspect, only the presentation aspect; that is the slides themselves).

  • Using images.
  • Not using too much text.
  • Using Bullets (not more than 5/6 per slide).
  • Never use complete sentences (Just Buzz words)
  • Keep the slides consistent.
  • Do not use fancy animations.

And if we look at an important question which is what makes a presentation tool good?

  • Should take care of the content. The tool should worry about the presentation.
  • Includes fonts, layouts, indentation, colors, spacing, etc.
  • Routine stuff should be really easy, sophisticated stuff should be doable.
  • Discourage bad practices for presentations by design.
  • Portable -- work in a cross platform fashion.

Now, we need to get back to our real question, Why LaTeX Beamer?

With LaTeX, Beamer makes it easier than ever to put mathematical formulae and all kinds of symbols in your presentations, embed images, make tables and do everything else that you can do with latex. Since many of us already use latex, it means there are fewer tools to learn -- I can make my presentations in a language that I'm already familiar with! And I do not need any bulky tool to manipulate my presentation; just a text editor is enough.

  • It is PDF, meaning that animation can be done via .PDF format, so if you do an animation in PowerPoint for example and convert it to .PDF format you will lose all your animations.
  • Portable! Latex runs on all major operating systems and architectures out there. Once you get a PDF from Latex, you can display it using any regular PDF viewer. Also takes care of the layout.
  • Themes are endlessly customizable.
  • Notes and handouts made the way you want them.
  • Organize your presentation in a logical manner: beamer sort of follows the MVC philosophy. In each presentation, there is a content structure, which determines how your content flows through (just like a regular article with sections and subsections).

There is a slide structure, which determines how this content fits onto your slides. The content structure controls the generation of navigations and table of contents. The slide structure controls the slides and the control flow between them.

The next step have a small tour into how basic presentation slides could be done using the LaTeX Beamer class. As we move on we will see how we can enhance our design and structure of these slides.

A typical Beamer document looks pretty much the same as a regular LaTeX document. However, a presentation commonly consists of slides, which are called frames in LaTeX beamer. Therefore a normal latex beamer document will look something like this:

\documentclass{beamer} \begin{document} \frame{frametitle{Table of contents}\tableofcontents} \frame{frametitle{XXX}} \frame{} ... \frame{} \end{document}

"My title page", normally when you are preparing for a presentation the first thing you think about after the content of course, is your title page. What do you want to include in it, may be your name, your institutions name, etc.

In LaTeX Beamer there is always a way for these main things that you need in a presentation. So, if you would like to make your title page using Beamer and you would like this slide to be your title page, all you have to do is the following:

\documentclass{beamer} \begin{document} \title{Simple Beamer Class} \author{myName} \institute{German University in Cairo} \date{\today} \frame{\titlepage}

Now, this should give you your title page with "Simple Beamer Class" as your title and "myName" as the name of the presenter for example and "German University in Cairo" as the institute and beneath all of them the date, which is when you compiled your LaTeX file.(For a clearer look, see attached beamer_one.pdf file).

After finishing your title page, you now need to do your organized set of slides. Organization can be expressed in a table of contents for example that holds the sections and subsections of your presentation, which can be implemented as:

\frame{\frametitle{Table of contents}\tableofcontents}

Afterwards, you can define your sections and subsections as follows, knowing that they are automatically generated into your "Table of contents" slide as follows:

\section{Section 1} \frame{ \frametitle{Title} Each frame should have a title. } \subsection{Subsection 1.1} \frame{ Without a title something is missing. }

We will look now at some other important features of structuring your beamer document.

For structuring your slides, sometimes you need to make some bullets of-course, which is feasable in the beamer class. You have the choice of either using numbered lists or unnumbered lists. We will look now at the unnumbered lists:

\section{Section 2} \subsection{Lists I} \frame{\frametitle{Unnumbered lists} \begin{itemize} \item Introduction to \LaTeX \item Termpapers and presentations with \LaTeX \item Beamer class \end{itemize} }

Another nice way to represent your bullets in a slide is by using the \pause command, which shows you one point at a time. As follows:

\frame{\frametitle{Lists with pause} \begin{itemize} \item Introduction to \LaTeX \pause \item Termpapers and presentations with \LaTeX \pause \item Beamer class \end{itemize} }

You can also check other commands that do the same functionality on your own, like the \uncover command.

We took a look on how to use unnumbered lists. Now for the usage of numbered lists; you will need to remind yourself by the \begin{enumerate} command from your first TeX document, we can use the following

\section{Section 2} \subsection{Lists II} \frame{\frametitle{Numbered lists} \begin{enumerate} \item Introduction to \LaTeX \item Termpapers and presentations with \LaTeX \item Beamer class \end{enumerate} }

Remember that you can also use the \pause command exactly as used before in order to make the numbered points appear one by one.

So, Are you bored yet? Well, for the ones who are not bored yet, you can take a look at what this coming part talks about. It will give you some nice hints for doing tables and different kinds of blocks of data.

In order to define a table in your beamer file, well, it is fairly simple. All you have to do is to define like any other table, rows, columns and contents. In LaTeX Beamer, you can do the following for example to define your table:

\begin{tabular}{|c|c|c|} \hline \textbf{Date} & \textbf{Instructor} & \textbf{Title}\\ \hline WS 04/05 & Slim Abdennadher & First steps with \LaTeX \\ \hline SS 05 & Slim Abdennadher & \LaTeX \ Course serial \\ \hline \end{tabular}

Let us examine the above code sample and explain it thoroughly. Our first line as easy as it appears it begins a tabular which is our table. The {|c|c|c|} command defines to us that we are using a 3 column table with vertical borders in the beginning, the end and in between each column (The borders are using the "|" key). As for the \hline command, this is used to define the horizontal borders between each row. Of course, I am assuming that you already know that the "\\" command starts a new line in LaTeX or in our case here, starts a new row. For the contents of the table we have our first row consisting of each column header. So, basically we are defining the contents row by row and separating what is in the columns by "&" sign.

A Question to the reader!

Do you know how to make a table without vertical borders? What about horizontal ones?

Remember that we can always use our \pause command in order to show our table items one by one instead of showing them directly, as follows:

\begin{tabular}{c c c} A & B & C \\ \pause 1 & 2 & 3 \\ \pause A & B & C \\ \end{tabular}

The "beamer blocks" are one important part in our presentation. The blocks are either normal blocks that can include a bulk of data. They appear as ordinary black colored text with a blue title, if they are normal blocks. Another kind of blocks are the example blocks that appear in a black colored text but with green colored titles and the alert blocks are also another type of blocks that have a black colored text but with red colored titles. We can see how easy we can define our blocks:

\begin{block}{Title of the block} This is a normal block text \end{block} \begin{exampleblock}{Title of the block} This is an example block text \end{exampleblock} \begin{alertblock}{Title of the block} This is an alert block text \end{alertblock}

You can see the output of the previous code sample in the attached beamer_one.pdf file. You will also find a beamer_one.tex file where you can easily take as your starter file and edit to see what could happen if you change in the document.

Congrats! Now you're ready to start your first beamer document. Now try it out and the next time you have a presentation to prepare, make it your first choice.

We have discussed in this tutorial, what is the LaTeX Beamer Class and why do we need it. We then explained how to begin with Beamer and how to make your first slides (Title page, numbered/unnumbered lists, tables and Blocks). For more details on our tutorial, you can either check our references or you can check the "beameruserguide.pdf" file, which is a very comprehensive reference that you will also find attached.

The next tutorial, will take you through the basics of bibTeX which helps in formatting the documents in a way simple enough for citations, reordering and referencing. A lot of the nice features of bibTeX will be discussed thoroughly in the next tutorial.

If you would like your slides to look nicer, just check the Beamer header folder for more themes (Hint: Use the \usepackage{XXX} command). Another nice feature is how you can include pictures in your beamer document (Hint: Use the \includegraphics{XXX} command), or you can check the corresponding tutorial. Graphics tutorial.

RenewSession