4

How can I split the following inequality across three lines?

\documentclass[12pt]{report}
\usepackage{mathtools}

\begin{document} \begin{eqnarray}\label{hhi1} \frac{1}{q-p}\int_{p}^{q}\kappa(u)du\leq min\left{\kappa(p)\int_{0}^{1} h(r)dr +m\varphi\bigg(\kappa(p),\kappa\Big(\frac{q}{m}\Big)\bigg)\int_{0}^{1} h(1-r)dr,\kappa(q)\int_{0}^{1} h(r)dr +m\varphi\bigg(\kappa(q),\kappa\Big(\frac{p}{m}\Big)\bigg)\int_{0}^{1} h(1-r)dr\right}. \end{eqnarray} \end{document}

Mico
  • 506,678
  • 2
    Well, you definitely shouldn't use eqnarray; see here. You should probably use a multline environment, though there are other options depending on what you want: see here and here. – frabjous Apr 16 '22 at 00:22
  • multline environment ended up with errors doesn't work dear, I have also tried \begin{split} . both are not working, but in the remaining document split environment is working very well. – user402875 Apr 16 '22 at 00:42
  • 1
    "Ended up with errors" is unhelpful. What did you actually write and what errors did you get? (You can edit the question.) You may need to change \left\{ and \right\} to \Bigg\{ and \Bigg\} or do as FHZ suggests with regard to \left and \right. – frabjous Apr 16 '22 at 01:13

4 Answers4

6

Here's a solution that nests an aligned environment inside a multline environment. This allows us to draw the reader's eye to the structure of the inequality.

enter image description here

\documentclass[12pt]{report}
\usepackage{mathtools}

\begin{document} \begin{multline}\label{hhi1} \frac{1}{q-p}\int_{p}^{q}\kappa(u),du \ \begin{aligned}[b] \leq\min\biggl{ &\kappa(p)\int_{0}^{1} h(r),dr +m\varphi\Bigl(\kappa(p),\kappa\Bigl(\frac{q}{m}\Bigr)\Bigr) \int_{0}^{1} h(1-r),dr ,, \ &\kappa(q)\int_{0}^{1} h(r),dr +m\varphi\Bigl(\kappa(q),\kappa\Bigl(\frac{p}{m}\Bigr)\Bigr) \int_{0}^{1} h(1-r),dr \biggr} ,. \end{aligned} \end{multline} \end{document}

Mico
  • 506,678
  • Indeed, breaking at comma makes very clear where both arguments of \min are. I should have noticed that. – FHZ Apr 16 '22 at 02:45
4

One environment that breaks line is the split. It must be inside equation-like environment.

As you used \left\{ at the beginning, you shall add \right. before ending and breaking the line (\\). If you don't, you get a error message: Extra }, or forgotten \right. \end{split}. In consequence, as there must be a \right\} at the last line, there must be added a \left..

Also notice that \min is a math command to write the word "min" as math function while just typing min may lead to a misleading "m" times "i" times "n".

Ampersand (&) is used to define the tabulation. I organized the sums below the \leq symbol.

You may also considere using \mathrm{d} to the ds of derivatives. Check derivatives for more information.

\documentclass[12pt]{report}
\usepackage{amsmath}

\begin{document} \begin{equation}\label{hhi1} \begin{split} \frac{1}{q-p}\int_{p}^{q}\kappa(u)du & \leq \min \left{ \kappa(p)\int_{0}^{1} h(r)dr \right. \ & +m\varphi\bigg(\kappa(p),\kappa\Big(\frac{q}{m}\Big)\bigg)\int_{0}^{1} h(1-r)dr,\kappa(q)\int_{0}^{1} h(r)dr \ & \left.+m\varphi\bigg(\kappa(q),\kappa\Big(\frac{p}{m}\Big)\bigg)\int_{0}^{1} h(1-r)dr \right}. \end{split} \end{equation} \end{document}

enter image description here


Edit

Following David Carisle's advice, I change the equation block to

\begin{equation}
  \begin{split}
    \frac{1}{q-p}\int_{p}^{q}\kappa(u)du & \leq \min \left\{ \kappa(p)\int_{0}^{1} h(r)dr \right.  \\
    & + m \varphi \left. \bigg(\kappa(p),\kappa\Big(\frac{q}{m}\Big)\bigg)\int_{0}^{1} h(1-r)dr,\kappa(q)\int_{0}^{1} h(r)dr \right. \\
    & + m \varphi \left. \bigg(\kappa(q),\kappa\Big(\frac{p}{m}\Big)\bigg)\int_{0}^{1} h(1-r)dr \right\}.
  \end{split}
\end{equation}

so that the spacing between +, m \varphi and the first ( is not lost.

enter image description here

FHZ
  • 3,939
2

A small variation of @mico answer:

  • multlined (defined in mathtools package) is inserted in equation environment
  • for fraction used in variables argument is used \mfrac (defined in the nccmath package):
\documentclass[12pt]{report}
\usepackage{nccmath, mathtools}

\begin{document} \begin{equation}\label{hhi1} \begin{multlined}[0.9\linewidth] \frac{1}{q-p}\int_p^q \kappa(u), du \ \leq \min\biggl{ \kappa(p)\int_{0}^{1} h(r), dr + m \varphi\left(\kappa(p),\kappa\Bigl(\mfrac{q}{m}\Bigr)\right) \int_{0}^{1} h(1-r), dr, \
\kappa(q)\int_0^1 h(r),dr + m \varphi\left(\kappa(q),\kappa\Bigl(\mfrac{p}{m}\Bigr)\right) \int_0^1 h(1-r), dr \biggr} \end{multlined} \end{equation} \end{document}

enter image description here

Zarko
  • 296,517
  • +1. Is there an advantage to embedding a multlined environment in an equation environment over employing a single multline environment? – Mico Apr 16 '22 at 23:14
  • 1
    @Mico, actually not, I only see that equation number is vertical centering (what I prefer many times). – Zarko Apr 16 '22 at 23:55
1

As you asked if is it right using align, I'm adding this alternative answer using it.

Following Mico's answer that highlights both parts of \min, and as align numbers each line, it would be nice to number each equation with some relevancy, not only a non-significant line, so I defined two generic variables A and B -- your functions with integrals -- and then the inequality is displayed using both A and B previously defined.

You may also label each line if needed.

Note: It is not necessary to align all &s. They aligned because my editor does it with a simple button press.

\documentclass[12pt]{report}
\usepackage{amsmath}
\begin{document}
\begin{align}
  A                                    & = \kappa(p)\int_{0}^{1} h(r)dr + m \varphi \bigg(\kappa(p), \kappa \Big(\frac{q}{m}\Big)\bigg)\int_{0}^{1} h(1-r)dr \\
  B                                    & = \kappa(q)\int_{0}^{1} h(r)dr + m \varphi \bigg(\kappa(q), \kappa \Big(\frac{p}{m}\Big)\bigg)\int_{0}^{1} h(1-r)dr \\
  \frac{1}{q-p}\int_{p}^{q}\kappa(u)du & \leq \min \left\{A, B \right\}
\end{align}
\end{document}

enter image description here

FHZ
  • 3,939