对 $ 符号的困惑

对 $ 符号的困惑
\begin{document}
\begin{equation}
    i_{t}=$ \sigma $ (W_{xi}x_{t}+W_{hi}h_{t-1}+W_{ci}c_{t-1}+b_{i}) %This line generates error
    f_{t}=$ \sigma $ (W_{xf}x_{t}+W_{hf}h_{t-1}+W_{cf}c_{t-1}+b_{f})
    o_{t}=$ \sigma $ (W_{xo}x_{t}+W_{ho}h_{t-1}+W_{co}c_{t-1}+b_{o})
    c_{t}=f_{t}c_{t}+i_{t}tanh(W_{xc}x_{t}+W_{hc}h_{t-1}+W_{co}c_{t-1}+b_{c})
    h_{t}=o_{t}tanh(c_{t})
\end{equation}
\end {document}

我遇到了这样的麻烦:

显示数学应该以 $$ 结尾。^^Ii_{t}=$

答案1

也许您正在寻找align*环境。

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
    i_{t}&= \sigma (W_{xi}x_{t}+W_{hi}h_{t-1}+W_{ci}c_{t-1}+b_{i}) \\
    f_{t}&= \sigma (W_{xf}x_{t}+W_{hf}h_{t-1}+W_{cf}c_{t-1}+b_{f}) \\
    o_{t}&=\sigma(W_{xo}x_{t}+W_{ho}h_{t-1}+W_{co}c_{t-1}+b_{o}) \\
    c_{t}&=f_{t}c_{t}+i_{t}\tanh(W_{xc}x_{t}+W_{hc}h_{t-1}+W_{co}c_{t-1}+b_{c})\\
    h_{t}&=o_{t}\tanh(c_{t})
\end{align*}
\end {document}

相关内容