3

Following beamer syntax generates an error:

\begin{frame} 
\frametitle{Sys}
$$Y \sim \left\{\begin{matrix}
\chi_{2N}^2,~~~~~~~~~:H_0\\ 
\chi_{2N}^2(2\gamma),~~~:H_1
\end{matrix}\right$$

$$f_Y(y) = \left\{\begin{matrix}
\frac{1}{2^N\Gamma(N)}y^{N-1}e^{\frac{-y}{2}},~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:H_0\\ 
\frac{1}{2}\left ( \frac{y}{2N\gamma}\right)^\frac{N-1}{2}e^{\left(-\frac{y+2N\gamma}{2}\right)}I_{N-1}\left ( \sqrt{2N\gamma y} \right),:H_1 \end{matrix}\right$$

\end{frame}
m0nhawk
  • 9,664
  • What errors?... – m0nhawk May 18 '14 at 06:35
  • You need \right. (you forget the period.) at the end of each math equation. – Jesse May 18 '14 at 06:39
  • Don't use $$...$$, it's highly deprecated.

    Use the equation or align environments from the amsmath package. equation for single-lign equations, alignfor multi-lign equations. You can use the &-sign do the aligning in align. Have a look to this please: ftp://ftp.dante.de/tex-archive/info/l2tabu/english/l2tabuen.pdf

    – MaxNoe Aug 16 '14 at 10:22

1 Answers1

2

Rather than hard-code the alignment of various elements with lots of ~ (unbreakable space) characters and several matrix environments, it may be preferable to use the align* and dcases environments. A separate comment: don't rely blindly on \left and \right directives to get the size of parentheses right.

enter image description here

\documentclass{beamer}
\usepackage{mathtools}
\begin{document}
\begin{frame} 
\frametitle{Sys}
\begin{align*}
Y &\sim 
   \begin{dcases}
   \chi_{2N}^2 & \colon H_0\\ 
   \chi_{2N}^2(2\gamma) & \colon H_1\\
   \end{dcases}\\
f_Y(y) &= 
   \begin{dcases}
   \frac{1}{2^N\Gamma(N)}\,y^{N-1}e^{-y/2} & \colon H_0\\ 
   \frac{1}{2}\Bigl ( \frac{y}{2N\gamma}\Bigr)^{(N-1)/2}
   e^{-(y+2N\gamma)/2} \,
   I_{N-1}( \sqrt{2N\gamma y}\, ) & \colon H_1
   \end{dcases}
\end{align*}
\end{frame}
\end{document}
Mico
  • 506,678