![对 $ 符号的困惑](https://linux22.com/image/433368/%E5%AF%B9%20%24%20%E7%AC%A6%E5%8F%B7%E7%9A%84%E5%9B%B0%E6%83%91.png)
\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}