![如何将方程式对齐成三列,即右对齐、居中和左对齐?](https://linux22.com/image/396363/%E5%A6%82%E4%BD%95%E5%B0%86%E6%96%B9%E7%A8%8B%E5%BC%8F%E5%AF%B9%E9%BD%90%E6%88%90%E4%B8%89%E5%88%97%EF%BC%8C%E5%8D%B3%E5%8F%B3%E5%AF%B9%E9%BD%90%E3%80%81%E5%B1%85%E4%B8%AD%E5%92%8C%E5%B7%A6%E5%AF%B9%E9%BD%90%EF%BC%9F.png)
\[\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}\]
我还不能整齐地书写。
答案1
就像这样,有eqparbox
?
\documentclass{article}
\usepackage{geometry}%
\usepackage{mathtools}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}
\begin{document}
\begin{spreadlines}{1.5ex}
\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{spreadlines}
\end{document}
答案2
您仍然可以使用array
,但需要进行一些调整。禁用默认arraycolsep
via\setlength{\arraycolsep}{0pt}
以允许默认数学间距和\renewcommand{\arraystretch}{1.5}
相似align
。最后,您还需要添加\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}
答案3
像这样?
\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}