类似定理的环境:斜体校正和结束标记放置

类似定理的环境:斜体校正和结束标记放置

您将如何定义类似定理的环境以便:(1)定理以斜体显示并用斜体校正,以及(2)证明结束标记直接出现在文本之后?

答案1

这是一个使用mathtools和的解决方案ntheorem,但我想看看 能实现什么效果amsthm。不过,当证明以编号方程式结尾时,不能保证这会起作用。

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

\makeatletter
\gdef\endtrivlist{%
    \@endtrivlist{\PotEndMark{\unskip\nobreak\hskip\labelsep\nobreak}}}
\gdef\@endtheorem{%
    \expandafter
    \ifx\csname\InTheoType Symbol\endcsname\@empty\setendmarkfalse\fi
    \@endtrivlist{\ifsetendmark
        \unskip\nobreak\hskip\labelsep\nobreak\csname\InTheoType Symbol\endcsname
        \setendmarkfalse \fi}%
    \ifsetendmark\OrganizeTheoremSymbol\else\global\setendmarktrue\fi
    \csname\InTheoType @postwork\endcsname}
\makeatother

\qedsymbol{\ensuremath{\blacksquare}}
\theoremstyle{plain}
\theoremsymbol{}
\theoremheaderfont{\scshape}
\theorembodyfont{\itshape\mathtoolsset{mathic=true}}
\theoremseparator{.}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\theoremheaderfont{\itshape}
\theorembodyfont{\upshape}
\theoremstyle{nonumberplain}
\theoremsymbol{\the\qedsymbol}
\newtheorem{proof}{Proof}

\begin{document}
\section{Section}
\begin{lemma}
    If \(U\) or \(V\) then...
    \begin{proof}
        The Proof.
    \end{proof}
\end{lemma}
\begin{theorem}
    If \(U\) or \(V\) then...
    \begin{proof}
        The Proof
        \begin{equation*}
            Ax = b.
        \end{equation*}
    \end{proof}
\end{theorem}
\end{document}

在此处输入图片描述 在此处输入图片描述

答案2

根据奥黛丽的回答,我想出了这个解决方法amsthm

\documentclass{article}

\usepackage{amsthm}
\usepackage{amssymb,amsmath}
\newtheorem{mytheorem}{Theorem}[section]

\begin{document}

\section{Hello World}

\begin{mytheorem}
If \(U\) or \(V\) then...

\begin{proof}[Proof]
\renewcommand{\qedsymbol}{}
The Proof. $\square$
\end{proof}
\end{mytheorem}

\begin{mytheorem}
If \(U\) or \(V\) then...

\begin{proof}[Proof]
The Proof
        \begin{equation*}
            Ax = b.
        \end{equation*}
\end{proof}

\end{mytheorem}

\end{document}

可能不是最优雅的方式。输出:

示例输出

相关内容