删除特定定理环境后的点

删除特定定理环境后的点

以下代码可以从所有定理环境中删除尾随的点。

\makeatletter
\xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{}
\makeatother

使用 amsthm 和 hyperref 删除定理后的点

这里的问题有点不同。有时我们只需要从某些定理环境中删除点,例如定义和下面“sta”环境中的文本。

\documentclass{article}
\usepackage{amsthm}
\usepackage{xpatch}
\newtheorem{theorem}{Theorem}
\newtheorem{definition}{Definition}


\newtheorem{sta}{\normalfont}
\renewcommand{\thesta}{(\arabic{sta})\unskip}

\makeatletter
\xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{}
\makeatother
\begin{document}

\begin{definition}
A {\it cycle} in a graph is a non-empty trail in which only the first and last vertices are equal.
\end{definition}

\begin{theorem}
An undirected graph is bipartite if and only if it does not contain an odd cycle.
\end{theorem}

First, we note that:
\begin{sta}\label{seesall}
Every bipartite graph contains no odd cycles.
\end{sta}

This prove \ref{seesall}.
\end{document} 

在此处输入图片描述

答案1

我不确定为什么你不想在定义中使用句号。我认为没有理由破坏统一性。

无论如何,正确的方法是定义合适的定理风格。

\documentclass{article}
\usepackage{amsthm}

% see https://tex.stackexchange.com/a/17555/4427
\newtheoremstyle{definitionnoperiod}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\normalfont}  % BODYFONT
  {0pt}       % INDENT (empty value is the same as 0pt)
  {\bfseries} % HEADFONT
  {}          % HEADPUNCT
  {5pt plus 1pt minus 1pt} % HEADSPACE
  {}          % CUSTOM-HEAD-SPEC
\newtheoremstyle{empty}
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\itshape}  % BODYFONT
  {0pt}       % INDENT (empty value is the same as 0pt)
  {\normalfont} % HEADFONT
  {}         % HEADPUNCT
  {5pt plus 1pt minus 1pt} % HEADSPACE
  {\thmnumber{#2}}          % CUSTOM-HEAD-SPEC

\newtheorem{theorem}{Theorem}

\theoremstyle{definitionnoperiod}
\newtheorem{definition}{Definition}

\theoremstyle{empty}
\newtheorem{sta}{}
\renewcommand{\thesta}{(\arabic{sta})}

\begin{document}

\begin{definition}
A \emph{cycle} in a graph is a non-empty trail in which only the first 
and last vertices are equal.
\end{definition}

\begin{theorem}
An undirected graph is bipartite if and only if it does not contain an odd cycle.
\end{theorem}

First, we note that:
\begin{sta}\label{seesall}
Every bipartite graph contains no odd cycles.
\end{sta}

This proves \ref{seesall}.
\end{document} 

在此处输入图片描述

请注意这{\it cycle}是错误的,原因有二:

  1. \it已被弃用约 30 年;
  2. \emph对于这种情况,只能选择上级指挥。

答案2

\documentclass[12pt]{article}
\usepackage{mathtools,amsthm,amssymb}

\newtheorem{theorem}{Theorem}

\newtheoremstyle{definitionstyle}% name
  {0pt}% space above
  {0pt}% space below
  {}% body font
  {}% indent amount
  {\bfseries}% theorem head font
  {}% punctuation after theorem head
  {0.5em}% space after theorem head
  {}% theorem head spec

\theoremstyle{definitionstyle}
\newtheorem{definition}{Definition}


\begin{document}

\begin{definition}
A function $f: A \to \mathbb{R}$ is said to be \emph{continuous at a point} $c$ in its domain $A$ if, for every $\epsilon > 0$, there exists a $\delta > 0$ such that for all $x$ in $A$, if $|x - c| < \delta$, then $|f(x) - f(c)| < \epsilon$.
\end{definition}

\begin{theorem}
If $f: [a, b] \to \mathbb{R}$ is continuous on $[a, b]$ and differentiable on $(a, b)$, then there exists at least one $c$ in $(a, b)$ such that
\[ f'(c) = \frac{f(b) - f(a)}{b - a}. \]
\end{theorem}

\end{document}

在此处输入图片描述

相关内容