# equation with latex

I am trying to write this equation with latex:

this is the code I wrote:

$$\label{1} \min \sum_{i=1}^{\infty} u_j (L.B.H) - \sum_{i=1}^{N} \emph{l_i}.\emph{b_i}.\emph{h_i}$$


but I get this error:

! Missing $inserted. <inserted text>$


I don't know where is the missing $ • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Seamus May 25 '16 at 11:08 • @Mico Are you really sure? I'd say it's the empty line... – campa May 25 '16 at 11:14 • @campa - Your're right. There are (at least) two errors: The first error is the blank line, which generates the "Missing$ inserted." error message. The second error, caused by the spurious $ symbols in the upper limit of summation, generates a different error message: "Missing { inserted"... – Mico May 25 '16 at 11:40 ## 1 Answer First of all, empty lines are not allowed in displayed math environments (like equation), remove those. Second, you are in math mode, so there is no need for $\infty\$, \infty alone is correct. Finally, the \emph doesn't really do anything useful I think, I would remove them and the dollar signs.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\label{1} \min \sum_{j=1}^{\infty} u_j (L.B.H) - \sum_{i=1}^{N} l_i.b_i.h_i$$
\end{document}


• @Samuel Not my typo, that's copied from the question. But thanks, will fix. – Torbjørn T. May 25 '16 at 11:08
• Using periods for multiplication is not usual in mathematics – egreg May 25 '16 at 11:15
• @egreg I find it odd myself, and if it were me I'd use \cdot or nothing. – Torbjørn T. May 25 '16 at 11:22
• @egreg It depends on what you are taught. During my secondary school period, my math teacher told the class to not use the x symbol for multiplication like primary school taught us, and instead to use a period. I switched to using * during college because that's what programmers use. – Nzall May 25 '16 at 12:13
• @Nzall * looks awful I think. And periods are of course useless if you have decimal numbers and use a period there as well. – Torbjørn T. May 25 '16 at 12:19