I have seen presentations in Power Point which contain a timer. Can this be done in Beamer using a simple command, or maybe a package? If not a timer, is it possible to at least get a clock on your slides?
[Tex/LaTex] way to add a timer to a Beamer presentation
beamerdatetime
Related Solutions
I use beamer
for my lecture notes. A course will generally be one semester with 28 lectures, each 2hrs. As I do the full lecture as a presentation, a typical lecture can run to 100 pages in the PDF (maybe 20 frames). I keep all the lectures for a course in a single file for ease of consistency and the like.
Beamer provides "lectures" to break up a course. These are detailed in Section 10.4 of the manual. You can use the \AtBeginLecture
command to insert a lecture title page.
The main problem with this is that in the normal course of things, TeX still processes the entire document but only outputs the frames corresponding to that lecture. This, for me, was a bit ridiculous as I have a lot of stuff and some of it is a bit heavy on the processing. Fine for the lecture concerned, but not for all the other lectures. So I did a bit of hacking, and came up with a system whereby beamer would skip over all of the stuff not in the current lecture. The idea is that certain of the beamer \mode
commands would send TeX into a gobbling state so for the lectures we don't want, we go into that state. We merely reemerge each time a lecture is declared to check if it is the one we want or not.
In my lecture TeX file, each lecture starts with:
\mode
<all>
\lecture{Complex Numbers}{2012-01-10}
the first two lines take it out of gobbling mode. In one of my personal packages, I have the code:
\g@addbefore@macro\beamer@atbeginlecture{
\begin{frame}[plain]
\LectureTitlePage
\end{frame}
\lecturemode
\newtheoremstyle{my@style@rmk}{3pt}{3pt}{\upshape}{}{\bfseries}{}{.5em}{}
\newtheoremstyle{my@style@def}{3pt}{3pt}{\upshape}{}{\bfseries}{}{.5em}{}
\newtheoremstyle{my@style@thm}{3pt}{3pt}{\upshape}{}{\bfseries}{}{.5em}{}
}
This adds a title page to every lecture, executes something called \lecturemode
, and sets up theorem, definition, and remarks correctly (don't remember why I do that here and not at the start of the document). The lecture title page command is defined as:
\newcommand{\LectureTitlePage}{%
\setcounter{framenumber}{0}
\global\def\inserttitle{{Lecture \insertlecturenumber: \insertlecture}}
\global\def\insertshorttitle{{Lecture \insertlecturenumber: \insertlecture}}
\global\def\insertdate{\lecturedate}
\global\def\insertshortdate{\lecturedate}
\titlepage
}
So it co-opts the normal beamer title page, setting the parameters to the correct values for the lecture. That means that I have a title page for the whole course and a lecture title page for a specific lecture. (\lecturedate
is one of my macros as well. So if you cut-and-paste the above you'll need to provide that as well.)
\lecturemode
is the key one. It is defined as:
\newcommand{\lecturemode}{%
\ifbeamer@inlecture
\else
\expandafter\mode\expandafter<\expandafter n\expandafter o\expandafter n\expandafter e\expandafter >\fi
}
(I wrote this before this site was in existence. I'm sure there are better ways to do this.) The \ifbeamer@inlecture
is true if the \lecture
command matched the lecture that we've declared ourselves to be interested in. So if we're not, we go into that gobbling mode. If we are, we proceed as normal.
With this (and I hope I've copied all of the relevant parts of the code! It is scattered in a few places), keeping all my lecture notes in one file becomes not only feasible but a considerable saving in time and effort.
The icing on the cake is that my file is called lectures.tex
but I never process that directly. Instead, I have a load of symlinks that look like lecture.beamer.2012-04-24.tex
and when I process that, I have some \jobname
hackery (described in my answer to Changing LaTeX headers via a makefile) that looks at it, sees the beamer
and the 2012-04-24
and produces the beamer
version of the lecture that matches the date 2012-04-24
.
You can see what the output looks like by looking at the Teaching (dead link, remove this parentheses when fixed. sig. thymaro) part of my website. Admittedly, that doesn't show much of what goes into producing those notes, but it at least shows that the above scheme works.
So this may not be what you need since I don't know where you are starting:
\documentclass{beamer}
\title{Title}
\author{Me}
\begin{document}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{background}{\includegraphics[width=\paperwidth,height=\paperheight]{teitl}}
\frame[label=title]{\titlepage}
\setbeamertemplate{background}{\includegraphics[width=\paperwidth,height=\paperheight]{tudalen}}
\begin{frame}{Frame Title}
This is a regular page.
\end{frame}
\end{document}
Update
The only way I can currently figure to do this is as follows:
\documentclass{beamer}
\usetheme{Atlanta}
\makeatletter
\defbeamertemplate*{frametitle}{mytitle}[1][left]
{
\ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
\@tempdima=\textwidth%
\advance\@tempdima by\beamer@leftmargin%
\advance\@tempdima by\beamer@rightmargin%
\begin{beamercolorbox}[sep=0.3cm,#1,wd=\the\@tempdima]{}
\usebeamerfont{frametitle}%
\vbox{}\vskip-1ex%
\if@tempswa\else\csname beamer@fte#1\endcsname\fi%
\strut\insertframetitle\strut\par%
{%
\ifx\insertframesubtitle\@empty%
\else%
{\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle\strut\par}%
\fi
}%
\vskip-1ex%
\if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here...
\end{beamercolorbox}%
}
\makeatother
\setbeamertemplate{footline}{}
\setbeamertemplate{frametitle}[mytitle]
\title{Title}
\author{Me}
\begin{document}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{background}{\includegraphics[width=\paperwidth,height=\paperheight]{teitl}}
% plain removes the navigation bar etc.
\frame[plain]{\titlepage}
\setbeamertemplate{background}{\includegraphics[width=\paperwidth,height=\paperheight]{tudalen}}
\begin{frame}{Frame Title}
This is a regular page.
\end{frame}
\end{document}
Update to Update
\documentclass[font=9pt]{beamer}
\usetheme{Atlanta}
\makeatletter
\defbeamertemplate*{frametitle}{mytitle}[1][left]
{
\ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
\@tempdima=\textwidth%
\advance\@tempdima by\beamer@leftmargin%
\advance\@tempdima by\beamer@rightmargin%
\begin{beamercolorbox}[sep=0.3cm,#1,wd=\the\@tempdima]{}
\usebeamerfont{frametitle}%
\vbox{}\vskip-1ex%
\if@tempswa\else\csname beamer@fte#1\endcsname\fi%
\strut\insertframetitle\strut\par%
{%
\ifx\insertframesubtitle\@empty%
\else%
{\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle\strut\par}%
\fi
}%
\vskip-1ex%
\if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here...
\end{beamercolorbox}%
}
\makeatother
\setbeamertemplate{footline}{}
\setbeamertemplate{frametitle}[mytitle]
\setbeamertemplate{headline}{}% eliminate headline so background is revealed
\definecolor{myblue}{rgb}{0.4, 0.6, 0.8}% adjust as desired
\setbeamercolor{structure}{fg=myblue}
\defbeamertemplate*{title page}{customized}[1][]
{
\usebeamerfont{title}\inserttitle\par
\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par
\bigskip
\usebeamerfont{author}\insertauthor\par
\usebeamerfont{institute}\insertinstitute\par
\usebeamerfont{date}\insertdate\par
\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic
}
%\usepackage{Warsaw}
%\usepackage{beamercolorthemeyellowjacket}
\usefonttheme{serif}
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage{algorithmic,algorithm}
\usepackage{graphicx,ifpdf}
\usepackage{mathrsfs}
\usepackage{natbib}
\usepackage{dsfont}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage{verbatim}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{wasysym}
\usepackage{tabularx}
\usepackage{tabulary}
\def\Ze{\mathbb{Z}}
\def\Qe{\mathbb{Q}}
\def\Re{\mathbb{R}}
\def\Ne{\mathbb{N}}
\def\E{\mathbb{E}}
%\def\Pr{{\rm Pr}}
\def\newblock{}
\DeclareMathOperator*{\wg}{\wedge}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newtheorem{thm}{Theorem}
\newtheorem{lem}{Lemma}
\newtheorem{obs}{Observation}
\newtheorem{prop}{Proposition}
\newtheorem{cor}{Corollary}
\newtheorem{dfn}{Definition}
\newtheorem{asp}[theorem]{Assumption}
\newcommand{\rv}{\mathcal{T}}
\newcommand{\rr}{\mathbb{R}}
\newcommand{\zz}{\mathbb{Z}}
\newcommand{\nn}{\mathbb{N}}
\newcommand{\rw}{W}
\newcommand{\rc}[1]{\textcolor{Black}{#1}}
\newcommand{\bc}[1]{\textcolor{Black}{#1}}
\title[Presentation ] % (optional, use only with long paper titles)
{Presentation Title}
\institute[my institute]{
}
\author[my name ] % (optional, use only with lots of authors)
{my name}
\date[]
\begin{document}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{background}{\includegraphics[width=\paperwidth,height=\paperheight]{blue}}
\frame[plain]{\titlepage}
\setbeamertemplate{background}{\includegraphics[width=\paperwidth,height=\paperheight]{background}}
\begin{frame}\frametitle{Outline}
\begin{enumerate}
\item Introduction
\item A two-stage chance-constrained model
\item Case study
\item Solution approaches
\item Conclusions
\end{enumerate}
\end{frame}
\section{Introduction}
\begin{frame}\frametitle{}
\begin{center}
\bfseries{Thank you!}\\
\vspace{2cm}
\bfseries{Comments?}\\
\end{center}
\end{frame}
\section{A two-stage chance-constrained model}
\begin{frame}\frametitle{}
\begin{center}
\bfseries{Thank you!}\\
\vspace{2cm}
\bfseries{Comments?}\\
\end{center}
\end{frame}
\section{Case study}
\begin{frame}\frametitle{}
\begin{center}
\bfseries{Thank you!}\\
\vspace{2cm}
\bfseries{Comments?}\\
\end{center}
\end{frame}
\section{Solution approaches }
\begin{frame}\frametitle{A Frame Title}
\begin{center}
\bfseries{Thank you!}\\
\vspace{2cm}
\bfseries{Comments?}\\
\end{center}
\end{frame}
\end{document}
Best Answer
See the tdclock package, for which there is a demo beamer tex file and resulting pdf (works only with Adobe Reader, I think).