答案1
这提供了一个足够的开始;在内部设置构造array
(可能带有嵌套):
\documentclass{article}
\usepackage{xparse,amsmath}
\makeatletter
\NewDocumentCommand{\logicstep}{ o }{%
\refstepcounter{enumi}(\theenumi)%
\IfValueT{#1}{\ltx@label{#1}}%
}
\makeatother
\newcommand{\logictitle}[1]{%
\setcounter{enumi}{0}% Restart "logic" counter
\makebox[.5\linewidth][l]{$#1$}%
}
\begin{document}
\[
\begin{array}{c}
\logictitle{A / B \rightarrow A} \\[\jot]
\begin{array}{c | l | l @{\qquad} l }
\logicstep[first] & \multicolumn{3}{l}{A} \\
\logicstep[second] & & B & \text{Supp $/~\rightarrow$ Int} \\
\logicstep[third] & & A & \text{reit \eqref{first}} \\
\logicstep & \multicolumn{1}{l}{B \rightarrow A} & & \text{$\rightarrow$ Int $\eqref{second} - \eqref{third}$}
\end{array}
\end{array}
\]
\end{document}
\logicstep[<label>]
设置第一列的编号。可选的<label>
允许您\ref
对其进行排序(使用\eqref
或其他方式)。
下面是另一个视觉效果:
\documentclass{article}
\usepackage{xparse,amsmath}
\makeatletter
\NewDocumentCommand{\logicstep}{ o }{%
\refstepcounter{enumi}(\theenumi)%
\IfValueT{#1}{\ltx@label{#1}}%
}
\makeatother
\newcommand{\logictitle}[1]{%
\setcounter{enumi}{0}% Restart "logic" counter
\makebox[.5\linewidth][l]{$#1$}%
}
\begin{document}
\[
\begin{array}{c}
\logictitle{A / C \rightarrow (B \rightarrow A)} \\[\jot]
\begin{array}{c | l | l | l @{\qquad} l }
\logicstep[first] & \multicolumn{3}{l}{A} & \multicolumn{1}{@{}l}{\text{premise}} \\
\logicstep[second] & \quad & \multicolumn{1}{|l}{C} & \multicolumn{1}{l}{} & \text{Supp, $\rightarrow$ Int} \\
\logicstep[third] & & & B & \text{Supp, $\rightarrow$ Int} \\
\logicstep[fourth] & & & A & \text{Reit \eqref{first}} \\
\logicstep[fifth] & & \multicolumn{1}{|l}{B} & \multicolumn{1}{l}{} & \text{$\rightarrow$ Int, \eqref{third}--\eqref{fourth}} \\
\logicstep & \multicolumn{3}{l}{C \rightarrow (B \rightarrow A)} & \text{$\rightarrow$ Int, \eqref{second}--\eqref{fifth}}
\end{array}
\end{array}
\]
\end{document}
现在有一个换行符:
\documentclass{article}
\usepackage{xparse,amsmath}
\makeatletter
\NewDocumentCommand{\logicstep}{ o }{%
\refstepcounter{enumi}(\theenumi)%
\IfValueT{#1}{\ltx@label{#1}}%
}
\makeatother
\newcommand{\logictitle}[1]{%
\setcounter{enumi}{0}% Restart "logic" counter
\makebox[.5\linewidth][l]{$#1$}%
}
\begin{document}
\[
\begin{array}{c}
\logictitle{A / C \rightarrow (B \rightarrow A)} \\[\jot]
\begin{array}{c | l | l | l @{\qquad} l }
\logicstep[first] & \multicolumn{3}{l}{A} & \multicolumn{1}{@{}l}{\text{premise}} \\
\logicstep[second] & \quad & \multicolumn{1}{|l}{C} & \multicolumn{1}{l}{} & \text{Supp, $\rightarrow$ Int} \\
\logicstep[third] & & & B & \text{Supp, $\rightarrow$ Int} \\
\logicstep[fourth] & & & A & \text{Reit \eqref{first}} \\
& \\[-.8\normalbaselineskip]
\logicstep[fifth] & & & B & \text{Example 1} \\
\logicstep[sixth] & & & A & \text{Example 2} \\
\logicstep[seventh] & & \multicolumn{1}{|l}{B} & \multicolumn{1}{l}{} & \text{$\rightarrow$ Int, \eqref{third}--\eqref{fourth}} \\
\logicstep & \multicolumn{3}{l}{C \rightarrow (B \rightarrow A)} & \text{$\rightarrow$ Int, \eqref{second}--\eqref{fifth}}
\end{array}
\end{array}
\]
\end{document}