Introduction to Beamer

[This article was first published on We think therefore we R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

A friend of mine, who is quite smart by the way (she is a PhD. student in Physics at Cambridge), recently asked me for some help with Beamer. Well most of my knowledge and code came from Utkarsh when I had started about a year ago. Initially, I had just asked him for some help with Ubuntu, then a little bit with R, and then some with LaTeX, followed a bit by Python. This was all accompanied with constant questions from my side regarding mathematics, programming, web scarping, regular expressions etc. Most of the times he ended up writing the entire code for me. Though this was more or less like spoon-feeding a kid, he made it a point to ensure that I understood what the code was doing. After writing a lot of code for me and fixing a lot of bugs in the code that I wrote, I finally started to get some confidence while writing my own scripts. A year later I realize that much of teaching much did not emphasize that I get the “grammar” of script right, but that I got the “approach” of the script right. To be more clear, it’s more important to know exactly what we want are trying achieve through the code rather than the way to do it. If you know what you want, you’ll figure out a way to get it.

Well, when my friend asked for some help with Beamer, I didn’t know how to exactly go about it. Should I forward her some documentation that I have stored in my computer which I never read myself? Well, I did do that. But the idea was a bit discomforting. Also, all the time that Utkarsh spent with an idiot like me should not go waste. So I tried to recollect some of the things that he taught me, scrapped through some of my beamer presentations that I had made in college and organized it into a TeX document.

Hope it helps…

% This is a very humble attempt to introduce fellow students to amazing world of LaTeX, and more specifically Beamer.
% This by no means is a guide or a reference manual for Beamer. It is simply a beginning. If you are planning your first presentation, this should serve the purpose and at the same time arouse curiosity to delve deeper.
% Also, I would like to point out that most of the code here has been acquired from various secondary sources and are not
% my creation. I have just assembled some information that I have into a organized document. I sincerely thank all those creative individuals you were generous enough to share their solutions with the world.

\usepackage{subfigure} % This package is a very neat way to accommodate more than one graphic on one slide. A sample command is included for reference.

% Typically, the itemize enviroment does not provide adequate space between bullet points
% and hence can look a bit cluttered at times. The new “wideitemize” problem solves this issue.
% To use it just put your regular “\item” between “\begin{wideitemize}” and “\end{wideitemize}”

\hypersetup{% This can be left blank if information is not available
pdfauthor = {Author’s name},
pdftitle = {Title for the pdf file},
pdfsubject = {},
pdfkeywords = {},
pdfcreator = {LaTeX with hyperref package},
pdfproducer = {dvips + ps2pdf}}

\mode % This is a representative list of themes available is Beamer.        Shreyes prefers the Warsaw theme,  I prefer Pittsburg; it’s much neater. 
                                   Also, CambridgeUS is quite popular among academics.
      \setbeamercovered{transparent = 28}


\title{Sample Presentation}
\author{Author} \institute{My Institute}

\setbeamertemplate{footline}[frame number] 
% This shows the slide number at the bottom of the page. May or may not be required depending on the theme you use.

% This disables the navigation button in the lower right corner of the generated pdf file.

\begin{frame} % Just so we are clear, a frame here means a slide.

\AtBeginSection[] % This will display the list of contents before the beginning of each section

\begin{frame} % You can use this if you just want the list of contents to be displayed once at the beginning.


      \frametitle{A simple sample frame}
                 \item Point 1
                 \item Point 2
                 \item Notice the space between the points.
                 \item Comparatively, more generous than the    normal “itemize” enviroment
                \item Also, the sequential appearance of points is handeled with \textbackslash pause command.

\section{Part I}

\begin{frame}{Frames you can replicate} % You can include the frame title here as well.
            \item 1
            \item 2
            \item 3
            \item 4
            \item 5

\begin{frame}{Another one you can replicate} % This one uses wideitemize
            \item 1
            \item 2
            \item 3
            \item 4
            \item 5

\begin{frame}{Nested environments}
             \item This is wideitemize environment
             \item You can nest environments to formulate a 
hierarchical structure
              \item See below

                       \item This is itemize
                       \item Notice the space between bullets
                       \item The bullets can be changed to number using the enumerate environment
                       \item \LaTeX is cool
                       \item I am glad you chose to give it a
                       \item It will change the way you work


\section{Part II}

\begin{frame}{subfigure example}
            \subfigure[Figure 1]{
            \label{model1}}  % Try putting labels for every figure, table, and equation. It will become easier to navigate if the document is huge.           
            \subfigure[Figure 2]{

\begin{frame}{Math in \LaTeX}
          \item Use the “align” or “gather” environment for math
             \item They are neater
             \item You can also use the “equation” and “eqnarray” envrionments
             \item Also, notice that this is the enumerate environment
             \item Hence the numbers instead of bullets

                  {\huge Thank you} % Huge makes the text size, well, Huge
                  Author name and contact


To leave a comment for the author, please follow the link and comment on their blog: We think therefore we R. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)