This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

# Linux.com

Get Linux help

#### Special Offers

Get special offers on:

Linux
Application Dev
Programming
Software

Email:

## Feature: Office Software

### Basic presentations with LaTeX Beamer

By Bruce Byfield on November 08, 2007 (4:00:00 PM)

Since slide shows are graphical themselves, most people associate them with GUI programs. Yet you can build slide shows just as effectively with some of the simplest and oldest of GNU/Linux tools. A case in point is LaTeX Beamer, which adds extensions to the classic LaTeX typesetting program to produce PDF presentations. Although LaTeX Beamer is capable of considerable complexity, you need to know surprisingly little in order to produce a slide show.

By longstanding tradition, LaTeX is installed by default in major distributions. Beamer is not, although usually it is available as a package. However, until you come to compile your presentation, the documentation for the programs is more important to you than the programs themselves, although you might want to check their availability before you invest your time.

To begin working, create a folder for the presentation and place in it any graphics or other objects that you might want to use in the presentation. Producing the slide show will create a number of files, too, and keeping everything in one folder is the easiest way of keeping track of it all.

Open a text editor and enter the basic markup for a document, or use Kile, the graphical editor for LaTeX, which includes a Beamer document template. The basic structure is:

\documentclass{Beamer}
\title{text}
\author{text}
\date{date}

\begin{document}

\end{document}


Even if you are new to LaTeX, this basic structure should be self-explanatory. The first line declares the type of document, just as in an HTML file, and gives the file access to Beamer's resources. The next three lines give basic information about the presentation, which Beamer can pick up automatically while compiling. Depending on how customized your presentation is, you may be adding more structure in these sections. The actual content of the presentation is entered between the begin and end tags of the document.

However, before you start entering content, you need to add slides. Your first slide is probably a title page, whose structure is:

\begin{frame}
\titlepage
\end{frame}


\section*{Outline}
\begin{frame}
\tableofcontents
\end{frame}


The section is declared so that you can automatically generate the table of contents. The asterisk indicates that this page should not be included in the table of contents when it is generated. Other pages you want included will have their own sections. In effect, the section's name serves as the title of the slide.

The rest of the slides in the program have a similar structure. For instance, the third slide might be defined as:

\section{Introduction}
\begin{frame}
\frametitle{titletext}
\end{frame}


#### Entering content on slides

As you might expect, you enter content between the begin and end tags for each frame. If you choose, you can simply start typing. However, if you want to follow the slide show tradition of putting points in bullet form, you can use this structure:

\begin{itemize}
\item
\end{itemize}


\item
tags as necessary.

If you want a graphic in PNG format, then enter:

\begin{center}
\includegraphics{filepath}
\end{center}


LaTeX also supports other graphical formats, such as EPS or JPEG. If you place all of the slide show's graphics in the same folder, as suggested, then the file path needs to include only the file name. You can also change the alignment of the graphic by replacing "center" with "left" or "right" as appropriate.

In addition to text and graphics, you also can include other structural elements in LaTeX, including formulas, numbered lists, tables, hyperlinks, font sizes, and multiple column layouts for individual frames. With LaTeX, you have an entire document layout program available for your presentations. However, defining some of these structures, such as tables, can be challenging no matter what your level of expertise, since you are working non-graphically. Therefore it's a good idea to constantly convert your presentation to PDF as you work, to see whether you have made any mistakes. More on how to export the presentation in a moment.

#### Basic customizations

Once you are comfortable with the basics of structuring a slide show and adding slides, you can customize the look and feel of your presentation.

One especially useful customization is to use \pause to break up content on a slide, revealing the material below only as you advance. This tool is useful for revealing bullet points one at a time, or for concealing the answer to a question until you are ready to display it.

In addition, Beamer includes optional themes for backgrounds that you can define by adding \usetheme{themename} below the document class declaration at the beginning of the file. You can also define color themes (\usecolortheme{themename}), font themes (\usefonttheme{themename}), inner themes for everything on a frame or slide (\useinnertheme{themename}), and outer themes for slide borders and headers and footers (\useoutertheme{themename}). All these themes are stored in a Debian system in subfolders of /usr/share/textmf/tex/latex/Beamer/themes, and in a similar location in other distros.

Not only can these themes be mixed and matched, but they can be individually customized as well. For example, you could set the font for the title of slides to use Times Roman with \setBeamerfont{title}{shape=\itshape,family=\rmfamily}. In short, so long as you have the patience to learn, Beamer lacks little found in a conventional presentation program like OpenOffice.org's Impress -- except, perhaps, convenience.

#### Compiling and using the presentation

