1. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Making presentations with LATEX
Using the beamer package
Suddhasheel Ghosh
Department of Civil Engineering,
Jawaharlal Nehru Engineering College
Aurangabad, Maharashtra
431003
LATEX for Technical and Scientiļ¬c Documents
January 12 - 16, 2015
Day IV
shudh@JNEC LATEX@ JNEC 1 / 27
2. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Outline
1 Layout
2 Multicolumn
3 Block styles
4 Subļ¬oats
Figures
Tables
5 Animations
shudh@JNEC LATEX@ JNEC 2 / 27
3. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
In this workshop:
Day 1: Introduction to LATEX
Day 2: Typesetting Mathematics
Day 3: Writing your thesis / technical report
Day 4: Make your presentations
Day 5: Basics of science communication
shudh@JNEC LATEX@ JNEC 3 / 27
4. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Outline
1 Layout
2 Multicolumn
3 Block styles
4 Subļ¬oats
Figures
Tables
5 Animations
shudh@JNEC LATEX@ JNEC 4 / 27
5. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Calling the class ļ¬le
Document setup
For making presentations, we use the beamer class. Our basic .tex
ļ¬le
documentclass{beamer}
title{My first presentation}
author{Suddhasheel Ghosh}
institute{JNEC}
begin{document}
begin{frame}
titlepage
end{frame}
end{document}
It can be seen that the āslidesā are called as āframesā here.
shudh@JNEC LATEX@ JNEC 5 / 27
6. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Set the themes
Broadly, there are the following kinds of themes in beamer
Layout theme
Font theme
Color theme
%in the preamble
%set the layout theme
usetheme{Warsaw}
%set the colour theme
usecolortheme{crane}
%set the font theme
usefonttheme{serif} %by default it is sans-serif
shudh@JNEC LATEX@ JNEC 6 / 27
7. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Set the logo
...to appear in the corner of every page
Do you have a logo to display? If the name of the image ļ¬le is
mylogo.png, place the logo at the corner of every page by using the
following
pgfdeclareimage[height=0.5cm]{college-logo}{logo.png}
logo{pgfuseimage{college-logo}}
shudh@JNEC LATEX@ JNEC 7 / 27
8. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Page number setting
Many themes do not have slide-number display capability. To insert
slide numbers use:
newcommand*oldmacro{}%
letoldmacroinsertshorttitle%
renewcommand*insertshorttitle{%
oldmacrohfill%
insertframenumber,/,inserttotalframenumber}
shudh@JNEC LATEX@ JNEC 8 / 27
9. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
A slide with the table of contents
For having a slide with the table of contents, we use
begin{frame}{Contents}
tableofcontents
end{frame}
shudh@JNEC LATEX@ JNEC 9 / 27
10. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
What we have achieved till now
Slide layouts
We created a LATEX ļ¬le
We have called the beamer class
We have deļ¬ned the theme, font theme, and the colour theme.
We have inserted the logo
We have inserted numbers at the bottom of the slides
We have created the ļ¬rst slide, the title slide
We have created the slide with the table of contents
shudh@JNEC LATEX@ JNEC 10 / 27
11. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
How did we typeset the last one?
The code is here
%start the coding for the frame - with the title
%and the subtitle
begin{frame}{What we have achieved till now}{Slide
layouts}
begin{itemize}
item We created a LaTeX{} file
item We have called the {tt beamer} class
item We have defined the theme, font theme, and the
colour theme.
item We have inserted the logo
item We have inserted numbers at the bottom of the slides
item We have created the first slide, the title slide
item We have created the slide with the table of contents
end{itemize}
%end the coding of the frame here
end{frame}
shudh@JNEC LATEX@ JNEC 11 / 27
12. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Outline
1 Layout
2 Multicolumn
3 Block styles
4 Subļ¬oats
Figures
Tables
5 Animations
shudh@JNEC LATEX@ JNEC 12 / 27
13. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
A two column slide
Can you design this?
Figure 1: A muggle artefact found in
the Dark Lordās bathroom
The investigator looked puzzled
when he visited the house of the
Dark Lord. He found a rubber
duck (Figure [1]) in the bathroom,
along with other suspicious
objects.
shudh@JNEC LATEX@ JNEC 13 / 27
14. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Designing the two column slide
The code is here!
begin{frame}{A two column slide}{Can you design
this?}
begin{columns}
begin{column}{0.5textwidth} %column width
begin{figure}
centering
includegraphics[scale=0.2]{duck.jpg}
caption{A muggle artefact found in the Dark Lord's
bathroom}label{fig:muggleduck}
end{figure}
end{column}
begin{column}{0.5textwidth}
The investigator looked puzzled when he visited the
house of the Dark Lord. He found a rubber duck
(Figure [ref{fig:muggleduck}]) in the bathroom,
along with other suspicious objects.
end{column}
end{columns}
end{frame}
shudh@JNEC LATEX@ JNEC 14 / 27
15. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Outline
1 Layout
2 Multicolumn
3 Block styles
4 Subļ¬oats
Figures
Tables
5 Animations
shudh@JNEC LATEX@ JNEC 15 / 27
16. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Text inside a block
Can you design this?
Deļ¬nition of a metric
The function d : X ĆX ā R is known as a metric if it satisļ¬es the
following properties:
Non-negativity: d(x,y) ā„ 0, āx,y ā X
Identity: d(x,y) = 0 āā x = y, āx,y ā X
Symmetry: d(x,y) = d(y,x)
Triangle inequality: d(x,z) ā¤ d(x,y)+d(y,z), āx,y,z ā X
shudh@JNEC LATEX@ JNEC 16 / 27
17. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Text in a block
The code is here!
begin{block}{Definition of a metric}
The function $d:X times X rightarrow mathbb{R}$ is
known as a metric if it satisfies the following
properties:
begin{itemize}
item {bf Non-negativity:} $d(x,y) geq 0, , forall
x,y in X$
item {bf Identity:} $d(x,y) = 0 iff x=y, , forall
x,y in X$
item {bf Symmetry:} $d(x,y) = d(y,x)$
item {bf Triangle inequality:} $d(x,z) leq d(x,y) +
d(y,z), , forall x,y, zin X$
end{itemize}
end{block}
shudh@JNEC LATEX@ JNEC 17 / 27
18. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations Figures Tables
Outline
1 Layout
2 Multicolumn
3 Block styles
4 Subļ¬oats
Figures
Tables
5 Animations
shudh@JNEC LATEX@ JNEC 18 / 27
19. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations Figures Tables
An array of ļ¬gures
Can you typeset this?
(a) Gull (b) Mouse
(c) Owl (d) Duck
Figure 2: Pictures of animals
shudh@JNEC LATEX@ JNEC 19 / 27
20. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations Figures Tables
An array of ļ¬gures
The code is here!
In the preamble:
usepackage{subfig}
And in the body, where you need to typeset / arrange the ļ¬gures,
begin{figure}
centering
subfloat[Gull]{includegraphics[width=0.25textwidth]{gull}
label{fig:gull}}
subfloat[Mouse]{includegraphics[width=0.25textwidth]
{mouse}label{fig:mouse}}
subfloat[Owl]{includegraphics[width=0.25textwidth]{owl}
label{fig:owl}}
subfloat[Duck]{includegraphics[width=0.25textwidth]{duck}
label{fig:duck_muggled}}
caption{Pictures of animals}label{fig:animals}
end{figure}
shudh@JNEC LATEX@ JNEC 20 / 27
21. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations Figures Tables
My ļ¬gures are not numbered
In the preamble, we should have the following
setbeamertemplate{caption}[numbered]
shudh@JNEC LATEX@ JNEC 21 / 27
22. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations Figures Tables
Multiple tables with subcaptions
Can you typeset this?
Judge 1 Judge 2
Karishma 8 9
Kareena 9 10
Katrina 10 8
(a) Femina Miss India
Judge 1 Judge 2
Akshay 8 9
Akshaye 9 10
Abhay 10 8
(b) Gladrags
Table 1: Table for scores in competitions
The scores of the contestants in the competitions are shown in
Table [1]. For women, the scores are in Table [1a] and for men in
Table [1b].
shudh@JNEC LATEX@ JNEC 22 / 27
23. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations Figures Tables
Multiple tables with subcaptions
The code is here
begin{table}
centering
subfloat[Femina Miss India]{
begin{tabular}{lcc}
hline
{} &Judge 1 &Judge 2 hline
Karishma &8 &9 Kareena &9 &10 Katrina &10 &8
hline
end{tabular}label{tbl:Women}
}
subfloat[Gladrags]{
begin{tabular}{lcc}
hline
{} &Judge 1 &Judge 2 hline
Akshay &8 &9 Akshaye &9 &10 Abhay &10 &8
hline
end{tabular}label{tbl:men}
}
caption{Table for scores in
competitions}label{tbl:score}
end{table}
The scores of the contestants in the competitions are
shown in Table [ref{tbl:score}]. For women, the
scores are in Table [ref{tbl:Women}] and for men
in Table [ref{tbl:men}].
shudh@JNEC LATEX@ JNEC 23 / 27
24. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Outline
1 Layout
2 Multicolumn
3 Block styles
4 Subļ¬oats
Figures
Tables
5 Animations
shudh@JNEC LATEX@ JNEC 24 / 27
25. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Appearance on click
Pseudo-animation
Judge 1 Judge 2
Karishma 8 9
Kareena 9 10
Katrina 10 8
(a) Femina Miss India
Judge 1 Judge 2
Akshay 8 9
Akshaye 9 10
Abhay 10 8
(b) Gladrags
Table 2: Table for scores in competitions
The scores of the contestants in the competitions are shown in
Table [1]. For women, the scores are in Table [2a] and for men in
Table [2b].
shudh@JNEC LATEX@ JNEC 25 / 27
26. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Appearance on click
Pseudo-animation
Judge 1 Judge 2
Karishma 8 9
Kareena 9 10
Katrina 10 8
(a) Femina Miss India
Judge 1 Judge 2
Akshay 8 9
Akshaye 9 10
Abhay 10 8
(b) Gladrags
Table 2: Table for scores in competitions
The scores of the contestants in the competitions are shown in
Table [1]. For women, the scores are in Table [2a] and for men in
Table [2b].
shudh@JNEC LATEX@ JNEC 25 / 27
27. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Appearance on click
Pseudo-animation
Judge 1 Judge 2
Karishma 8 9
Kareena 9 10
Katrina 10 8
(a) Femina Miss India
Judge 1 Judge 2
Akshay 8 9
Akshaye 9 10
Abhay 10 8
(b) Gladrags
Table 2: Table for scores in competitions
The scores of the contestants in the competitions are shown in
Table [1]. For women, the scores are in Table [2a] and for men in
Table [2b].
shudh@JNEC LATEX@ JNEC 25 / 27
28. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
Appearance on click
Pseudo-animation - typeset it here
begin{table}
centering
subfloat[Femina Miss India]{
begin{tabular}{lcc}
hline
{} &Judge 1 &Judge 2 hline
Karishma &8 &9 Kareena &9 &10 Katrina &10 &8
hline
end{tabular}label{tbl:Women}
} pause %<< look here
subfloat[Gladrags]{
begin{tabular}{lcc}
hline
{} &Judge 1 &Judge 2 hline
Akshay &8 &9 Akshaye &9 &10 Abhay &10 &8 hline
end{tabular}label{tbl:men}
}
caption{Table for scores in
competitions}label{tbl:score}
end{table}
pause %<< look here
The scores of the contestants in the competitions are
shown in Table [ref{tbl:score}]. For women, the scores
are in Table [ref{tbl:Women}] and for men in
Table [ref{tbl:men}].
shudh@JNEC LATEX@ JNEC 26 / 27
29. SU
D
D
H
ASH
EEL.CO
M
Layout Multicolumn Block styles Subļ¬oats Animations
In the upcoming sessions
Methods of science communication
Writing a paper or a thesis
Examples from literature
shudh@JNEC LATEX@ JNEC 27 / 27