LaTeX/C3/Beamer-Themes-and-Animation-in-LaTeX/English

From Script | Spoken-Tutorial
Revision as of 17:40, 8 December 2021 by Pravin1389 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Title of the script: Beamer Themes and Animation

Author: Preeti Bamane

Keywords: Video tutorial, TeXWorks, Ubuntu Unicode, Beamer Themes, Color themes, Overlays


Visual Cue
Narration
Slide: Hello and welcome to the spoken tutorial on Beamer Themes and Animation
Slide: Learning Objectives In this tutorial, we will learn to,
  1. Use Beamer themes
  2. Do text animations using Overlay
Slide 3: System Requirements This tutorial is recorded using
  • Windows 11 and
  • TeXworks editor v0.6.

The steps demonstrated will work in all operating systems.

Slide 4: Prerequisites
  • To practise this tutorial, you should be familiar with LaTeX commands.
  • You should also know how to create a presentation using Beamer.
  • If not, then go through the prerequisite LaTeX spoken tutorials on this website.
Slide 5: Code Files
  • The files used in this tutorial are available in the Code files link on this tutorial page.
  • Please download and extract the files
  • Make a copy and use them for practising.
Slide: Demonstration For this demonstration, I will be using the Beamer theme Matrix.

The same is available at this link:-

https://hartwork.org/beamer-theme-matrix/

Open a web browser and go to this URL.

[Firefox] Show the beamer page

Navigate row-wise on the left

Navigate column-wise on the top

Hover the mouse on any one of the theame

Theme matrix shows various themes and color theme combinations included with the Beamer class.

The rows of the matrix show the list of the different Beamer themes.

The columns of the matrix show the list of the different Beamer color themes.

When the cursor is placed over an image, it shows the corresponding theme and color theme.

Go to Downloads folder >> Beamer-Code-Files Go to the folder where all the Code files are downloaded on your machine.
Open beamerThemesAndAnimation.tex in TeXworks Open the file beamerThemesAndAnimation.tex in TeXworks editor.

We will see some LaTeX code written in the file.

Let’s try to understand the code.
Highlight: \usetheme{Warsaw} \usetheme{Warsaw} is added to the preamble to use the Warsaw theme in Beamer.


Warsaw theme displays a header on the pdf slide.

Highlight: \section and \subsection In the document, I have inserted the \section and \subsection before each frame begins.
Highlight the section and subsection names The section and subsection names will be displayed in the header of the slide.
At the top left drop-down >> select pdfLaTeX At the top left, in the drop-down select pdfLaTeX, if not already selected.
Click on the green arrow button Then click on the green arrow button to compile the file.


Compile the file once again to update the theme.

Point to the pdf output On compilation, we get the pdf output with the Warsaw theme.
Highlight the header


Highlight the section names

In the slide, we can see a header.


It says Beamer Themes and Introduction, one below the other.

Highlight the section names in the TeXworks file. These are the names we defined in the sections.
Point to the green right arrow in the output window In the output window, go to the next slide using the green-coloured right arrow.
Point to the top section.


Click on “Color Themes

Look at the header portion of the pdf slide.


Section name “Beamer Themes” is seen on the left banner.


And the subsection name “Themes” is seen on the right banner.

Highlight the section and subsection names in the TeXworks file. These are the names we defined in the sections and subsections.
Highlight the section or subsection names. You can go to any slide by clicking on the section or subsection names.
Click on Color Themes Click on Color Themes on the top right banner.
Point to the pdf output

Slide: Beamer Themes Color Themes

The respective section name and subsection name of the slide you are on, get highlighted.


In my case, Beamer Themes and Color Themes get highlighted.

Point to the pdf output

Slide: Introduction

Let’s click on Introduction.


We are directed to the Introduction slide.

Only Narration So, this part sort of behaves like a navigation panel.
Back to beamerThemesAndAnimation.tex Let’s go back to the code.
[TeXworks] Beamer themes can be combined with a color theme.
[TeXworks] Type:

\usecolortheme{beaver}

To do so, before the begin document command, type the code as shown.
[TeXworks] Highlight


\usetheme{Warsaw}

\usecolortheme{beaver}

Always put the \usecolortheme command below the \usetheme command.
Compile twice Now compile the file twice.
Point to the pdf output


Observe the output.


colortheme command changed the color used for different elements.


Let’s go back to the code.

[TeXworks] Update


\usetheme{Madrid}

\usecolortheme{crane}

Let’s try another theme and theme color.


Update the \usetheme and \usecolortheme as shown.

[TeXworks] Highlight


\usetheme{Madrid}


\usecolortheme{crane}

I have set the theme to Madrid and the colortheme to crane.
Compile twice Compile the file twice.
Point to the pdf output We can see the generated pdf output.


It has the Madrid theme along with the crane colortheme.

Next, we will see how to add Text Animation on the slides.
Slide: Overlays
  • Overlay is a term used by the Beamer document class to describe the layering of slides.
  • There are a number of commands that enable us to use overlays on text.
Only narration Let’s see important overlays one by one.


Switch to the text editor.

[TeXworks] Update the code:


\section{Animation}

\subsection{onslide command}

\begin{frame}

\frametitle{Overlay: onslide}

\onslide<1->{First Line of Text} \\

\onslide<2->{Second Line of Text} \\

\onslide<3->{Third Line of Text}

\end{frame}

Replace the document section code as shown here.



[TeXworks] Highlight


\onslide<number->

The number inside the angle brackets tells LaTeX which slides the item should appear on.


hyphen is used for continuation.

Compile On compilation, we get the output as seen here.
Point to the pdf output

Slide: Animation on onslide

In the generated pdf, click on the green right arrow to go to the next page.


Observe that our three lines of text are appearing one by one in a sequential order.

Back to beamerThemesAndAnimation.tex Switch to the editor once again.
[TeXworks] Type:


\setbeamercovered{transparent}

Let’s make the text transparent on an unspecified slide.


Next to the line \frametitle type the code as shown here.

Compile Compile the file.
Point to the pdf output Observe the output.


The upcoming slide texts appear as transparent text.

[TeXworks] Type:


\subsection{uncover command}

\begin{frame}

\frametitle{Overlay: uncover}

\setbeamercovered{transparent}

\uncover<1> { First Line of Text} \\

\uncover<3> {Third Line of Text} \\

\uncover<2> { Second Line of Text} \\

\uncover<5> {Fifth Line of Text} \\

\uncover<4> {Fourth Line of Text}

\end{frame}

In the tex file, before the \end{document} command type the code as shown here.



[TeXworks] Highlight:


\uncover<1>

Observe that here we have used \uncover instead of \onslide.


\uncover is with a digit present within angular brackets.


This will display the text on the slide depending on the number given here.


Notice that, here we have also changed the order of appearance of the text.

Compile Compile the file
Point to the pdf output

slide: Animation \uncover command

Using the navigation arrow, go to the slide Animation \uncover command.


Here only one out of five line items is appearing on the slide and the rest are transparent.


When you further navigate, it displays the third item instead of the second item.

[TeXworks] Highlight


\uncover<3> {Third Line of Text} \\

\uncover<2> { Second Line of Text} \\

This is because in the code the third item is mentioned as the second item.


And the second item is mentioned as the third item using the \uncover command.

[TeXworks] Type:


\subsection{only command}

\begin{frame}

\frametitle{Overlay: only}

\only<1>{First Line of Text}

\only<2>{Second Line of Text}

\only<3>{Third Line of Text}

\end{frame}

In the tex file, before the \end{document} command, type the code as shown here.



[TeXworks] Highlight


\only<>

The command \only works exactly like the \uncover command.


The only exception is that it does not reserve any space for the hidden text.

Compile Compile the file.
Point to the pdf output

slide: Animation \only command

Go to the slide Overlay: only command.


While navigating to the right, we can see only the respective item, and not the other items.


Also, all the items are appearing in the same line.

This is how we can customize LaTeX slides as per our requirement.
Only narration With this, we have come to the end of this tutorial.

Let us summarize.

Slide: Summary In this tutorial, we have learnt to:
  • Add Beamer themes and color themes
  • Do text animations using Overlay


Slide: Assignment As an assignment,
  • Add a new beamer theme Hannover and
  • Color theme seahorse
  • To the file beamerThemesAndAnimation.tex
Slide: About Spoken Tutorial Project
  • The video at the following link summarises the Spoken Tutorial project.
  • Please download and watch it
Slide: Spoken tutorial workshops
  • We conduct workshops using spoken tutorials and give certificates.
  • For more details, please write to us.
Slide: Forum questions Pls post your timed queries in this forum
Slide: Acknowledgement Spoken Tutorial Project is funded by the Ministry of Education (MoE), Government of India
Slide The script was contributed by Preeti, FOSSEE Summer Fellowship 2019

And this is Praveen signing off.

Thanks for joining.

Contributors and Content Editors

Pravin1389