Math & ScienceProper Alignment for Equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
wicky_83
Posts: 6
Joined: Sat Feb 11, 2012 11:49 am

Proper Alignment for Equations

Post by wicky_83 »

I'm using the amssymb, amsmath packages to do equations. When I compile the following code

Code: Select all

\begin{equation}
  	w_j(k+1) = \biggl\lbrace 
\begin{split}
w_j(k),  j \notin N_{(k+1)} \\
w_j(k) + LR(k)*(x_k-w_j(k)),  j \in N_{(k+1)}
\end{split}
\end{equation}
I get the following output.
Untitled.png
Untitled.png (12.85 KiB) Viewed 2032 times
Hi,

How can I remove the space shown by red lines. I tried the \begin{align} method but it does not work in my distribution.

Please tell me how to remove the unwanted white-space or is there any better way to do the same thing?

Thank you

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Proper Alignment for Equations

Post by Stefan Kottwitz »

Hi Wicky,

instead of split, which is for complete formulas, you could use an aligned environment which is for aligned math blocks:

Code: Select all

\begin{equation}
  w_j(k+1) = \biggl\lbrace
    \begin{aligned}
      & w_j(k),  j \notin N_{(k+1)} \\
      & w_j(k) + LR(k)*(x_k-w_j(k)),  j \in N_{(k+1)}
    \end{aligned}
\end{equation}
Or a cases environment:

Code: Select all

\begin{equation}
  w_j(k+1) = 
    \begin{cases}
      w_j(k),  j \notin N_{(k+1)} \\
      w_j(k) + LR(k)*(x_k-w_j(k)),  j \in N_{(k+1)}
    \end{cases}
\end{equation}
Stefan
LaTeX.org admin
wicky_83
Posts: 6
Joined: Sat Feb 11, 2012 11:49 am

Re: Proper Alignment for Equations

Post by wicky_83 »

Thank you. ;)
Post Reply