使用 mdframed 获取 thmtools 样式(标题和 MWE 提供的问题)

使用 mdframed 获取 thmtools 样式(标题和 MWE 提供的问题)

我正在尝试使用 实现以下输出mdframed,但无法实现。我使用 完成了下面附图中的证明thmtools,但我放弃了它,因为我的一些证明非常长,我想将它们拆分到各个页面,以避免在某些页面末尾出现较大的空白(这显然是 thmtools 无法轻松处理的)。我能得到的是:

OBTAINED OUTPUT

但我尝试复制的输出应如下所示:

DESIRED OUTPUT

如您所见,我需要的是:

(a)标题与正文在同一行。

(b)在被证明的定理的名称之前添加“证明”一词。

(c)“证明”和被证明定理的标题之间有一条长水平破折号。

(d)被证明的定理标题后面有一个冒号。

这有意义吗?在这里,您可以找到一个 MWE,它复制了我得到的结果(除了字体和数学颜色;因为这些与我的问题无关,只会使代码变得更加复杂)。

\documentclass[a4paper]{report}
\pagestyle{plain}

\usepackage[dvipsnames]{xcolor}
\usepackage{amsmath, mathtools, amsthm, mathrsfs, amssymb}
\usepackage{mdframed}
\let\proof\relax
\let\endproof\relax
\newmdenv[linecolor=Gray,frametitle=Proof]{proof}

\begin{document}
\begin{proof}[frametitle={\textbf{von-Neumann--Morgenstern Expected Utility Theorem I}}]
Let's prove that if there exists $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$, a preference $\succsim$ on $\mathcal{L}(X)$ satisfies X and Y. Assume there exists a utility function $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$ representing $\succsim$ such that $U$ satisfies the expected utility property.
\begin{enumerate}
    \item To show that $\succsim$ \textbf{is continuous}, let $x,y,z \in \mathcal{L}(X)$ such that $x \succ y \succ z$. Since $U$ represents $\succsim$, $U(x) > U(y) > U(z)$. The set of real numbers is convex; and hence there exists $p \in (0,1)$ such that $p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. By the expected utility property, $U(p \odot x \oplus (1-p) \odot z) = p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. Since $U$ represents $\succsim$, $p \odot x \oplus (1-p) \odot z \sim y$. Now, let $q,r \in [0,1]$ be such that $q >p>r$. Then:
    \begin{flalign*}
        && q \cdot U(x) + (1-q) \cdot U(z) & > p \cdot U(x) + (1-p) \cdot U(z)\\
        && &> r \cdot U(x) + (1-r)\cdot U(z)
    \end{flalign*}

    And by the expected utility property, and the hypothesis that $U$ represents $\succsim$, it follows that $q \odot x \oplus (1-q) \odot z \succ y \succ r \odot x \oplus (1-r) \odot z$.
    \item To show that $\succsim$ \textbf{satisfies independence}, let $x,y,z \in \mathcal{L}(X)$ and let $p \in [0,1]$. Since $U$ represents $\succsim$, $x \succ y \Longleftrightarrow U(x) > U(y)$. Hence, $x \succ y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) > p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \succ y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \succ [p \odot y \oplus (1-p) \odot z]$. Since $U$ represents $\succsim$, $x \sim y \Longleftrightarrow U(X) = U(y)$. Hence, $x \sim y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) = p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \sim y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \sim [p \odot y \oplus (1-p) \odot z]$.
\end{enumerate}
\end{proof}

\end{document}

有人能帮我吗?提前感谢大家的时间。

答案1

https://tex.stackexchange.com/a/185168/36296

\documentclass[a4paper]{report}

\usepackage{amsmath, amssymb, amsthm}
\usepackage{mdframed}

\newtheoremstyle{mystyle}%                % Name
  {0pt}%                                     % Space above
  {}%                                     % Space below
  {\itshape}%                             % Body font
  {}%                                     % Indent amount
  {\bfseries}%                            % Theorem head font
  {:}%                                    % Punctuation after theorem head
  { }%                                    % Space after theorem head, ' ', or \newline
  {\thmname{#1} -- \thmnote{#3}}%       % Theorem head spec (can be left empty, meaning `normal')
\theoremstyle{mystyle}

\let\proof\relax
\let\endproof\relax

\newmdtheoremenv[innerleftmargin=0.1cm,innerrightmargin=0.1cm,innertopmargin=0.1cm,innerbottommargin=0.1cm]{proof}{Proof}

\AtEndEnvironment{proof}{\hfill$\square$}%

\begin{document}
\begin{proof}[von-Neumann--Morgenstern Expected Utility Theorem I]
Let's prove that if there exists $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$, a preference $\succsim$ on $\mathcal{L}(X)$ satisfies X and Y. Assume there exists a utility function $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$ representing $\succsim$ such that $U$ satisfies the expected utility property.
\begin{enumerate}
    \item To show that $\succsim$ \textbf{is continuous}, let $x,y,z \in \mathcal{L}(X)$ such that $x \succ y \succ z$. Since $U$ represents $\succsim$, $U(x) > U(y) > U(z)$. The set of real numbers is convex; and hence there exists $p \in (0,1)$ such that $p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. By the expected utility property, $U(p \odot x \oplus (1-p) \odot z) = p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. Since $U$ represents $\succsim$, $p \odot x \oplus (1-p) \odot z \sim y$. Now, let $q,r \in [0,1]$ be such that $q >p>r$. Then:
    \begin{flalign*}
        && q \cdot U(x) + (1-q) \cdot U(z) & > p \cdot U(x) + (1-p) \cdot U(z)\\
        && &> r \cdot U(x) + (1-r)\cdot U(z)
    \end{flalign*}

    And by the expected utility property, and the hypothesis that $U$ represents $\succsim$, it follows that $q \odot x \oplus (1-q) \odot z \succ y \succ r \odot x \oplus (1-r) \odot z$.
    \item To show that $\succsim$ \textbf{satisfies independence}, let $x,y,z \in \mathcal{L}(X)$ and let $p \in [0,1]$. Since $U$ represents $\succsim$, $x \succ y \Longleftrightarrow U(x) > U(y)$. Hence, $x \succ y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) > p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \succ y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \succ [p \odot y \oplus (1-p) \odot z]$. Since $U$ represents $\succsim$, $x \sim y \Longleftrightarrow U(X) = U(y)$. Hence, $x \sim y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) = p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \sim y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \sim [p \odot y \oplus (1-p) \odot z]$.
