我想在这个派生中将垂直点居中...我尝试过\center
但是点仍然在左边。\align
无法在该\ND
环境中工作。
\documentclass{article}
\usepackage{ND}
\begin{document}
\begin{ND}[][][][][\linewidth]
\vdots
\ndl{}{$A\rightarrow B_h$}{}\label{1}
\vdots
\ndl{}{$A \rightarrow (B_h \rightarrow B_i$)}{}\label{2}
\ndl{}{$(A \rightarrow (B_h\rightarrow B_i)) \rightarrow ((A \rightarrow B_h)\rightarrow (A\rightarrow B_i))$}{$\mathscr{A}_2$}\label{3}
\ndl{} {$((A \rightarrow B_h)\rightarrow (A\rightarrow B_i))$}{\ref{2}, \ref{3}, MP}\label{4}
\ndl{} {$A \rightarrow B_i$}{\ref{1}, \ref{4}, MP}\label{5}
\end{document}
谢谢。
答案1
纠正错误并用“我不知道您正在使用哪个包”以不同方式定义的命令替换已知命令,您可以尝试如下操作:
\documentclass{article}
\usepackage{ND,amsmath}
\makeatletter
\newcommand{\indl}[3]{\settowidth\@NDlwtmp{\NDalist{#1}}\ifdim\@NDlwtmp > \@NDlwf \setlength\@NDlwf{\@NDlwtmp}\fi%
\settowidth\@NDrwtmp{\widthofpbox{#3}}\ifdim\@NDrwtmp > \@NDrwf \setlength\@NDrwf{\@NDrwtmp}\fi%
\par\@iNDlabel{#1}\begin{minipage}[t]{\@NDboxwidth}\mbox{}\hfill#2\hfill\mbox{}\end{minipage}\@NDrules{#3}\par\addvspace{\parsep}}
\newcommand\@iNDlabel[1]{\begin{minipage}[t]{\csname @NDlw\@NDident\endcsname}%
\hfill\end{minipage}\makebox[2\@NDitemsep][c]{}}
\makeatother
\begin{document}
\begin{ND}[][][][][\linewidth]
\indl{}{\vdots}{}
\ndl{}{$A\rightarrow B_h$}{}\label{1}
\indl{}{\vdots}{}
\ndl{}{$A \rightarrow (B_h \rightarrow B_i$)}{}\label{2}
\ndl{}{$(A \rightarrow (B_h\rightarrow B_i)) \rightarrow ((A \rightarrow B_h)\rightarrow (A\rightarrow B_i))$}{$\mathcal{A}_2$}\label{3}
\ndl{} {$((A \rightarrow B_h)\rightarrow (A\rightarrow B_i))$}{\ref{2}, \ref{3}, MP}\label{4}
\ndl{} {$A \rightarrow B_i$}{\ref{1}, \ref{4}, MP}\label{5}
\end{ND}
\end{document}
就我个人而言,我不会将点置于中心:
\documentclass{article}
\usepackage{ND,amsmath}
\makeatletter
\newcommand{\indl}[3]{\settowidth\@NDlwtmp{\NDalist{#1}}\ifdim\@NDlwtmp > \@NDlwf \setlength\@NDlwf{\@NDlwtmp}\fi%
\settowidth\@NDrwtmp{\widthofpbox{#3}}\ifdim\@NDrwtmp > \@NDrwf \setlength\@NDrwf{\@NDrwtmp}\fi%
\par\@iNDlabel{#1}\begin{minipage}[t]{\@NDboxwidth}\hskip 1.5em #2\end{minipage}\@NDrules{#3}\par\addvspace{\parsep}}
\newcommand\@iNDlabel[1]{\begin{minipage}[t]{\csname @NDlw\@NDident\endcsname}%
\hfill\end{minipage}\makebox[2\@NDitemsep][c]{}}
\makeatother
\begin{document}
\begin{ND}[][][][][\linewidth]
\indl{}{\vdots}{}
\ndl{}{$A\rightarrow B_h$}{}\label{1}
\indl{}{\vdots}{}
\ndl{}{$A \rightarrow (B_h \rightarrow B_i$)}{}\label{2}
\ndl{}{$(A \rightarrow (B_h\rightarrow B_i)) \rightarrow ((A \rightarrow B_h)\rightarrow (A\rightarrow B_i))$}{$\mathcal{A}_2$}\label{3}
\ndl{} {$((A \rightarrow B_h)\rightarrow (A\rightarrow B_i))$}{\ref{2}, \ref{3}, MP}\label{4}
\ndl{} {$A \rightarrow B_i$}{\ref{1}, \ref{4}, MP}\label{5}
\end{ND}
\end{document}
答案2
下载nd3.sty
自http://www.logicmatters.net/latex-for-logicians/nd/
\documentclass{article}
\usepackage[pass,showframe]{geometry} % just for the example
\usepackage{mathrsfs}
\usepackage{nd3}
\makeatletter
\newcommand{\nddots}{%
\par
\hspace*{\csname @NDlw\@NDident\endcsname}%
\hspace*{2\@NDitemsep}%
$\mskip\thickmuskip\smash{\vdots}\mathstrut$%
\par\addvspace{\parsep}%
}
\makeatother
\begin{document}
\begin{ND}[][][][][\linewidth]
\nddots
\ndl{\ref{1},\ref{2}}{$A\rightarrow B_h$}{}\label{1}
\nddots
\ndl{}{$A \rightarrow (B_h \rightarrow B_i$)}{}\label{2}
\ndl{}{$(A \rightarrow (B_h\rightarrow B_i)) \rightarrow ((A \rightarrow B_h)\rightarrow (A\rightarrow B_i))$}{$\mathscr{A}_2$}\label{3}
\ndl{}{$((A \rightarrow B_h)\rightarrow (A\rightarrow B_i))$}{\ref{2}, \ref{3}, MP}\label{4}
\ndl{}{$A \rightarrow B_i$}{\ref{1}, \ref{4}, MP}\label{5}
\end{ND}
\end{document}