Hey there I have a problem with the cases enviroment inside an equation i'm getting the error missing $ inserted but i don't know why.
I already searched and found that there are now blank lines inside a equation allowed but i'm not sure where they should be in my case.
Here is my code.
\documentclass[11pt,a4paper,oneside]{amsbook}
%Sprache
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
%Zeichensatz
\usepackage[utf8]{inputenc}
%PDF Integrierung
\usepackage{pdflscape}
\usepackage{rotating}
\usepackage{pdfpages}
\renewcommand{\familydefault}{\sfdefault}
%Formatierung
\usepackage[left=2.5cm,right=2.5cm,top=2cm,bottom=2cm]{geometry}
\usepackage[onehalfspacing]{setspace}
%Schriftart
\usepackage{helvet}
%Mathepackages
\usepackage{amsfonts,amstext,amsmath,amssymb,mathrsfs}
%Algorithmen
\usepackage{algorithm,algorithmic,program}
%diverses
\usepackage{enumerate}
%Theoreme und Gleichungen
\numberwithin{equation}{section}
\newtheorem{prop}{Satz}
\newtheorem{lemma}{Lemma}
\floatname{algorithm}{Algorithmus}
%Titelseite festlegen
\author{name\\
}
\title{Bachelorarbeit}
%Beginn der Seminarbeit
\begin{document}
\newtheorem{lemma}{Lemma}
\begin{lemma}
Die Supremumsnorm den k-ten Potenz von M ist gegeben durch
\begin{equation*}
\|M^k\| = \begin{cases}
\binom{N-1}{k} & | \beta | = 1,\\
\frac{1}{(k-1)!} \frac{d^{k-1}}{dz^{k-1}} \frac{z^{N-1}-1}{z-1} z =|\beta| & 7 | \beta | \neq 1
\end{cases}
\end{equation*}
\end{lemma}
\end{document}
I would be very glad if you could help me, i have another equation where it works just fine.
Naro
Best Answer
The
program
package defines|
as an active character for its usage in theprogram
environment and this causes the problem you have. However, the package provides an adjustment in case you want to use|
in math mode.However, it would be much better with
and
avoiding the unadorned
|
that is overloaded.A good alternative to using
\lVert
–\rVert
and\lvert
–\rvert
is withmathtools
that also provides adcases
environment. Here's an example with both input and output. Note that in your text you don't havek
andM
in math mode, which is wrong.