# Splitting an equation into multiple lines [duplicate]

I want to display the following equation:

The LaTeX code I have made is as follows:

$PaD^{i}=\left [ \frac{(1-\frac{n_{1}}{N})\times M(i,1)}{m}+\frac{\sum_{t=2}^{m}[(1-\frac{n_{t}}{N}\times \frac{n_{t-1}}{N})\times M(i,t)\times M(i,t-1) )]}{m}+\\ \frac{\sum_{t=2}^{m}[(1-\frac{n_{t}}{N}\times \frac{N-n_{t-1}}{N})\times M(i,t)\times (1-M(i,t-1))]}{m}\right ]\times 100\%$


Is there any way to break the right side of the equation into three lines so that it can fit the page?

## marked as duplicate by CarLaTeX, Stefan Pinnow, Andrew Swann, egreg equations StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Feb 16 '17 at 10:42

Here are two possible solutions. The first is kind of minimal, in that it uses an align* environment and provides for two line breaks. (Well, I also replace most instances of \times with \cdot, and I eliminated a spurious ) in the middle row.)

The second solution goes further towards making it easy on your reader to actually read and comprehend the material. E.g., by writing \frac{1}{m} at the beginning of each of the three additive terms, the remaining material can be typeset using larger lettering. After all, the material that's being summed up is at least as important as the \frac{1}{m} term, right? The second solution also gets rid of all \cdot directives and places the 100\% block at the start, to give it more visual prominence.

\documentclass{article}
\usepackage{amsmath} % for 'align*' env.

\begin{document}
\begin{align*}
&=\biggl[ \frac{(1-\frac{n_{1}}{N})\cdot M(i,1)}{m}\\
\biggr] \times 100\,\%
\end{align*}

\begin{align*}

• Of course, one could take the \frac{1}{m} term outside the curly braces. However, I didn't go that far since I don't know if the meaning of the three additive terms depends on them being scaled by \frac{1}{m}. For sure, additive terms 2 and 3 seem to be some kind of average... – Mico Feb 16 '17 at 7:53
• WhileIamtryingtouse\begin{align*}\end{align*}insideblock,Iamgettingerror@Mico – user5411115 Feb 16 '17 at 8:14
• @user5411115 - Well, you must not nest these two particular environments. If want to create a nested structure, use split as the inner environment. – Mico Feb 16 '17 at 8:35
• @user5411115 - If you want to become a proficient user of LaTeX and writer of mathy material, you should take the time to study the user guide of the ansmath package. – Mico Feb 16 '17 at 8:39
• @user5411115 -- if you want a single equation number, then substitute aligned for align* and wrap the whole thing in $$...$$. (in this situation, aligned is very similar to split, which Mico has already suggested.) – barbara beeton Feb 16 '17 at 14:58