答案1
例如,使用 environmentalign*
而不是 environment split
,您可以获得相同的图像输出。
编辑在@barbarabeeton (见下文) 的评论之后,使用了\colon
而不是:
。
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
a_{1,1}& = d_{1},&\\
a_{k,k-1}&= \ell_{k-1}d_{k-1},& k=2\colon\! n, \\
a_{k,k}&=d_{k}+\ell^{2}_{k-1}d_{k-1}=d_{k}+\ell_{k-1}\alpha_{k,k-1},& k=2\colon \!n.
\end{align*}
\end{document}
查看输出:
答案2
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\section{Original output}
The following resembles the original, which has the big defect of unsightly
large space around the equals signs
\[
\begin{array}{lclll}
a_{1,1} &=& d_{1}, \\
a_{k,k-1} &=& \ell_{k-1}d_{k-1}, && k=2{:}n, \\
a_{k,k} &=& d_{k}+\ell^{2}_{k-1}d_{k-1}=d_{k}+\ell_{k-1}\alpha_{k,k-1}, && k=2{:}n.
\end{array}
\]
\section{Better}
This realization has the correct spacing around the equals signs and preserves
left alignment for the first column
\[
\begin{alignedat}{3}
&a_{1,1} &&= d_{1}, \\
&a_{k,k-1} &&= \ell_{k-1}d_{k-1}, &\qquad& k=2{:}n, \\
&a_{k,k} &&= d_{k}+\ell^{2}_{k-1}d_{k-1}=d_{k}+\ell_{k-1}\alpha_{k,k-1}, &\qquad& k=2{:}n.
\end{alignedat}
\]
\end{document}
可以alignedat
精确控制列之间的空间;有三对右对齐/左对齐的列;第一列和第三列实际上是空的,而第五列仅包含空间。