定理、引理、定义等的不同计数器,

定理、引理、定义等的不同计数器,

我不知道如何为定理、引理、定义、观察、推论、例子和练习创建不同的计数器。我希望将这些计数为章节.节.小节编号,其中“数字”表示定理、引理……的数量。例如,我想要这样的东西:

定理(Pytagora)---1.1.1.1

引理(Zorn)---1.1.1.1

凯莱-汉密尔顿定理---1.1.1.2

推论(定理 1.1.1.2 的推论)--- 1.1.1.2.a

定义(柯西继承)---1.1.1.1

我希望你能帮助,非常感谢。

答案1

我回答我的问题:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{stix}

%(Re)newcommands

\renewcommand\qedsymbol{$\blacksquare$}

%New 8 counters

\newtheorem{theorem}{Theorem}[subsection]

\newtheorem{definition}{Definition}[subsection]

\newtheorem{lemma}{Lemma}[subsection]

\newtheorem{corollary}{Corollary}[subsection]

\newtheorem{proposition}{Proposition}[subsection]

\newtheorem{example}{Example}[subsection]

\newtheorem{exercise}{Exercise}[subsection]

\newtheorem{observation}{Observation}[subsection]

%New Theorems

\newcommand{\namedtheoremname}{}
\newtheorem{namedtheoreminner}[theorem]{\protect\namedtheoremname}
\newenvironment{namedtheorem}[1]
{%
\renewcommand{\namedtheoremname}{#1}%
\begin{namedtheoreminner}%
}
{\end{namedtheoreminner}}

%New Definitions

\newcommand{\nameddefinitionname}{}
\newtheorem{nameddefinitioninner}[definition]{\protect\nameddefinitionname}
\newenvironment{nameddefinition}[1]
{%
\renewcommand{\nameddefinitionname}{#1}%
\begin{nameddefinitioninner}%
}
{\end{nameddefinitioninner}}

%New Lemmas

\newcommand{\namedlemmaname}{}
\newtheorem{namedlemmainner}[lemma]{\protect\namedlemmaname}
\newenvironment{namedlemma}[1]
{%
\renewcommand{\namedlemmaname}{#1}%
\begin{namedlemmainner}%
}
{\end{namedlemmainner}}

%New Corollaries

\newcommand{\namedcorollaryname}{}
\newtheorem{namedcorollaryinner}[corollary]{\protect\namedcorollaryname}
\newenvironment{namedcorollary}[1]
{%
\renewcommand{\namedcorollaryname}{#1}%
\begin{namedcorollaryinner}%
}
{\end{namedcorollaryinner}}

%New Propositions

\newcommand{\namedpropositionname}{}
\newtheorem{namedpropositioninner}[proposition]{\protect\namedpropositionname}
\newenvironment{namedproposition}[1]
{%
\renewcommand{\namedpropositionname}{#1}%
\begin{namedpropositioninner}%
}
{\end{namedpropositioninner}}


%New Examples

\newcommand{\namedexamplename}{}
\newtheorem{namedexampleinner}[example]{\protect\namedexamplename}
\newenvironment{namedexample}[1]
{%
\renewcommand{\namedexamplename}{#1}%
\begin{namedexampleinner}%
}
{\end{namedexampleinner}}


%New Exercises

\newcommand{\namedexercisename}{}
\newtheorem{namedexerciseinner}[exercise]{\protect\namedexercisename}
\newenvironment{namedexercise}[1]
{%
\renewcommand{\namedexercisename}{#1}%
\begin{namedexerciseinner}%
}
{\end{namedexerciseinner}}

%New Observations

\newcommand{\namedobservationname}{}
\newtheorem{namedobservationinner}[observation]{\protect\namedobservationname}
\newenvironment{namedobservation}[1]
{%
\renewcommand{\namedobservationname}{#1}%
\begin{namedobservationinner}%
}
{\end{namedobservationinner}}



\title{Theorem Proof, Stack}

\author{Name, Surname}
\begin{document}

\maketitle

\chapter{First Chapter}

\section{Theorems}
\subsection{Theorems}
\begin{namedtheorem}{First Theorem}
Statement.
\end{namedtheorem}
\begin{proof}
Its Proof.
\end{proof}

\begin{nameddefinition}{First Definition}

\end{nameddefinition}

\begin{nameddefinition}{Second Definition: Cauchy's Succession}
\end{nameddefinition}

\begin{namedlemma}{Zorn's Lemma}
Statement.
\begin{proof}
Its Proof.
\end{proof}
\end{namedlemma}

\end{document}

请观察这一点:

%New 8 counters

\newtheorem{theorem}{Theorem}[subsection]

\newtheorem{definition}{Definition}[subsection]

\newtheorem{lemma}{Lemma}[subsection]

\newtheorem{corollary}{Corollary}[subsection]

\newtheorem{proposition}{Proposition}[subsection]

\newtheorem{example}{Example}[subsection]

\newtheorem{exercise}{Exercise}[subsection]

\newtheorem{observation}{Observation}[subsection]

通过这种方式,可以创建新的计数器,然后像这样使用它们自己:

% This is the main template for particular \LeTeX--Functions %

\newcommand{\namednewcountername}{}
\newtheorem{namednewcounterinner}[newcounter]{\protect\namednewcountername}
\newenvironment{namednewcounter}[1]
{%
\renewcommand{\namednewcountername}{#1}%
\begin{namednewcounterinner}%
}
{\end{namednewcounterinner}}

在这里您可以用定理、引理、命题等替换新计数器。

谢谢

相关内容