如何将定理环境垂直对齐到顶部?

如何将定理环境垂直对齐到顶部?

下面的代码呈现了下面的图片。

\documentclass[oneside,12pt]{book}

\usepackage[a4paper]{geometry}
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{ebproof}
\usepackage{cancel}

% section
\setcounter{chapter}{2}
\setcounter{section}{4}
% enumerate
\setlist[enumerate,1]{label=\thesection.\arabic*.}
\setlist[enumerate,2]{align=left,leftmargin=*}
% theorems
\newtheorem*{thm}{Theorem}
\newtheorem*{lem}{Lemma}
\newtheorem*{sol}{Solution}

\begin{document}
\begin{enumerate}
% 2.4.3
\setcounter{enumi}{2}\item Each of the following derivations
proves a sequent. Write out the sequent that it proves.
  \begin{enumerate}
  \setcounter{enumii}{1}\item
  \[
    \begin{prooftree}
      \Hypo{\phi}
      \Infer1[($\to I$)]{(\psi \to \phi)}
      \Infer1[($\to I$)]{(\phi \to (\psi \to \phi))}
    \end{prooftree}
  \]
  \begin{sol}
    \(\phi\vdash (\phi \to (\psi \to \phi))\)
  \end{sol}
  \end{enumerate}
% 2.4.4
\item Write out derivations to prove each of the following sequents.
  \begin{enumerate}
  \item \(\vdash (\phi \to (\psi \to \psi))\)
    \begin{sol}
      \begin{prooftree}
        \Hypo{\bcancel\phi^{\textcircled{\scriptsize 2}}}
        \Hypo{\cancel\psi^{\,\textcircled{\scriptsize 1}}}
        \Infer[left label=\textcircled{\scriptsize 1},
        right label=($\to$I)]1{(\psi \to \psi)}
        \Infer[left label=\textcircled{\scriptsize 2},
        right label=($\to$I)]2{(\phi \to (\psi \to \psi))}
      \end{prooftree}
    \end{sol}
  \end{enumerate}
\end{enumerate}
\end{document}

在此处输入图片描述

解决方案环境垂直对齐在 prooftree 环境的垂直中心。如何将其提升到 prooftree 环境的顶部?

答案1

您可以使用;我还做了一些其他小改动(避免警告的adjustbox命令、更好的标签)。\mathcircled

\documentclass[oneside,12pt]{book}

\usepackage[a4paper]{geometry}
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{ebproof}
\usepackage{cancel}
\usepackage{adjustbox}

% section
\setcounter{chapter}{2}
\setcounter{section}{4}
% enumerate
\setlist[enumerate,1]{label=\thesection.\arabic*.}
\setlist[enumerate,2]{align=left,leftmargin=*}
% theorems
\newtheorem*{thm}{Theorem}
\newtheorem*{lem}{Lemma}
\newtheorem*{sol}{Solution}

\newcommand{\mathcircled}[1]{\mbox{\textcircled{\scriptsize #1}}}

\begin{document}
\begin{enumerate}
% 2.4.3
\setcounter{enumi}{2}\item Each of the following derivations
proves a sequent. Write out the sequent that it proves.
  \begin{enumerate}
  \setcounter{enumii}{1}\item
  \[
    \begin{prooftree}
      \Hypo{\phi}
      \Infer1[($\to I$)]{(\psi \to \phi)}
      \Infer1[($\to I$)]{(\phi \to (\psi \to \phi))}
    \end{prooftree}
  \]
  \begin{sol}
    \(\phi\vdash (\phi \to (\psi \to \phi))\)
  \end{sol}
  \end{enumerate}
% 2.4.4
\item Write out derivations to prove each of the following sequents.
  \begin{enumerate}
  \item \(\vdash (\phi \to (\psi \to \psi))\)
    \begin{sol}
      \begin{adjustbox}{valign=t}
      \begin{prooftree}
        \Hypo{\bcancel\phi^{\mathcircled{2}}}
        \Hypo{\cancel\psi^{\,\mathcircled{1}}}
        \Infer[left label=\mathcircled{1},
        right label=$(\to I)$]1{(\psi \to \psi)}
        \Infer[left label=\mathcircled{2},
        right label=$(\to I)$]2{(\phi \to (\psi \to \psi))}
      \end{prooftree}
      \end{adjustbox}
    \end{sol}
  \end{enumerate}
\end{enumerate}
\end{document}

在此处输入图片描述

相关内容