我对 LaTeX 还很陌生(几天前我还不知道如何使用\newtheorem
),希望有人能帮助我解决以下问题。
如果我使用\usepackage{amsthm}
,如何控制定理、命题等与它们各自的证明之间的垂直间隙?特别是,我正在寻找像正常线一样跟随的证明。这是我迄今为止想到的最好的办法:
\usepackage{amthm}
\newtheoremstyle{newstyle}
{} %Aboveskip
{-.25pt} %Below skip
{\mdseries} %Body font e.g.\mdseries,\bfseries,\scshape,\itshape
{} %Indent
{\bfseries} %Head font e.g.\bfseries,\scshape,\itshape
{.} %Punctuation afer theorem header
{ } %Space after theorem header
{} %Heading
\theoremstyle{newstyle}
\newtheorem{thm}{Theorem}[section]
\newtheorem{prop}{Proposition}[thm]
\newtheorem{lem}{Lemma}
\newtheorem{cor}{Corollary}
\newenvironment{pf}
{\n\textit{Proof.}\begin{mdseries}}
{\end{mdseries}}\
但是,我有两个主要问题。首先,它%Below skip
似乎没有给我太多控制权 -{}
当我输入任何负值时,和之间会有相当大的跳跃。其次,编号被弄乱了,例如,如果我输入然后\begin{thm}...\end{thm}
(\begin{prop}...\end{prop}
例如在第 1 部分),我会得到我的输出:
定理 1.1
命题 1.1.1
谢谢你的帮助。
答案1
首先,下方的 skip 应为正数,负数将被忽略。您可以通过以下方式清除标准提供的间距:
\makeatletter
\def\thm@space@setup{\thm@preskip=0pt
\thm@postskip=0pt}
\makeatother
之前\newtheoremstyle
。您可以通过更改值0pt
或使用中的参数来调整这一点\newtheoremstyle
。
尝试
\newenvironment{pf}{\noindent\textit{Proof.}\begin{mdseries}}{\end{mdseries}}
适用于您的证明环境。如果这太过简单,例如,如果您希望拥有\qed
AMS 环境的功能,那么您可以使用以下改编的 AMS 证明代码
\makeatletter
\newenvironment{pf}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep0\p@\relax
\trivlist
\item[\hskip\labelsep\itshape
#1\@addpunct{.}]\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
\makeatother
重点是将值设置\topsep
为零。
最后,命题编号是错误的,因为你要求它在 s 内编号thm
!你应该写
\newtheorem{prop}[thm]{Proposition}
放置[thm]
在其他参数之间而不是末尾。
这是将所有内容放入一个示例文档中。
\documentclass{article}
\usepackage{amsthm}
\makeatletter
\def\thm@space@setup{\thm@preskip=0pt
\thm@postskip=0pt}
\makeatother
\newtheoremstyle{newstyle}
{} %Aboveskip
{} %Below skip
{\mdseries} %Body font e.g.\mdseries,\bfseries,\scshape,\itshape
{} %Indent
{\bfseries} %Head font e.g.\bfseries,\scshape,\itshape
{.} %Punctuation afer theorem header
{ } %Space after theorem header
{} %Heading
\theoremstyle{newstyle}
\newtheorem{thm}{Theorem}[section]
\newtheorem{prop}[thm]{Proposition}
\newtheorem{lem}{Lemma}
\newtheorem{cor}{Corollary}
\makeatletter
\newenvironment{pf}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep0\p@\relax
\trivlist
\item[\hskip\labelsep\itshape
#1\@addpunct{.}]\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
\makeatother
\begin{document}
Some text to indicate the spacing.
\begin{thm}
First theorem, with sufficiently long text so that it spills on to a
second line.
\end{thm}
Some text to indicate the spacing. Fill-up text make this spill on to
an extra line. Fill-up text make this spill on to an extra line.
More text.
\begin{prop}
A proposition, with sufficiently long text so that it spills on to a
second line.
\end{prop}
\begin{pf}
Proof of the proposition with \verb+pf+ environment and sufficiently
long text so that it spills on to a second line.
\end{pf}
\begin{prop}
Another proposition, with sufficiently long text so that it spills
on to a second line.
\end{prop}
\begin{proof}
The original proof environment and sufficiently long text so that it
spills on to a second line.
\end{proof}
\end{document}