我想将以下文本左对齐。
Latex 命令:
\begin{align*}
x1&=x~(\text{$1$ is multiplicative identity})\\
&=x+x~(\text{since}~\text{ a monosemiring with an identity is idempotent too})\\
&=x+x1\\&=x+x^21\\&=x(1+x)\\\text{i.e}., x1 &=x(1+x)\\
\text{or }1&=1+x~\text{by cancellation law}\\
\text{Hence, $R$ is additively absorbing}.
\end{align*}
答案1
\intertext{}
以下是使用而不是 的建议\text{}
。
\documentclass{article}
\usepackage{mathtools} % <-- also loads amsmath.
\begin{document}
\section*{Your Code}
\begin{align*}
x1&=x~(\text{$1$ is multiplicative identity})\\
&=x+x~(\text{since}~\text{ a monosemiring with an identity is idempotent too})\\
&=x+x1\\&=x+x^21\\&=x(1+x)\\\text{i.e}., x1 &=x(1+x)\\
\text{or }1&=1+x~\text{by cancellation law}\\
\text{Hence, $R$ is additively absorbing}.
\end{align*}
\section*{Proposal}
\begin{align*}
x1&=x~(\text{$1$ is multiplicative identity})\\
&=x+x~(\text{since}~\text{ a monosemiring with an identity is idempotent too})\\
&=x+x1\\&=x+x^21\\&=x(1+x)\\\text{i.e}., x1 &=x(1+x)\\
\text{or }1&=1+x~\text{by cancellation law}\\
\intertext{Hence, $R$ is additively absorbing}. % <-- intertext
\end{align*}
\end{document}
更新
此次更新的动机芭芭拉的(伤人:))评论:
这只能在偶然情况下起作用。最后一行包含在对齐中时,会强制将对齐点移至该句子的末尾。将其从对齐中移除后,剩余的行将作为一个组居中,如果第二行不是那么长,该组就不会向左移动那么远。在目前的情况下,只需将最后一行完全移出对齐/显示即可。
(大胆的格式化由 Manuel 完成)
我还添加(窃取)了shortintertext
Bernard 使用的方法,以获得更完整的方法列表。
\documentclass{article}
\usepackage{mathtools} % <-- also loads amsmath.
\begin{document}
\section*{Your Code}
\begin{align*}
x1&=x~(\text{$1$ is multiplicative identity})\\
&=x+x~(\text{since}~\text{ a monosemiring with an identity is idempotent too})\\
&=x+x1\\&=x+x^21\\&=x(1+x)\\\text{i.e}., x1 &=x(1+x)\\
\text{or }1&=1+x~\text{by cancellation law}\\
\text{Hence, $R$ is additively absorbing}.
\end{align*}
\section*{Proposal 1}
\begin{align*}
x1&=x~(\text{$1$ is multiplicative identity})\\
&=x+x~(\text{since}~\text{ a monosemiring with an identity is idempotent too})\\
&=x+x1\\&=x+x^21\\&=x(1+x)\\\text{i.e}., x1 &=x(1+x)\\
\text{or }1&=1+x~\text{by cancellation law}\\
\intertext{Hence, $R$ is additively absorbing}. % <-- intertext (amsmath package)
\end{align*}
\section*{Proposal 2 (Barbara Beeton)}
\begin{align*}
x1&=x~(\text{$1$ is multiplicative identity})\\
&=x+x~(\text{since}~\text{ a monosemiring with an identity is idempotent too})\\
&=x+x1\\&=x+x^21\\&=x(1+x)\\\text{i.e}., x1 &=x(1+x)\\
\text{or }1&=1+x~\text{by cancellation law}\\
\end{align*}
Hence, $R$ is additively absorbing
\section*{Proposal 3 (Bernard)}
\begin{align*}
x1&=x~(\text{$1$ is multiplicative identity})\\
&=x+x~(\text{since}~\text{ a monosemiring with an identity is idempotent too})\\
&=x+x1\\&=x+x^21\\&=x(1+x)\\\text{i.e}., x1 &=x(1+x)\\
\text{or }1&=1+x~\text{by cancellation law}\\
\shortintertext{Hence, $R$ is additively absorbing}. % <-- shortintertext (mathtools package)
\end{align*}
\end{document}
答案2
我建议使用fleqn
来自的环境nccmath
以及最后一行\shortintertext
来自的命令mathtools
:
\documentclass{article}
\usepackage{nccmath}
\usepackage{mathtools}
\usepackage[showframe]{geometry}
\begin{document}
\begin{fleqn}
\begin{align*}
x\,1&=x\quad(\text{$1$ is multiplicative identity})\\
&=x+x\quad(\text{since a monosemiring with an identity is idempotent too})\\
&=x+x1\\&=x+x^21 \\&=x(1+x)\\\text{i.e., } x\,1 &=x(1+x)\\
\text{or }1&=1+x\quad\text{by cancellation law}\\
\shortintertext{Hence, $R$ is additively absorbing}.
\end{align*}
\end{fleqn}
\end{document}