# Line breaking in equation

This is the equation I want to write in LaTex:

I have read these advices, but for split and multilined commands it says that they are undefined (and also for multiline, but nevertheless this is not suitable for me). Is there another possibility how to break line?

• What's the meaning of the semicolons? Do they signify that V_{i,j} is equal to the material to the left of the semicolon if the statement on the right is true? If that's the case (pun intended), have you tried using the cases environment provided by the amsmath package? – Mico Mar 25 '14 at 20:06
• Yes, you are right. Semicolon separates only condition. Cases is something that I am looking for, but it generates only left { and no right }. If it is possible to add ending }, then it will be great. – TA_Kosice Mar 25 '14 at 21:29

The empheqpackage (which loads mathtools and amsmath) lets put whatever you want on the left or on the right of a group of equations. So here is another solution, with the gather*environment:

    \documentclass[12pt,a4paper,bothsides]{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe, nomarginpar]{geometry}

\begin{document}

\begin{gather*}[left ={ V_{i,j} = \empheqlbrace},  right = \empheqrbrace ]
a + b  = c + d \\
∫_0¹ x² \ \mathrm{d}x   = \dfrac{1}{3}\\
\nabla u  =  0
\end{gather*}

\end{document}


Since you've noted in a comment that the semicolons are there to denote an "if ..." relationship, I would suggest that you display the material in two separate columns, with ; replaced with if at the start of the second column.

Furthermore, since the same, fairly complicated expression occurs five times between the curly braces, I suggest you define it beforehand and give it a shorthand, say, \widehat{W}. (You're obviously free to come up with a more suitable shorthand symbol!) Then use either an array environment or a dcases environment to state what V_{ij} is, with \widehat{W} -- or whatever symbol you end up choosing -- making its appearance five times.

This setup -- first, define the complicated expression; second, use it repeatedly in the statement of what V_{ij} is -- should let the reader focus more easily on the structure of the argument.

\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\begin{document}
Let $\displaystyle\widehat{W}\equiv W_{j}\ln\biggl( 1 + \frac{G_{i,j} \abs{h_{i,j}}^2 P_{i,j}} {\sigma_{i,j}^2} \biggr)$. Then
$\renewcommand\arraystretch{1.5} % more space between lines to mimic display style V_{i,j} = \left\{\begin{array}{ll} (Q_{1}D_{i}^{d} + Q_{2}D_{i}^{o}) \widehat{W} & \text{if } D_{i}^{d} + D_{i}^{o} \leq \widehat{W}\\ Q_{1}D_{i}^{d} \widehat{W} & \text{if } D_{i}^{d} \leq \widehat{W} < D_{i}^{d} + D_{i}^{o}\\ 0 & \text{if } \widehat{W} < D_{i}^{d} \end{array}\right\}$

Or, using the \texttt{dcases} environment:
$V_{i,j} = \begin{dcases} % dcases environment is provided by the mathtools package (Q_{1}D_{i}^{d} + Q_{2}D_{i}^{o}) \widehat{W} & \text{if } D_{i}^{d} + D_{i}^{o} \leq \widehat{W}\\ Q_{1}D_{i}^{d} \widehat{W} & \text{if } D_{i}^{d} \leq \widehat{W} < D_{i}^{d} + D_{i}^{o}\\ 0 & \text{if } \widehat{W} < D_{i}^{d} \end{dcases}$
\end{document}

• This is a smart way of doing it! – Svend Tveskæg Mar 26 '14 at 1:33

Another solution:

\documentclass{article}

\usepackage{geometry}
\usepackage{mathtools}

\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}

\begin{document}

\begin{equation*}
V_{i,j} =
\begin{Bmatrix}
\displaystyle (Q_{1}D_{i}^{d} + Q_{2}D_{i}^{o})W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}; D_{i}^{d} + D_{i}^{o} \leq W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}\3ex] \displaystyle Q_{1}D_{i}^{d}W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}; D_{i}^{d} \leq W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu} < D_{i}^{d} + D_{i}^{o}\\[3ex] \displaystyle 0; W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu} < D_{i}^{d} \end{Bmatrix} \end{equation*} \end{document}  P.S. I've added geometry to avoid the equation going into the margin. Update If you want all the math in the document to be written in display style, you can declare \everymath{\displaystyle}; \documentclass{article} \usepackage{geometry} \usepackage{mathtools} \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \everymath{\displaystyle} \begin{document} \begin{equation*} V_{i,j} = \begin{Bmatrix} (Q_{1}D_{i}^{d} + Q_{2}D_{i}^{o})W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}; D_{i}^{d} + D_{i}^{o} \leq W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}\\[3ex] Q_{1}D_{i}^{d}W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}; D_{i}^{d} \leq W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu} < D_{i}^{d} + D_{i}^{o}\\[3ex] 0; W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu} < D_{i}^{d} \end{Bmatrix} \end{equation*} \end{document}  • Instead of inserting all those (negative) \mkerns by hand, you could load the mleftright package and issue the instruction \mleftright in the preamble. Doing so will get rid of all the extra white space that's otherwise inserted by \left and \right. Actually, I'd argue that the parents generated by \left and \right are too tall, typographically speaking; sizing the fences as \bigg[lr] or possibly even as \Big[lr] may be more desirable. – Mico Mar 25 '14 at 20:12 • @Mico Thanks for the hint. I think the spacing is too small so I'll stick to the manual approach. – Svend Tveskæg Mar 25 '14 at 20:20 • Quite difficult solution in the first look – with that mkern command. But this looks like it should. I will try it with \mleftright. – TA_Kosice Mar 25 '14 at 21:47 • @TA_Kosice You don't have to use \mkern it it looks wierd without. – Svend Tveskæg Mar 25 '14 at 22:54 • I've borrowed your code for my answer (and, of course, upvoted yours...). – Mico Mar 26 '14 at 1:23 You could use an array: \begin{align*} V_{i,j}=\left\lbrace\begin{array}{c}% First line\\ Second line\\ Third line \end{array}\right\rbrace \end{align*}  You have to load the mathtools package to obtain the multlined environment. Anyway, the Bmatrix environment from the same package (and from amsmath, of which mathtools is an extension) may be suitable to you: \documentclass{article} \usepackage{amsmath} \begin{document} \[ V_{i,j}=\begin{Bmatrix} Q_1 \\ Q_2 \\ Q_3\end{Bmatrix}
\end{document}


Instead of Q_1, Q_2 and Q_3, you may enter your own formulas.

• actually, multlined requires mathtools. however, gathered (which is in amsmath) would seem to be more appropriate, since it centers all the lines rather than staggering them from left to right. – barbara beeton Mar 25 '14 at 18:45
• @barbarabeeton Sorry for the confusion, I've updated my answer. Anyway, I've used mathtools instead of amsmath for a long time by now, so I'm sometimes a bit confused about which command/environment is in the first package and not in the second package :-) – Franck Pastor Mar 25 '14 at 18:56
• I had loaded mathtools package before I tried it, but result was undefined sequence. Usage of matrix – this solution did not come to my mind. But not bad idea. – TA_Kosice Mar 25 '14 at 21:35