我想知道是否有可能在一系列方程中引用定理,而无需插入诸如“根据定理 1.3,得出:”之类的文本。以下是我想要的格式:
x = 1 (Theorem 1.1)
x^2 = 1 (Theorem 1.2)
x^2 - 1 = 0 (Theorem 1.3)
(x + 1)(x - 1) = 0 (Theorem 1.4)
x + 1 = 0 (Theorem 1.5)
1 + 1 = 0 (Theorem 1.6)
2 = 0 (Theorem 1.7)
我还希望能够在一个长的链式方程中做到这一点。例如将其与align*
amsmath 的环境混合:
expr1 = expr2 (Theorem 2.1)
= expr3 (Theorem 2.2)
= expr4 (Theorem 2.3)
= expr5 (Theorem 2.4)
= ...
有可能实现这个吗?
答案1
这里有 3 种可能的参考布局。alignat
让您完全控制方程式和参考之间的间距,而flalign
将参考放在右边距:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{mathtools}
\usepackage[standard, amsmath, thmmarks]{ntheorem}
\usepackage{cleveref}
\begin{document}
\begin{theorem}\label{th:P}
A powerful theorem.
\end{theorem}
\begin{theorem}\label{th:PP}
Another powerful theorem.
\end{theorem}
\begin{flalign}
& & a + b & = c + d + e& & \text{(by \cref{th:P})}\\
& & a' + b' + e'& = c'+ d' & & \text{(by \cref{th:PP})}
\end{flalign}
\begin{align}
a' + b' + e' & = c' + d' & & \text{(by \cref{th:PP})} \\
a + b & = c + d + e & & \text{(by \cref{th:P})}
\end{align}
\begin{alignat}{2}
a' + b' + e' & = c' + d' & \qquad & \text{(by \cref{th:PP})} \\
a + b & = c + d + e & & \text{(by \cref{th:P})}
\end{alignat}
\end{document}