6

I am trying to use the following. Unfortunately, the last line goes outside the page. How to fix this or is there another way to write the same?

\documentclass{article}
\usepackage{eqnarray,amsmath}
\begin{document}

\begin{eqnarray*}\label{alphaf}
\alpha+M(d(fx_n,fz_n))&\leq&\alpha+\alpha(fx_n,fz_m)M(d(fx_n,fz_k))\\&\leq& M(M_{f,h}(fx_n,fz))\\&=&M(x,y)\bigg(max\left\{d(fx_n,fz),d(fx_n,fx_n),d(fz,fz),\frac{d(fx_n,fz)+d(fz_b,fx_n)}{h}\right\}\bigg)
\end{eqnarray*}
\end{document}

enter image description here

Heiko Oberdiek
  • 271,626
  • "max" should not be in italics. – Andreas Rejbrand Oct 02 '16 at 23:08
  • what does the vertical rule indicate? it's neither the page boundary nor the boundary of the text block. (i assumed the latter in proposing an answer, but now that i've had a chance to test, it clearly doesn't work, and will be deleted.) – barbara beeton Oct 03 '16 at 17:09

4 Answers4

7

You have to break the too-long equation manually. Here's a way to do so it seems natural, using some spacing adjustment via \phantom:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
  \alpha + M(d(fx_n,fz_n)) &\leq \alpha + \alpha(fx_n,fz_m) M(d(fx_n,fz_k)) \\
                           &\leq M(M_{f,h}(fx_n,fz)) \\
                           &= M(x,y) \max \bigl\{ d(fx_n,fz),d(fx_n,fx_n), \\
                           &\phantom{{}={} M(x,y) \max \bigl\{}d(fz,fz),\tfrac{d(fx_n,fz)+d(fz_b,fx_n)}{h} \bigr\}
\end{align*}

\end{document}

Please avoiding using eqnarray.

Werner
  • 603,163
6

Another align*-based solution. It differs from @Werner's solution in the way the final row's indentation is achieved and in the treatment of the fractional expression in the final row.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\alpha+M(d(fx_n,fz_n))
&\leq\alpha+\alpha(fx_n,fz_m)M(d(fx_n,fz_k))\\
&\leq M(M_{f,h}(fx_n,fz))\\
&= M(x,y)\max\bigl\{ d(fx_n,fz),d(fx_n,fx_n),\\
&\qquad\qquad d(fz,fz),\tfrac{1}{h}\bigl[d(fx_n,fz)+d(fz_b,fx_n)\bigr] \bigr\}
\end{align*}
\end{document}
Mico
  • 506,678
4

I'll add three other variants:

\documentclass{article}
\usepackage[showframe]{geometry}%
 \usepackage{mathtools, nccmath}

\begin{document}

\begin{align*}
  \alpha+M(d(fx_n,fz_n))
    & \leq\alpha+α(fx_n,fz_m)M(d(fx_n,fz_k)) \\
    & \leq M(M_{f,h}(fx_n,fz)) \\
    & =\!\begin{multlined}[t] M(x,y)\max\bigl\{ d(fx_n,fz),d(fx_n,fx_n), d(fz,fz), \\[0.5ex]
  \mfrac{1}{h}\bigl[d(fx_n,fz)+d(fz_b,fx_n)\bigr] \bigr\}
  \end{multlined}
\end{align*}

\begin{align*}
  \alpha+M(d(fx_n,fz_n))
  &\leq\alpha+α(fx_n,fz_m)M(d(fx_n,fz_k))\\
  &\leq M(M_{f,h}(fx_n,fz))\\
    & =\!\begin{aligned}[t] M(x,y)\max\bigl\{ d(fx_n,fz),d(fx_n,fx_n), d(fz,fz) & , \\
  \mfrac{1}{h}\bigl[d(fx_n,fz)+d(fz_b,fx_n) & \bigr] \bigr\}
  \end{aligned}
\end{align*}

\begin{align*}
  \alpha+M(d(fx_n,fz_n))
    & \leq\alpha+α(fx_n,fz_m)M(d(fx_n,fz_k)) \\
    & \leq M(M_{f,h}(fx_n,fz)) \\
    & =\! M(x,y)\max \!\begin{Bmatrix*}[r]d(fx_n,fz),d(fx_n,fx_n), d(fz,fz), \\[0.5ex]
  \mfrac{1}{h}\bigl[d(fx_n,fz)+d(fz_b,fx_n)\bigr]
  \end{Bmatrix*}
\end{align*}

\end{document} 

enter image description here

Bernard
  • 271,350
3

You can use multlined from mathtools.

\documentclass{article}
\usepackage{amsmath,mathtools}

\usepackage{showframe} % just for this example

\begin{document}

\begin{align*}
\alpha + M(d(fx_n,fz_n))
  &\leq \alpha + \alpha(fx_n,fz_m) M(d(fx_n,fz_k)) \\
  &\leq M(M_{f,h}(fx_n,fz)) \\
  &= \!\begin{multlined}[t]
     M(x,y) \max \biggl\{ d(fx_n,fz),d(fx_n,fx_n),
     \qquad\qquad % make the top a bit wider
     \\
     d(fz,fz),\frac{d(fx_n,fz)+d(fz_b,fx_n)}{h} \biggr\}
     \end{multlined}
\end{align*}

\end{document}

Note: showframe is only used to show the text block margins

enter image description here

egreg
  • 1,121,712