答案1
首先,要实现 OP 所展示的内容:
\documentclass{article}
\usepackage{amsmath}
\newcommand\push{\hfill\mbox{}}
\newcommand\notate[1]{\push\qquad\rlap{$#1$}}
\begin{document}
\[
\cfrac
{\!\cfrac
{A \vee A \vdash A\push}
{\vdash \neg (A \vee A), A} \notate{(\vdash \vee)}}
{\vdash \neg (A \vee A) \vee A\push} \notate{(\vdash \vee)}
\]
\end{document}
然后,他补充道:“但我希望所有括号都对齐,并且不在分数中”。所以在这里,我稍微改变了 的定义\notate
:
\documentclass{article}
\usepackage{amsmath}
\newcommand\push{\hfill\mbox{}}
\newcommand\notate[1]{\push\rlap{\qquad$#1$}}
\begin{document}
\[
\cfrac
{\mkern-2mu\cfrac
{A \vee A \vdash A\push}
{\vdash \neg (A \vee A), A} \notate{(\vdash \vee)}}
{\vdash \neg (A \vee A) \vee A} \notate{(\vdash \vee)}
\]
\end{document}
答案2
我可以建议bussproofs
:
\documentclass{article}
\usepackage{bussproofs}
\begin{document}
\begin{prooftree}
\AxiomC{$\overline{A\vdash A}$} \AxiomC{$\overline{A\vdash A}$}
\RightLabel{$(\lor\vdash)$}
\BinaryInfC{$A\lor A\vdash A$}
\RightLabel{$(\vdash\neg)$}
\UnaryInfC{$\vdash\neg(A\lor A),A$}
\RightLabel{$(\vdash\lor)$}
\UnaryInfC{$\vdash\neg(A\lor A)\lor A$}
\end{prooftree}
\end{document}