在不改变字体大小的情况下减小 prooftree 的宽度

在不改变字体大小的情况下减小 prooftree 的宽度

如何在不改变字体大小的情况下更改以下 prooftree 的宽度?我想删除 T1 和 T5 之间的大空间

\begin{prooftree}
    %T1
    \AxiomC{$\langle {\tt y:=1}, s \rangle \to s_{13}$}
    %T2
    \AxiomC{$\langle {\tt y:=y \star x}, s_{13} \rangle \to s_{33}$}
    \AxiomC{$\langle {\tt x:=x-1}, s_{33} \rangle \to s_{32}$}
    \BinaryInfC{$\langle {\tt y:=y \star x; x:=x-1)}, s_{13} \rangle \to s_{32}$}
    %T3
    \AxiomC{$\langle {\tt y:=y \star x}, s_{32} \rangle \to s_{62}$}
    \AxiomC{$\langle {\tt x:=x-1}, s_{62} \rangle \to s_{61}$}
    \BinaryInfC{$\langle {\tt y:=y \star x; x:=x-1}, s_{32} \rangle \to s_{61}$}
    %T4
    \AxiomC{$\langle {\tt while \ \neg(x=1) \ do \ (y:=y \star x; x:=x-1)}, s_{61} \rangle \to s_{61}$}
    \BinaryInfC{$\langle {\tt while \ \neg(x=1) \ do \ (y:=y \star x; x:=x-1)}, s_{13} \rangle \to s_{61}$}

    %T5
    \BinaryInfC{$\langle {\tt while \ \neg(x=1) \ do \ (y:=y \star x; x:=x-1)}, s_{13} \rangle \to s_{61}$}
    \BinaryInfC{$\langle {\tt y:=1; \ while \ \neg(x=1) \ do \ (y:=y \star x; x:=x-1)}, s \rangle \to s_{61}$}
\end{prooftree}

答案1

可以通过在 T1 末尾添加负空格来减少 T1 和 T5 之间的空间,例如:

%T1
\AxiomC{$\langle {\tt y:=1}, s \rangle \to s_{13}$\kern-3em}

完整示例:

\documentclass{article}
\usepackage{bussproofs}
\usepackage[a3paper,margin=0pt]{geometry}

\begin{document}
\begin{prooftree}
    %T1
    \AxiomC{$\langle {\tt y:=1}, s \rangle \to s_{13}$\kern-3em}
    %T2
    \AxiomC{$\langle {\tt y:=y \star x}, s_{13} \rangle \to s_{33}$}
    \AxiomC{$\langle {\tt x:=x-1}, s_{33} \rangle \to s_{32}$}
    \BinaryInfC{$\langle {\tt y:=y \star x; x:=x-1)}, s_{13} \rangle \to
    s_{32}$}
    %T3
    \AxiomC{$\langle {\tt y:=y \star x}, s_{32} \rangle \to s_{62}$}
    \AxiomC{$\langle {\tt x:=x-1}, s_{62} \rangle \to s_{61}$}
    \BinaryInfC{$\langle {\tt y:=y \star x; x:=x-1}, s_{32} \rangle \to
    s_{61}$}
    %T4
    \AxiomC{$\langle {\tt while \ \neg(x=1) \ do \ (y:=y \star x; x:=x-1)},
s_{61} \rangle \to s_{61}$}
    \BinaryInfC{$\langle {\tt while \ \neg(x=1) \ do \ (y:=y \star x;
x:=x-1)}, s_{13} \rangle \to s_{61}$}

    %T5
    \BinaryInfC{$\langle {\tt while \ \neg(x=1) \ do \ (y:=y \star x;
x:=x-1)}, s_{13} \rangle \to s_{61}$}
    \BinaryInfC{$\langle {\tt y:=1; \ while \ \neg(x=1) \ do \ (y:=y \star
x; x:=x-1)}, s \rangle \to s_{61}$}
\end{prooftree}
\end{document}

结果

但是,最长一行(第 2 行)的文本本身就大约有 20 厘米。除非校样设置为横向或更大的纸张尺寸,否则需要使用其他方法来减小宽度:

  • 缩放,但字体可能太小。
  • 多行条目,例如通过环境array
  • ...

相关内容