刪除特定定理環境後的點

刪除特定定理環境後的點

以下程式碼可以從所有定理環境中刪除尾隨點。

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

在此輸入影像描述

相關內容