我有以下“表格”:
\begin{align}
1.&\gamma &\text{Hyp}\nonumber\\
2.&\neg \gamma &\text{Hyp}\nonumber\\
3.&(\gamma\implies(\neg\alpha\implies \gamma))&\text{AX1}\nonumber\\
4.&(\neg\alpha\implies\gamma)&\text{MP (1,3)}\nonumber\\
5.&(\neg \gamma \implies (\neg \alpha \implies \neg \gamma))&\text{AX1}\nonumber\\
6.&(\neg \alpha \implies \neg \gamma)&\text{MP(2,5)}\nonumber\\
7.&((\neg \alpha \implies\neg \gamma) \implies ((\neg \alpha \implies \gamma)\implies \alpha))&\text{AX3}\nonumber\\
8.&((\neg \alpha \implies \gamma) \implies \alpha)) &\text{MP(6,7)}\nonumber\\
9.& \alpha.&\text{MP(4,8)}\nonumber
\end{align}
看起来像这样:
我希望数字 1. 、 2. 等与公式的开头之间留出更多空间,并且希望文本处于现在的位置,但与首字母对齐(我希望单词 AX1 和 MP(1,3) 的“A”和“M”位于同一“列”中)。
有什么简单的方法可以做到这一点吗?
答案1
使用alignat*
(* 版本可以节省您输入 9 次的时间\nonumber
),或者使用tabular
环境:
\documentclass[12pt]{report}
\usepackage{amsmath}
\usepackage{array}
\begin{document}
\begin{alignat*}{3}
1. & \quad & & \gamma & & \text{Hyp} \\
2. & & & \neg \gamma & & \text{Hyp} \\
3. & & & (\gamma\implies(\neg\alpha\implies \gamma)) & & \text{AX1} \\
4. & & & (\neg\alpha\implies\gamma) & & \text{MP (1,3)} \\
5. & & & (\neg \gamma \implies (\neg \alpha \implies \neg \gamma)) & & \text{AX1} \\
6. & & & (\neg \alpha \implies \neg \gamma) & & \text{MP(2,5)} \\
7. & & & ((\neg \alpha \implies\neg \gamma) \implies ((\neg \alpha \implies \gamma)\implies \alpha)) & \qquad & \text{AX3} \\
8. & & & ((\neg \alpha \implies \gamma) \implies \alpha)) & & \text{MP(6,7)} \\
9. & & & \alpha. & & \text{MP(4,8)}
\end{alignat*}
\vskip1cm
\newcounter{rowcnt}\setcounter{rowcnt}{0}
\begin{tabular}{>{\refstepcounter{rowcnt}\therowcnt.\quad$}l<{$}@{\qquad}l}
\gamma & Hyp \\
\neg \gamma & Hyp \\
(\gamma\implies(\neg\alpha\implies \gamma)) & AX1 \\
(\neg\alpha\implies\gamma) & MP (1,3) \\
(\neg \gamma \implies (\neg \alpha \implies \neg \gamma)) & AX1 \\
(\neg \alpha \implies \neg \gamma) & MP(2,5) \\
((\neg \alpha \implies\neg \gamma) \implies ((\neg \alpha \implies \gamma)\implies \alpha)) & AX3 \\
((\neg \alpha \implies \gamma) \implies \alpha)) &MP(6,7) \\
\alpha. & MP(4,8)
\end{tabular}
\end{document}