# How do I align equations in three columns, justified right, center and left?

$\begin{array}{crl} &(L-\epsilon)(x-M)\leq f(x)-f(M)&\leq(L+\epsilon)(x-M)\\ \Rightarrow&(L-\epsilon)(x-M)+f(M)&\leq f(x)&\leq(L+\epsilon)(x-M)+f(M)\\ \Rightarrow&(L-\epsilon)(1-\frac{M}{x})+\frac{f(M)}{x}&\leq\frac{f(x)}{x}&\leq\frac{f(M)}{x}+(L+\epsilon)(1-\frac{M}{x}) \end{array}$


I have not been able to write in an alignment.

Something like this, with eqparbox?

\documentclass{article}
\usepackage{geometry}%
\usepackage{mathtools}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}

\begin{document}

\begin{alignat}{3}
& & (L-\epsilon)(x-M) & \leq \eqmathbox{f(x)-f(M)} & &\leq(L+\epsilon)(x-M)\\
& \Rightarrow\quad & (L-\epsilon)(x-M)+f(M)&\leq \eqmathbox{f(x)}& & \leq(L+\epsilon)(x-M)+f(M)\\
& \Rightarrow & (L-\epsilon)\biggl(1-\frac{M}{x}\biggr)+\frac{f(M)}{x}&\leq\eqmathbox{\frac{f(x)}{x}} & &\leq\frac{f(M)}{x}+(L+\epsilon)\biggl(1-\frac{M}{x}\biggr)
\end{alignat}

\end{document}


You can still use array but some adjustments are required. Disable the default arraycolsep via \setlength{\arraycolsep}{0pt} to allow default math spacing and \renewcommand{\arraystretch}{1.5} to resemble align. Finally, you need to also add \displaystyle like align.

\documentclass[a4paper]{article}
\usepackage{amsmath,array}
\begin{document}

\setlength{\arraycolsep}{0pt}
\renewcommand{\arraystretch}{1.5}
$\begin{array}{c >{\displaystyle{}}r<{{}} >{\displaystyle}c >{\displaystyle{}}l } & (L-\epsilon)(x-M)\leq f(x)-f(M)\leq & (L+\epsilon)(x-M) & \\ \Rightarrow & (L-\epsilon)(x-M)+f(M)\leq & f(x) & \leq(L+\epsilon)(x-M)+f(M)\\ \Rightarrow & (L-\epsilon)\biggl(1-\frac{M}{x}\biggr)+\frac{f(M)}{x}\leq & \frac{f(x)}{x} & \leq\frac{f(M)}{x}+(L+\epsilon)\biggl(1-\frac{M}{x}\biggr) \end{array}$

\end{document}


Like this?

\documentclass{book}

\usepackage{mathtools}

\begin{document}

$\begin{array}{crcl} & (L-\epsilon)(x-M) \leq& f(x)-f(M) &\leq (L+\epsilon)(x-M) \\ \Rightarrow & (L-\epsilon)(x-M)+f(M) \leq & f(x)&\leq(L+\epsilon)(x-M)+f(M)\\ \Rightarrow&(L-\epsilon)(1-\frac{M}{x})+\frac{f(M)}{x}\leq &\frac{f(x)}{x}&\leq\frac{f(M)}{x}+(L+\epsilon)(1-\frac{M}{x}) \end{array}$

\end{document}


• Could you post a screenshot of the result, please? – Phelype Oleinik May 26 at 12:40
• @PhelypeOleinik How do I do that? – ian May 26 at 12:40
• First take a screenshot of the generated pdf. Then click the “edit” button below your answer and then use the “Image” button to add it (see this article for some guidelines to format posts :). – Phelype Oleinik May 26 at 12:44
• @PhelypeOleinik Thank you for the explanation! – ian May 26 at 18:59