When you are finished designing your slide show and adding its content, save the file with a .tex extension, then run the command pdflatex filename to prepare your show. If you are using Kile, you can perform the same operation by selecting Build -> Compile ->PDFLaTeX. Either way, the pdflatex command produces a log of the operation, which you can use to troubleshoot, as well as the PDF output file, both of which are located in the same directory as your .tex file.

To run the presentation, open the file in the PDF viewer of your choice, with the window maximized and the zoom set as high as possible. An especially good PDF viewer is Evince, which has both a full-screen and a presentation mode. With other PDF viewers, your audience may notice the presence of navigation bars and menus, but otherwise, your Beamer-produced presentation should pass muster as well as any slide show without sound. It might even gain points for the originality of its slide design.

#### Conclusion

How much you want to learn about Beamer depends on your needs. The program includes a thorough manual that not only steps you through a sample presentation, but also gives concrete advice about workflow when planning and designing a presentation. You can even learn how to add notes and handouts to your presentations from it.

You can think of working with Beamer as a throwback to the earliest days of free operating systems. You might not want to use Beamer all the time, but there's something satisfying about working in this way -- if only the feeling that, by the time you've produced your first presentation, you've learned more about your operating system.

Even without going deeply into the arcana of LaTeX and the programs related to it, you can still learn enough to produce a respectable slide show -- proving yet again, as GNU/Linux often does, that command-line tools can still match the results of desktop tools, if only you can accustom yourself to the change in perspective.

Bruce Byfield is a computer journalist who writes regularly for Linux.com.

on Basic presentations with LaTeX Beamer

Note: Comments are owned by the poster. We are not responsible for their content.

#### Basic presentations with LaTeX Beamer

Posted by: Ian Mackenzie on November 08, 2007 04:31 PM
Beamer is great, and I would hardly call it a 'throwback' - I do use it for all of my presentations now. Just like using LaTeX for reports, I find that using LaTeX/Beamer for presentations means that the end result is generally a lot more structured and consistent. You can do things like define variables for the widths of your text and image columns, and if you want a bit more space for text, just change the two variables and the two columns will change consistently throughout the presentation (no more manual resizing of images to get them to look approximately the right size). Automatic outlines and tables of contents (with hyperlinks), LaTeX's excellent equation support, the ability to change styles and fonts throughout the presentation by editing a simple line, the ability to use all the other tools designed for LaTeX...Beamer has a lot to recommend it.

#### Basic presentations with LaTeX Beamer

Posted by: Anonymous [ip: 159.238.13.55] on November 08, 2007 04:32 PM
If you would like to know even less about the class, but still use it, and use it to its fullest, use Lyx. It will use this class. I just tried it on Debian Etch.

#### Re: Basic presentations with LaTeX Beamer

Posted by: Anonymous [ip: 68.48.11.159] on November 08, 2007 08:09 PM
I'd like to second Lyx - it's a fantastic tool, and takes (most of) the pain out of learning LaTeX.

#### Basic presentations with LaTeX Beamer

Posted by: Anonymous [ip: 130.101.7.192] on November 08, 2007 08:04 PM
Beamer is awesome. I have made so many people throw away powerpoint because of latex-beamer. Also as pointed out Lyx frontend is the best for beginners.

#### Backgrounds link does not work

Posted by: Anonymous [ip: 59.101.4.56] on November 08, 2007 09:34 PM
I get this:

Attention!

The album or photo that you were attempting to view either does not exist, or requires user privileges that you do not posess. Log in and try again.

#### Basic presentations with LaTeX Beamer

Posted by: Anonymous [ip: 71.192.136.81] on November 09, 2007 05:54 AM
For presentation tools, try keyjnote:
http://keyjnote.sourceforge.net/news.php
That is, if you've got an OpenGL enabled, 3D accelerated linux rig.
Finally 3D acceleration for work!

Posted by: Anonymous [ip: 41.195.70.101] on November 09, 2007 05:55 AM
The output is PDF, does that mean no transitions?

Posted by: Anonymous [ip: 203.171.68.253] on November 09, 2007 09:05 AM
No, pdf can do transitions. I'm not 100% sure, but I think you can stipulate them in the beamer file. And as far as I recall (I'm too lazy to check any of this!) you can set transitions in the evince and acroread preferences dialogs.

#### Basic presentations with LaTeX Beamer

Posted by: Anonymous [ip: 138.232.136.102] on November 09, 2007 01:02 PM
it can do transitions, check out the examples on http://latex-beamer.sourceforge.net/

#### Basic presentations with LaTeX Beamer

Posted by: Anonymous [ip: 75.152.158.77] on November 11, 2007 12:42 AM
Although I prefer the POWERDOT class, I've used beamer and was quite pleased. Its learning curve is steeper, but it's very rich.
And yes -- LyX is superb.