Entfernen Sie den Punkt nach einer bestimmten Theoremumgebung

Entfernen Sie den Punkt nach einer bestimmten Theoremumgebung

Der folgende Code kann den abschließenden Punkt aus allen Theoremumgebungen entfernen.

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

SehenEntfernen Sie den Punkt nach dem Theorem mit amsthm und hyperref

Das Problem ist hier etwas anders. Manchmal müssen wir nur den Punkt aus bestimmten Theoremumgebungen entfernen, beispielsweise aus Definitionen und dem Text innerhalb der „sta“-Umgebung unten.

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

Bildbeschreibung hier eingeben

Antwort1

Ich bin mir nicht sicher, warum Sie den Punkt nicht in den Definitionen haben möchten. Ich sehe keinen Grund, die Einheitlichkeit zu brechen.

Der richtige Weg besteht jedenfalls darin, geeignete Theoremstile zu definieren.

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

Bildbeschreibung hier eingeben

Bitte beachten Sie, dass dies {\it cycle}aus zwei Gründen falsch ist:

  1. \itist seit etwa 30 Jahren veraltet;
  2. \emphIn solchen Fällen ist das übergeordnete Kommando die richtige Wahl.

Antwort2

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

Bildbeschreibung hier eingeben

verwandte Informationen