Math & Scienceproblem: right bracket "]" does not appear

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
greenfalcon
Posts: 10
Joined: Wed Apr 21, 2010 9:47 pm

problem: right bracket "]" does not appear

Post by greenfalcon »

hello everyone,

i am new to the forum and haven't become very femiliar with latex, yet

i would like to get an equation that looks like that: (see uploaded picture at the bottom)

what i did now, is this:

Code: Select all

\begin{eqnarray}
  L & = & \sum_{t=0}^{\infty} \beta^t \left[ \left( log(C_t) + \theta  \frac{M_t}{P_t} +V\left( \bar{N} - N_t \right)  \right) \\
  & & {} +  \lambda_t \left( \frac{W_t}{P_t} N_t + \kappa_t I_{t-1} + \mu_t \frac{M_{t-1}}{P_t} - C_t - \frac{M_t}{P_t} - I_t  \right)\right]  \\
  
\end{eqnarray}
it does look pretty close: (the upper picture)

now, there are two things, that really puzzle me:

1) where is the bracket "]" at the very end? it is part of the code, but it doesnt appear in the pdf output :(

2) where do the (3) and (4) come from? this is really surprising to me...

thank you very much
Attachments
this is what my equation looks like
this is what my equation looks like
what_my_equation_looks_like.PNG (14.74 KiB) Viewed 7692 times
this what the equation is supposed to look like
this what the equation is supposed to look like
how_the_equation_is_supposed_to_look_like.PNG (11.16 KiB) Viewed 7692 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

problem: right bracket "]" does not appear

Post by php1ic »

Don't use eqnarray, instead use the align environment provided by the amsmath package. See the link in this thread for why not to use eqnarray.

http://www.latex-community.org/forum/vi ... =46&t=8525

The code you gave doesn't compile for me as you don't have matching brackets on each line. This is probably why you don't get the right "]".

I can't see why you have (3) and (4), I guess it is something to do with the unnecessary line break followed by the blank line. I guess eqnarray simply puts a number on every line.

Anyway, as I said, the align environment will do what you want.

Code: Select all

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align}
  L & =  \sum_{t=0}^{\infty} \beta^t \biggl[ \left( log(C_t) + \theta  \frac{M_t}{P_t} +V\left( \bar{N} - N_t \right)  \right) \notag\\
  & \quad + \lambda_t \left( \frac{W_t}{P_t} N_t + \kappa_t I_{t-1} + \mu_t \frac{M_{t-1}}{P_t} - C_t - \frac{M_t}{P_t} - I_t  \right)\biggr]
\end{align}

\end{document}
greenfalcon
Posts: 10
Joined: Wed Apr 21, 2010 9:47 pm

Re: problem: right bracket "]" does not appear

Post by greenfalcon »

thank you very much for your help!

that works perfectly :)

by the way, is there a way to get the (1) to move between the two lines?

thank you
Attachments
here the (1) is inbetween the lines
here the (1) is inbetween the lines
how_the_equation_is_supposed_to_look_like.PNG (11.12 KiB) Viewed 7686 times
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

problem: right bracket "]" does not appear

Post by php1ic »

You can use the split environment (also provided by amsmath) which goes inside the equation environment. Looks like this is what you were looking for to start with, as it seems to be designed for single equations that are too long for a line.

Code: Select all

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{split}
  L & =  \sum_{t=0}^{\infty} \beta^t \biggl[ \left( log(C_t) + \theta  \frac{M_t}{P_t} +V\left( \bar{N} - N_t \right)  \right)\\
  & \quad + \lambda_t \left( \frac{W_t}{P_t} N_t + \kappa_t I_{t-1} + \mu_t \frac{M_{t-1}}{P_t} - C_t - \frac{M_t}{P_t} - I_t  \right)\biggr]
\end{split}
\end{equation}

\end{document}
greenfalcon
Posts: 10
Joined: Wed Apr 21, 2010 9:47 pm

Re: problem: right bracket "]" does not appear

Post by greenfalcon »

ah, okay, you can do it with {split}

thank you very much!

:)
Post Reply