This five-part series of articles uses a combination of video and textual descriptions to teach the basics of creating a presentation using the LaTeX beamer package. These tutorials were first published on the original ShareLateX blog site during August 2013; consequently, today's editor interface (Overleaf) has changed considerably due to the development of ShareLaTeX and the subsequent merger of ShareLaTeX and Overleaf. However, much of the content is still relevant and teaches you some basic LaTeX—skills and expertise that will apply across all platforms.

In the previous post we looked at adding some basic content into our presentation. In this post we're going to look at adding some other types of content.

Blocks

One of the ways beamer lets us display information on slides is using 'blocks'. To do this we use the block environment:

At the end of the \begin{block} command we simply enter the block's title in curly brackets. Then whatever we enter in between the \begin{block} and \end{block} commands, forms the content of the block. This is what it looks like:

There are quite a few variations of the block environment that help us produce blocks for different purposes. The first is the alertblock>/code> environment which is similar to the <code>block environment except its colour is red instead of blue:</code>

The theorem and corollary environments automatically put their content in italics. These two also allow us to add extra content to the block title in parenthesis by adding text into square brackets at the end of the \begin{...} command. It's worth mentioning at this point that beamer automatically loads the amsmath package so you can add more complicated mathematics straight away.

Code

Now let's talk about adding code into slides. This is particularly important for any computer science related presentation. To do this we use the semiverbatim environment. In order to use this environment on a frame, we need to add the fragile<code> option into the <code>\begin{frame} command. Now whatever text we enter in the environment will appear as written, except for the backslash, open curly bracket and close curly bracket characters, which will continue to behave as they normally would in LaTeX; therefore, if we want to print some code which includes these characters we need to add an extra backslash before each of them. Here's an example printing the code we used for the title slide:

Hyperlinks and buttons

Finally, I want to discuss adding hyperlinks to our presentation. Before we can create any hyperlinks we need to tag the frames we want to link to using the \label command; for example, we'll add a label to the contents frame, the columns frame and the pictures frame:

\begin{frame}\label{contents}
...

Then we use the \hyperlink command to insert a link:

\hyperlink{contents}{click here}

In the first set of curly brackets we enter the label of the target frame and in the second set we add the text that we want to be clickable.
Now if we compile the document you'll see the text is now a clickable link.

Beamer also allows us to use buttons. To do this we simply add a button command into the second set of curly brackets. For example, we'll swap the "click here" text for the \beamerbutton command and enter in curly brackets the text we want to appear on the button: