2
\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}

I got trouble like this:

Display math should end with $$. ^^Ii_{t}=$

  • 5
    $ is used for inline math in the text. You have and equation which is display math. Those two should not be mixed. – daleif May 09 '21 at 15:46
  • 3
    If you're new to latex I'd suggest you read a good introduction to latex to learn about the proper syntax and what to use where. – daleif May 09 '21 at 15:47
  • 2
    After the correct suggestion of @daleif I add a link for the beginner of LaTeX: https://tex.stackexchange.com/questions/11/what-are-good-learning-resources-for-a-latex-beginner – Sebastiano May 09 '21 at 15:55

1 Answers1

7

Maybe you're looking for the align* environment.

enter image description here

\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}
SebGlav
  • 19,186