有没有办法对定理和定义使用 #.# 样式,但对相关示例使用 #.#.# 样式?

有没有办法对定理和定义使用 #.# 样式,但对相关示例使用 #.#.# 样式?

编辑:问题解决了。答案如下。

我希望能够用我的例子来做这样的事情:


1 数理逻辑

定理 1.1 等等

定义 1.2 blahblah

定理 1.3 等等

例 1.3.1

例 1.3.2

定义1.4


其中示例与该定理“相关”。它们实际上不必链接在一起 - 只需让编号看起来像那样。

这是 MWE

\documentclass[a4 paper,11pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[pdftex]{graphicx}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage{dsfont}
\usepackage{amsthm}
\usepackage[usenames, dvipsnames]{xcolor}
\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{mathrsfs}
\newcommand{\spacing}[1]{\phantom{space}}
\newcommand{\tourlakislogic}[1]{\textcolor{NavyBlue}{\footnotesize Source: George Tourlakis -  \emph{Mathematical Logic} (2008)} \vspace{4 mm} \normalsize}

\title{Foundations}
\author{Chris Middleton}

\begin{document}
\maketitle

\newtheorem{thm}{Theorem}[section]

\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}

\newtheorem{axiom}[thm]{Axiom}

\theoremstyle{remark}
\newtheorem*{rmk}{Remark}

\theoremstyle{definition}
\newtheorem*{exmpl}{Example}

\section{Mathematical Logic}

\begin{defn}[alphabet]
\label{alphabet}
We denote by $\mathcal{V}$ the \textbf{alphabet} consisting of

(A1) symbols for \textbf{Boolean variables} $$ p, q, r, \ldots $$
(A2) symbols for verum (true) and falsum (false), respectively $$\top \text{ and } \bot$$
(A3) brackets $$( \text{ and } )$$
(A4) Boolean \textbf{connectives} $$\neg, \wedge, \vee, \rightarrow, \equiv$$
We will use boldface letters \textbf{p} and \textbf{q} to stand for variables in formulas in which one could substitute any number of actual variables in their place.
\end{defn} 

\tourlakislogic \spacing

\begin{rmk}
We will say "variables" in place of "symbols for variables".
\end{rmk}

\spacing

\begin{defn}[string]
We call a \textbf{string} (or word or expression), over a given alphabet, any ordered sequence of the alphabet's symbols, written adjacent to each other without any visible separators (such as spaces, commas, etc.).
\end{defn}

\tourlakislogic \spacing

\begin{exmpl}
$aabba$ is a string of symbols over the alphabet $\{a,b,c,0,1,2,3\}$. Note that not all symbols in the alphabet need be used.
\end{exmpl}

现在它看起来是这样的:截屏

答案1

是的;声明example\newtheorem{exmpl}{Example}[thm];那么它将“从属于”thm计数器编号,所有定理都遵循计数器编号。如果您希望定理类型独立编号,但示例无论如何都遵循前一个定理的编号,那么会更加困难。

答案2

%\newtheorem*{exmpl}{Example}
\newtheorem{exmpl}{Example}[thm]

就足够了。

相关内容