2

I have this code but whenever I run it, I get an error but I still can't seem to find what I wrong with it.

\begin{equation}

ET=\dfrac{1}{\lambda\rho_w}\dfrac{\Delta(R_n-G)+{\rho_a}c_p
   \dfrac{e_s-e_a}{r_a}}{\Delta+\gamma(1+\dfrac{r_s}{r_a})}

\end{equation}

this is the equation I am trying to type out.

enter image description here

1
  • Welcome to TEX.SE. Do please tell which error message(s) you get.
    – Mico
    May 5, 2017 at 14:05

2 Answers 2

5

Every \par command, which can be also an empty line, is forbidden in math mode and produces a proper error. For \dfrac command you need amsmath package. The following code compiles without errors.

 \documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation}
  ET=\dfrac{1}{\lambda\rho_w}\dfrac{\Delta(R_n-G)+{\rho_a}c_p\dfrac{e_s-e_a}{r_a}}{\Delta+\gamma(1+\dfrac{r_s}{r_a})}
\end{equation}

\end{document}

As you can see, it needs, e.g., \left[ ... \right] and \left( ... \right) pairs to obtain parentheses.

3
  • I am really new to LateX and I do not understand your response. Could you please clarify it? Thanks
    – xoxo
    May 5, 2017 at 13:58
  • @xoxo The initial one or the present version? May 5, 2017 at 14:01
  • @xoxo You are welcome. Please observe however, that the present result is far away from this from your picture. But the code compiles and you can work on it. :-) May 5, 2017 at 14:08
0

Similar to the other answer code, but with \boxed to have a framed box around the equation.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation*}
  \boxed{\mathrm{ET}=\dfrac{1}{\lambda\rho_w}\left[\dfrac{\Delta(R_n-G)+{\rho_a}c_p\dfrac{e_s-e_a}{r_a}}{\Delta+\gamma\left(1+\dfrac{r_s}{r_a}\right)}\right]}
\end{equation*}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .