在 thmtools 中重置或自定义编号

在 thmtools 中重置或自定义编号

我在 tufte-handout 课程中使用 thmtools,其样式由埃格尔用于声明与各种系统相关的属性。我搜索了Thmtools 用户指南自定义号码或在同一部分重置3.2 \declaretheorem 的已知键. 但我无法使用给出的键来解决

parent
numberwithin
within
sibling
numberlike
sharenumber
numbered

这是我的 MWE,需要进行更改的地方。

\documentclass{tufte-handout}
\usepackage{amsthm,thmtools,xcolor}

\declaretheoremstyle[
headfont=\color{blue}\normalfont\bfseries,
bodyfont=\color{black}\normalfont\itshape,
]{colored}

\declaretheorem[
style=colored,
name=Property,
]{mydef}

\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod    
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non 
proident, sunt in culpa qui officia deserunt mollit anim id est laborum
\begin{mydef}
    XYZ11
\begin{proof}
    fffddffd
\end{proof}
\end{mydef}
\begin{mydef}
    XYZ12
    \begin{proof}
        fffddffd
    \end{proof}
\end{mydef}
\begin{mydef}
    XYZ13
    \begin{proof}
        fffddffd
    \end{proof}
\end{mydef}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod    
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non 
proident, sunt in culpa qui officia deserunt mollit anim id est laborum
\begin{mydef}
    XYZ21
    \begin{proof}
        fffddffd
    \end{proof}
\end{mydef}
\begin{mydef}
    XYZ22
    \begin{proof}
        fffddffd
    \end{proof}
\end{mydef}
\end{document}

在此处输入图片描述

我想属性4.设置为属性 1.进而属性 5.就像属性 2.

答案1

您想自动重置计数器吗?

如果您允许手动设置,只需使用\setcounter{mydef}{0}之前即可再次使用mydef

无关:您可以使用lipsum包来生成虚拟文本,例如,\lipsum\lipsum[2]

\documentclass{tufte-handout}
\usepackage{amsthm,thmtools,xcolor}
\usepackage{lipsum}                 % dummy text

\declaretheoremstyle[
headfont=\color{blue}\normalfont\bfseries,
bodyfont=\color{black}\normalfont\itshape,
]{colored}

\declaretheorem[
style=colored,
name=Property,
]{mydef}

\begin{document}
\lipsum[1]
\begin{mydef}
    XYZ11
\begin{proof}
    fffddffd
\end{proof}
\end{mydef}
\begin{mydef}
    XYZ12
    \begin{proof}
        fffddffd
    \end{proof}
\end{mydef}
\begin{mydef}
    XYZ13
    \begin{proof}
        fffddffd
    \end{proof}
\end{mydef}
\lipsum[2]
\setcounter{mydef}{0}
\begin{mydef}
    XYZ21
    \begin{proof}
        fffddffd
    \end{proof}
\end{mydef}
\begin{mydef}
    XYZ22
    \begin{proof}
        fffddffd
    \end{proof}
\end{mydef}
\end{document}

在此处输入图片描述

相关内容