Math & Sciencealign and multline

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
omkardpd
Posts: 86
Joined: Sun Feb 24, 2008 7:23 am

align and multline

Post by omkardpd »

Hi,

I am arranging two equations under "align". The first one being too long has to be fit on two lines. The second can be fit in one line. However, I can not use "multline" under "align" for the first equation. If I write both equations under different "align" commands, the printing is not coming out that good. Can I use a single "align" under which print one equation on multiple lines and other as it is?

Thank you,

Omkar

Recommended reading 2024:

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

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

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

align and multline

Post by phi »

You can use the split environment for multi-line equations with alignment. Another options is provided by the multlined environment in the mathtools package.
helpless
Posts: 2
Joined: Tue Jan 06, 2009 1:33 pm

align and multline

Post by helpless »

hi everyone,

my problem is that i am trying to splilt up an equation that is surrounded by \exp{...}. as far as i see, i cannot put any \\ in between this braces....
this is how my code looks like...

Code: Select all

\begin{align*}
 \exp\left\{-\frac{1}{2(1-\rho^2)\sigma_1^2} \sum_{i=1}^n x_i^2 + \frac{\mu(\sigma_2-\rho(n-1)\sigma_1)}  {(1-\rho^2)\sigma_1^2 \sigma_2} \sum_{i=1}^n x_i + \frac{\rho}{(1-\rho^2)\sigma_1\sigma_2} \underset{i\neq j}{\sum_{i=1}^n\sum_{j=1}}x_i y_j  \\ 
+ \frac{\mu(\sigma_1-\rho(n-1)\sigma_2)}{(1-\rho^2)\sigma_1 \sigma_2^2}  \sum_{j=1}^n y_j  - \frac{1}{2(1-\rho^2)\sigma_2^2} \sum_{j=1}^n y_j^2  \right\}
\end{align*}
i would really appreciate any help!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

align and multline

Post by localghost »

The combination of left and right delimiters doesn't work this way. You have to supplement your code by a pair of invisible delimiters.

Code: Select all

\begin{align*}
\exp\left\{-\frac{1}{2(1-\rho^2)\sigma_1^2} \sum_{i=1}^n x_i^2 + \frac{\mu(\sigma_2-\rho(n-1)\sigma_1)}  {(1-\rho^2)\sigma_1^2 \sigma_2} \sum_{i=1}^n x_i + \frac{\rho}{(1-\rho^2)\sigma_1\sigma_2} \underset{i\neq j}{\sum_{i=1}^n\sum_{j=1}}x_i y_j \right. \\
\left. + \frac{\mu(\sigma_1-\rho(n-1)\sigma_2)}{(1-\rho^2)\sigma_1 \sigma_2^2}  \sum_{j=1}^n y_j  - \frac{1}{2(1-\rho^2)\sigma_2^2} \sum_{j=1}^n y_j^2 \right\}
\end{align*}
But this looks not very good because the closing brace appears smaller. This way of adjusting delimiters works automatically and so depends on the enclosed contents. But you can adjust the delimiters manually.

Code: Select all

\begin{align*}
\exp\Biggl\{-\frac{1}{2(1-\rho^2)\sigma_1^2} \sum_{i=1}^n x_i^2 + \frac{\mu(\sigma_2-\rho(n-1)\sigma_1)}  {(1-\rho^2)\sigma_1^2 \sigma_2} \sum_{i=1}^n x_i + \frac{\rho}{(1-\rho^2)\sigma_1\sigma_2} \underset{i\neq j}{\sum_{i=1}^n\sum_{j=1}}x_i y_j  \\
+ \frac{\mu(\sigma_1-\rho(n-1)\sigma_2)}{(1-\rho^2)\sigma_1 \sigma_2^2}  \sum_{j=1}^n y_j  - \frac{1}{2(1-\rho^2)\sigma_2^2} \sum_{j=1}^n y_j^2 \Biggr\}
\end{align*}
More information about typesetting complex math expressions is listed in "Math mode".


Best regards
Thorsten¹
helpless
Posts: 2
Joined: Tue Jan 06, 2009 1:33 pm

Re: align and multline

Post by helpless »

perfect! a thousand thanks ! :-)
Post Reply