我有这个输出(没有注释,并且对对齐有些困惑。这是此示例的代码:
\documentclass[10pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[headheight=0cm,bindingoffset=0cm]{geometry}
\usepackage{amssymb}
\usepackage[fleqn,leqno]{amsmath}
\setlength{\mathindent}{\labelsep}
\addtolength{\mathindent}{1.165ex}
\openup 1.25\jot
% increase matriced formating options https://tex.stackexchange.com/questions/2233/whats-the-best-way-make-an-augmented-coefficient-matrix
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}
}
\makeatother
\begin{document}
\begin{align*}
&\begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x \\
\end{pmatrix} &\rightarrow
\begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x \\
\end{pmatrix}\\
column1&column2&column3\\
%
&\begin{aligned}
&\text{text} \\
&r=-2 \\
&\begin{pmatrix}[ccc|c]
1 & x & x & x \\
0 & x & x & x \\
0 & x & x & x \\
\end{pmatrix} &\rightarrow L=\varnothing \\
%
&\text{text:} \\
&r=0 \\
&\begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x \\
\end{pmatrix} &\rightarrow L=
\begin{pmatrix}[ccc|c]
x \\
x \\
x \\
\end{pmatrix}\\
&\text{text:} \\
&r=1 \\
&\begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x \\
\end{pmatrix} &\rightarrow L=
\begin{pmatrix}[ccc|c]
x \\
x \\
x \\
\end{pmatrix}\\
\end{aligned}\\
&\text{text:}\\
&\begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x \\
\end{pmatrix} &\rightarrow L=
\begin{pmatrix}[ccc|c]
x \\
x \\
x \\
\end{pmatrix}\\
\end{align*}
\end{document}
我希望,第一、第二和第四个元素将与输出aligned
结束的位置对齐(水平),并且对齐环境内的箭头将水平对齐(第一个箭头的情况并非如此)。
不知何故,我不明白为什么这不是我期望的样子,请帮忙。
答案1
编辑: 从 OP 的评论中可以看出,他/她希望得到以下结果:
(红线表示文本区域边框)
最后一行方程显示的是实际文本长度超过一行的情况。使用alignat*
环境进行对齐。
\documentclass[a4paper]{article}
\usepackage[headheight=0cm,bindingoffset=0cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[fleqn,leqno]{amsmath}
\usepackage{amssymb}
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{alignat*}{4}
& \begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x
\end{pmatrix} &&& \rightarrow \begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x
\end{pmatrix} \\[1ex]
& \rlap{text} \\
& r=-2 &&& \\
& \begin{pmatrix}[ccc|c]
1 & x & x & x \\
0 & x & x & x \\
0 & x & x & x
\end{pmatrix} & \rightarrow L & = \varnothing & \\[1ex]
& \rlap{text} \\
& r=0 &&& \\
& \begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x
\end{pmatrix} & \rightarrow L & = \begin{pmatrix}[ccc|c]
x \\
x \\
x
\end{pmatrix} & \\[1ex]
& \rlap{text} \\
& r=1 &&& \\
& \begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x
\end{pmatrix} & \rightarrow L & = \begin{pmatrix}[ccc|c]
x \\
x \\
x
\end{pmatrix} & \\[1ex]
& \rlap{\parbox[t]{0.9\linewidth}{text text text text text text text text text text text text text text text text text text text text text text text text}}\\[1ex]
& \begin{pmatrix}[ccc|c]
x & x & x & x \\
x & x & x & x \\
x & x & x & x
\end{pmatrix} & \rightarrow L & = \begin{pmatrix}[ccc|c]
x \\
x \\
x
\end{pmatrix} & \\
\end{alignat*}
\end{document}