# How can I separate an equation over two or three lines?

I am having the following equation as below

$$\label{eq:36} \emph{SINR^{D,UL}_{k,n}} = \frac{p_{k,n} |h_{k,n}|^2}{\sum_{m=1}^{M} \omega_{n,m}p_{m,n}|h^{C}_{m,n}|^2 + \sum_{c^{'}=1}^{C^{'}} \sum_{m^{'}}^{M^{'}} \omega^{'}_{n,m^{'},c^{'}}p_{m^{'},n}|h^{C}_{m^{'},n,k,c^{'}}|^2 + \sum_{c^{'}=1}^{C^{'}} \sum_{k^{'}}^{K^{'}} \zeta^{'}_{n,k^{'},c^{'}}p_{k^{'},n}|h^{D}_{k^{'},n,k,c^{'}}|^2 + N_{0}B}$$


The equation does not very well fit on one line. How can I separate this over two or three lines? Please see my figure example.

Thanks a lot.

Perhaps use multline?

\documentclass{article}
\usepackage{amsmath}
\newcommand\abs[1]{\lvert#1\rvert}
\begin{document}

\begin{multline}
\label{eq:36}
\mathrm{SINR}^{D,UL}_{k,n} =  p_{k,n} \abs{h_{k,n}}^2
\biggl(
\sum_{m=1}^{M} \omega_{n,m} p_{m,n} \abs{h^{C}_{m,n}}^2 \\
+ \sum_{c'=1}^{C'} \sum_{m'}^{M'} \omega'_{n,m',c'} p_{m',n} \abs{h^{C}_{m',n,k,c'}}^2 \\
+ \sum_{c'=1}^{C'} \sum_{k'}^{K'} \zeta'_{n,k',c'} p_{k',n} \abs{h^{D}_{k',n,k,c'}}^2
+ N_{0}B
\biggr)^{\!-1}
\end{multline}

\end{document}


Or introduce aliases:

\documentclass{article}
\usepackage{amsmath}
\newcommand\abs[1]{\lvert#1\rvert}
\begin{document}

$$\label{eq:36} \mathrm{SINR}^{D,UL}_{k,n} = \frac{p_{k,n} \abs{h_{k,n}}^2}{X + Y + Z + N_{0}B}$$
where
\begin{align*}
X &= \sum_{m=1}^{M} \omega_{n,m} p_{m,n} \abs{h^{C}_{m,n}}^2 \\
Y &= \sum_{c'=1}^{C'} \sum_{m'}^{M'} \omega'_{n,m',c'} p_{m',n} \abs{h^{C}_{m',n,k,c'}}^2 \\
Z &= \sum_{c'=1}^{C'} \sum_{k'}^{K'} \zeta'_{n,k',c'} p_{k',n} \abs{h^{D}_{k',n,k,c'}}^2
\end{align*}

\end{document}


You can also make that nasty thing you showed in the question, but I do not recommend that.

\documentclass{article}
\usepackage{amsmath}
\newcommand\abs[1]{\lvert#1\rvert}
\begin{document}

$$\label{eq:36} \mathrm{SINR}^{D,UL}_{k,n} = \frac{p_{k,n} \abs{h_{k,n}}^2}{ \begin{pmatrix} \sum_{m=1}^{M} \omega_{n,m} p_{m,n} \abs{h^{C}_{m,n}}^2 + {} \\ \sum_{c'=1}^{C'} \sum_{m'}^{M'} \omega'_{n,m',c'} p_{m',n} \abs{h^{C}_{m',n,k,c'}}^2 + {} \\ \sum_{c'=1}^{C'} \sum_{k'}^{K'} \zeta'_{n,k',c'} p_{k',n} \abs{h^{D}_{k',n,k,c'}}^2 + N_{0}B \end{pmatrix} }$$

\end{document}


• Great! I like the last one example as you suggested. Thanks a lot to @Henri Menke May 22, 2017 at 21:58
• Mmmhh… :-( \substack is meant for super/subscripts, and for this reason it typesets its argument in \scriptstyle; note that this entails that you get no space around binary operators and relation symbols. What about a pmatrix environment, instead? It usesn\textstyle, which seems much more appropriate… Also, I guess you didn’t notice the ^{'} idiom that the OP uses repeatedly, |...| instead of \lvert ... \rvert, or better, \DeclarePairedDelimiter
– GuM
May 22, 2017 at 23:16
• @user3727281 Why are you picking the garbage solution when I presented two other perfectly reasonable ones? May 22, 2017 at 23:23
• @GustavoMezzetti You are right. I didn't put too much effort into it. Using pmatrix instead of \substack is a good. I wouldn't say a substack is completely wrong here because somehow you need to cramp all that stuff in the denominator but then this part is ugly anyway and cannot be made looking decent. May 22, 2017 at 23:39