刪除定理周圍的垂直空間

刪除定理周圍的垂直空間

我對 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似乎並沒有給我太多的控制權——當我輸入任何負值時,之間{}有一個相當大的跳躍。第1 節說)我會得到我的輸出:\begin{thm}...\end{thm}\begin{prop}...\end{prop}

定理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}}

為您的證明環境。如果這太簡單了,例如,如果您希望擁有\qedAMS環境的功能,那麼您可以使用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零。

thm最後,命題編號是錯誤的,因為你要求它在s內編號!你應該寫

\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}

樣本輸出

相關內容