如何在 proof 环境中删除 align* 环境的 topsep?

如何在 proof 环境中删除 align* 环境的 topsep?

这是我的代码:

\documentclass{article}
\usepackage{amsthm,amsmath}
\begin{document}
    \begin{proof}
        \begin{align*}
            F(x) & = P(X\le x)\\
                 & = P(g^{-1}(X)\le g^{-1}(x))
        \end{align*}
    \end{proof}

    \begin{proof}
        I want the formular to show on the same line with \textit{proof.}
        \begin{align*}
        F(x) & = P(X\le x)\\
             & = P(g^{-1}(X)\le g^{-1}(x))
        \end{align*}
    \end{proof}
\end{document}

输出如下: 在此处输入图片描述

我希望公式显示在“证明”一词所在的同一行上。希望得到您的帮助,并提前致谢。

答案1

像这样?

在此处输入图片描述

\documentclass{article}
\usepackage{amsthm,amsmath}
\begin{document}
    \begin{proof}\hfil   $\begin{aligned}[t]
            F(x) & = P(X\le x)\\
                 & = P(g^{-1}(X)\le g^{-1}(x))
                         \end{aligned}$

    \vskip-\baselineskip   % needed to align `qed` to bottom equation
    \end{proof}
\end{document}

答案2

您可以考虑以下ntheorem套餐:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage[amsmath,thmmarks]{ntheorem}

\begingroup
  \theoremstyle{nonumberplain}
  \theoremheaderfont{\itshape}
  \theorembodyfont{\normalfont}
  \theoremsymbol{\mbox{$\Box$}}
  \newtheorem{proof}{Proof}
\endgroup

\begin{document}

\begin{proof}
The proof of this theorem is very simple:
\begin{align*}
   1 +  1 & =  2 \\
  10 + 10 & = 20
\end{align*}
\end{proof}

\end{document}

在此处输入图片描述

相关内容