如何设置计数器以便从定理继续例子?

如何设置计数器以便从定理继续例子?

我有以下几行:

\documentclass[a4paper, 12pt, twoside]{thesis}

\usepackage{verbatim} 
\usepackage{amssymb,amsmath}
\usepackage{amsthm,amsfonts,amscd,amsrefs}
\newtheoremstyle{component}{}{}{}{}{\itshape}{.}{.5em}{\thmnote{#3}#1}
    \theoremstyle{component}
    \newtheorem*{component}{}

\begin{document}
\chapter{New Chapter}

\begin{definition}
This is a definition.
\end{definition}

\begin{theorem}
This is a theorem.
\end{theorem}

\begin{example}
This is an example.
\end{example}

\end{document}
  1. \theoremstyle{component}{} 到底起什么作用?
  2. 我如何使示例的计数器遵循定理/定义/引理并仅在新的部分刷新?

答案1

添加到你的序言中

\let\theexample\thetheorem
\let\oldexample\example\let\eoldexample\endexample
\renewenvironment{example}{%
\refstepcounter{theorem}\oldexample}{\eoldexample}

相关内容