\end{enumerate}
\end{proof}

\end{document}

enter image description here

答案2

我建议使用更简单的framed环境选项ntheorem。一个优点是即使证明以显示的方程式结尾,也可以自动(正确)放置 qed 符号。它由选项激活thmmarks

我重新定义了nonumberplain名称下的预定义样式myproof,以便在环境名称和可选参数之间加入破折号,代替一对括号。

enumerate另外,我还通过 获得了框架内环境的更好的布局enumitem

\documentclass[a4paper]{report}
\pagestyle{plain}
\usepackage{geometry}%
 \usepackage[dvipsnames]{xcolor}
\usepackage{amsmath, mathtools, mathrsfs, amssymb}
\usepackage{framed, enumitem} %
\usepackage[framed, thref, amsmath, thmmarks]{ntheorem} %
\makeatletter
\newtheoremstyle{myproof}%
{\item[\theorem@headerfont\hskip\labelsep ##1\theorem@separator]}%
{\item[\theorem@headerfont\hskip \labelsep ##1~---~##3\theorem@separator]}
\makeatother
\theoremheaderfont{\bfseries}
\theorembodyfont{\mdseries}
\theoremseparator{:}
\theoremsymbol{\ensuremath{\square}}
\theoremstyle{myproof}
\newframedtheorem{proof}{Proof}

\begin{document}

\begin{proof}[von\,Neumann-Morgenstern Expected Utility Theorem I]
Let's prove that if there exists $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$, a preference $\succsim$ on $\mathcal{L}(X)$ satisfies X and Y. Assume there exists a utility function $U: \mathcal{L}(X) \longrightarrow \mathbb{R}$ representing $\succsim$ such that $U$ satisfies the expected utility property.
\begin{enumerate}[wide=0pt, leftmargin=*]
    \item To show that $\succsim$ \textbf{is continuous}, let $x,y,z \in \mathcal{L}(X)$ such that $x \succ y \succ z$. Since $U$ represents $\succsim$, $U(x) > U(y) > U(z)$. The set of real numbers is convex; and hence there exists $p \in (0,1)$ such that $p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. By the expected utility property, $U(p \odot x \oplus (1-p) \odot z) = p \cdot U(x) + (1-p) \cdot U(z) = U(y)$. Since $U$ represents $\succsim$, $p \odot x \oplus (1-p) \odot z \sim y$. Now, let $q,r \in [0,1]$ be such that $q >p>r$. Then:
    \begin{flalign*}
        && q \cdot U(x) + (1-q) \cdot U(z) & > p \cdot U(x) + (1-p) \cdot U(z)\\
        && &> r \cdot U(x) + (1-r)\cdot U(z)
    \end{flalign*}

    And by the expected utility property, and the hypothesis that $U$ represents $\succsim$, it follows that $q \odot x \oplus (1-q) \odot z \succ y \succ r \odot x \oplus (1-r) \odot z$.
    \item To show that $\succsim$ \textbf{satisfies independence}, let $x,y,z \in \mathcal{L}(X)$ and let $p \in [0,1]$. Since $U$ represents $\succsim$, $x \succ y \Longleftrightarrow U(x) > U(y)$. Hence, $x \succ y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) > p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \succ y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \succ [p \odot y \oplus (1-p) \odot z]$. Since $U$ represents $\succsim$, $x \sim y \Longleftrightarrow U(X) = U(y)$. Hence, $x \sim y \Longleftrightarrow p \cdot U(x) + (1-p) \cdot U(z) = p \cdot U(y) + (1-p) \cdot U(z)$. Since $U$ satisfies the expected utility property, $x \sim y \Longleftrightarrow [p \odot x \oplus (1-p) \odot z] \sim [p \odot y \oplus (1-p) \odot z]$.
\end{enumerate} %
\end{proof}

\end{document} 

enter image description here

相关内容