我正在尝试使用 LaTeX 运行以下代码:
\begin{align*}
A\left(x\right)&=
\begin{cases}
1, &\text{if } x \eq 1\\
0, &\text{otherwise}
\end{cases}
\end{align*}
我希望它显示 A(x) 可以具有的多个值,但是我在同一行收到两个错误,并且说的是同样的事情。
undefined control sequence <argument> ...begin {cases} 1, &\text {if } x \eq
1\\ 0, &\text {otherwise} ...
l.54 \end{align*}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
谁能告诉我如何让 LaTeX 显示我想要的内容?
答案1
请提供平均能量损失下次再见。
下面的代码应该可以解决你的问题:
\documentclass[12pt, fleqn]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[scaled]{}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{align*}
A\left(x\right)=
\begin{cases} 1, &\textrm{if } x = 1 \\
0, &\textrm{otherwise}
\end{cases}
\end{align*}
\end{document}