[Tex/LaTex] Math mode and beamer

beamermath-mode

I have some difficulties with math mode in beamer.

At the moment if I add a newline it gives the error message:

Missing $ inserted. \end{frame}

What am I doing wrong?

In another question it has something to do with versions of math-package and beamer, but I have a fresh install.

\documentclass[aspectratio=1610]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb,amsmath}

\begin{document}
\begin{frame}{Example Quadratic Formula}
    \begin{columns}
        \column{0.5\textwidth}
        Dicriminant
        \begin{math}
            \text{function } \left[d\right]=\text{dicriminant}(a, b, c)
            d = b\wedge 2 - 4*a*c
        \end{math} 
        \column{0.5\textwidth}
        some text
    \end{columns}
\end{frame}
\end{document}

This doesn't work:

\documentclass[aspectratio=1610]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb,amsmath}

\begin{document}
\begin{frame}{Example Quadratic Formula}
    \begin{columns}
        \column{0.5\textwidth}
        Dicriminant
        \begin{math}
            \text{function } \left[d\right]=\text{dicriminant}(a, b, c)\\
            d = b\wedge 2 - 4*a*c
        \end{math} 
        \column{0.5\textwidth}
        some text
    \end{columns}
\end{frame}
\end{document}

Best Answer

You need some math environment with multi-line support. There is align*, gather*, split, multline, aligned, alignat, and the list continues..

\documentclass[aspectratio=1610]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,lmodern}

\begin{document}
\begin{frame}{Example Quadratic Formula}
    \begin{columns}
        \column{0.5\textwidth}
        Dicriminant
        \begin{align*}
            \text{function } \left[d\right]&=\text{dicriminant}(a, b, c)\\
            d &= b\wedge 2 - 4*a*c
        \end{align*}
        \column{0.5\textwidth}
        some text
    \end{columns}
\end{frame}

\end{document}

enter image description here