# Undefined control sequence. \beamer@doifinframe

I'm new with beamer and I'm trying to use the template from the university to make a Master presentation. unfortunately, I encountered some troubles. This is the code!

\documentclass[fleqn,15pt]{beamer}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{ragged2e}
\usepackage{etoolbox}
\apptocmd{\frame}{}{\justifying}{}
\begin{document}
\section{Reliability, Availability, and Maintainability}
\subsection{Reliability}
\begin{frame}{Reliability}
bla bla bla bla
\begin{center}
$$R\left ( t \right )=\exp ^{(- \lambda .t)}$$
\label{eq1}
\end{center}
Where \lamda is the failure rate and can be expressed as:
\begin{center}
$$\lambda = \frac{k}{T}$$
\label{eq2}
\end{center}
\end{frame}
\end{document}


and I'm getting this error message: ! Undefined control sequence. \beamer@doifinframe ...\end {center} Where \lamda is the failure rate and ca... l.49 \end{frame}

Anyone could help?

You can’t use the greek symbols outside of math mode and your command is missing a b, thus

Where \lamda is the failure rate and can be expressed as:


should be

Where $\lambda$ is the failure rate and can be expressed as:


Furthermore you should not use {center} around your equations. They are centered by default (you use the fleqn document class option, don’t us ist if you don't want flushing equations…) anyway and {center} adds extra vertical space.

Appending \justify to \frame in that way seems to be a bad idea … Just stick do ragged text and take the following advice from beamers manual serious:

Do not hyphenate words. If absolutely necessary, hyphenate words “by hand”, using the command \-.

I prefer having the \labels inside of the environment they belong to.

Full code

\documentclass[15pt]{beamer}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{ragged2e}
\usepackage{etoolbox}
%\apptocmd{\frame}{}{\justifying}{}

\begin{document}
\section{Reliability, Availability, and Maintainability}
\subsection{Reliability}
\begin{frame}{Reliability}
bla bla bla bla
$$\label{eq1} R\left ( t \right )=\exp(- \lambda \cdot t)$$
Where $\lambda$ is the failure rate and can be expressed as:
$$\label{eq2} \lambda = \frac{k}{T}$$
\end{frame}
\end{document}


I had to comment the line loading the theme, because it is not part of TeX Live and therefore not installed on my system …

Edit:

I just noticed it should be either \mathrm{e}^{x} or \exp(x) but not \exp^{x}. And your \lambda.t should probably be \lambda\cdot t, shouldn’t it?

• @A.nechi You’re welcome :-)
– Tobi
Sep 16 '16 at 12:51
• @A.nechi: I noticed two more things, please see my edit …
– Tobi
Sep 16 '16 at 13:25
• yes you are right ! Sep 16 '16 at 20:21