数学模式下 align* 的问题

数学模式下 align* 的问题

我想问一下为什么命令align不起作用。我的文本如下:

\begin{align*}
$f(g_{1}{g_{2}}^{-1} ) & = f(g_{1}) \cdot f({g_{2}}^{-1})$ dato che $f$ omomorfismo \\

&= $f(g_{1}) \cdot f(g_{2})^{-1}$ dato che $f$ è omomorfismo \\

&= $f(g_{1}) \cdot f(g_{1})^{-1}$ , segue da $f(g_{1}) = f(g_{2})$ \\

&= $e'$
\end{align*}

不幸的是,它不能编译,我的代码是错误的,我想知道在哪里。

是否有一些需要添加的包我忽略了?

答案1

请阅读基本指南。由于align*您已经处于数学模式,因此$是被禁止的(它不在 的范围内\text)。

\documentclass[a4paper]{article}
\usepackage{amsmath}

\begin{document}

Some text to fill a couple of lines before some displayed
equation that is centered on a line by itself
\begin{equation*}
f(g_{1})=f(g_{2})
\end{equation*}
and some text following the display. Now we have a more
complex one.
\begin{align*}
f(g_{1}{g_{2}}^{-1} ) & = f(g_{1}) \cdot f({g_{2}}^{-1})
 &&\text{dato che $f$ è omomorfismo} \\
&= f(g_{1}) \cdot f(g_{2})^{-1}
 &&\text{dato che $f$ è omomorfismo} \\
&= f(g_{1}) \cdot f(g_{1})^{-1},
 &&\text{segue da $f(g_{1}) = f(g_{2})$} \\
&= e'
\end{align*}

\end{document}

在此处输入图片描述

相关内容