[Tex/LaTex] how to write a long equation in beamer presentation

beamerequations

Below is my MWE and I like to align the long equation in beamer presentation but the later part of the equation is not shown in the slide. Any help would be appreciated.

\documentclass{beamer}
\mode<presentation>
\usepackage{beamerthemesplit,graphics,graphicx,amssymb,amsmath,pgf,comment,hyperref}
\usepackage{breqn}
\usepackage[xcolor=pst]{pstricks}
\usepackage{pgfshade}
\usepackage[round]{natbib}
\usetheme{Warsaw}
\usefonttheme[onlylarge]{structuresmallcapsserif}
\setbeamercovered{highly dynamic}
\setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]
\setbeamertemplate{footline}{%
\begin{beamercolorbox}{section in head/foot}
\vskip2pt\centerline{\textcolor[rgb]{0.45,0.45,0.45}{\insertshorttitle}}\vskip2pt
\end{beamercolorbox}%
}
\renewcommand{\bibsection}{\subsubsection*{\bibname } }

  \begin{document}
\begin{frame}
 \frametitle{Expected utility comparision at renewal}
%\vspace{-0.3cm}

The expected utility of retaining the LTCI policy is written as:
%\begin{equation}
%\begin{align*}
\begin{dmath}
EU_{i}^R=  \sum_{t=0}^{T} \beta \left[u_{i}\left\{W_{i}-\sum_{s=1}^5 Q_{t,s}\times P_{s}\right\}+\sum_{s=1}^5 Q_{t,s} \left\{u_{i}\left.(W_{i}-max\left.(X_{t,s}-B_{t,s},0\right)\right)\right\}\right]
%\end{align*}
%\end{equation}
\end{dmath}
\end{frame}
\end{document}

Best Answer

You have two choices:

  • significantly reduce font size of equation (not recommended)
  • break equation into two lines:

enter image description here

\documentclass{beamer}
\mode<presentation>
\usepackage{beamerthemesplit,graphics,graphicx,amssymb,amsmath,pgf,comment,hyperref}
\usepackage{breqn}
\usepackage[xcolor=pst]{pstricks}
\usepackage{pgfshade}
\usepackage[round]{natbib}
\usetheme{Warsaw}
\usefonttheme[onlylarge]{structuresmallcapsserif}
\setbeamercovered{highly dynamic}
\setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]
\setbeamertemplate{footline}{%
\begin{beamercolorbox}{section in head/foot}
\vskip2pt\centerline{\textcolor[rgb]{0.45,0.45,0.45}{\insertshorttitle}}\vskip2pt
\end{beamercolorbox}%
}

\begin{document}
\begin{frame}
 \frametitle{Expected utility comparision at renewal}
%\vspace{-0.3cm}
%\setlength{\noindent}
The expected utility of retaining the LTCI policy is written as:
\begin{multline*}
EU_{i}^R 
    =  \sum_{t=0}^{T} \beta \left[u_{i}\left\{W_{i} -\sum_{s=1}^5 Q_{t,s}\times P_{s}\right\}\right.  \\
      +\left.\sum_{s=1}^5 Q_{t,s} \Bigl\{u_{i}\left(W_{i} - \max\left(X_{t,s}-B_{t,s},0\right)\right)\Bigr\}\right]
\end{multline*}
\end{frame}
\end{document}

Edit: Regarding word max in equation: it is operator, so its corect use is \max

Regarding braces:

  • Braces pair \left{, \right} or left[, \right] had not to contain ampersand nor broken line. In such a cases you can use for example \left[ ....\right. \\, but his not guaranty that the similar construct in the next line will have the same height braces (since it depends on content inside)
  • Height of pairs \left... , \right...` depend on content between them. They also add small horizontal space before/ after them.
  • Height of braces, independent from content between them, you can determine manualy with \big, \Big, \bigg etc where is added letter l (\bigl) designate that brace is on left side and r (\bigr) that it is on right.

In above MWE I changed size of braces in second equation line. However, you cn change selected height as you liked.