
我的論文有幾個章節,其中一些有章節和小節。然而,對於沒有章節的章節,定理計數器繼續將它們標記為“X.0.1,X.0.2”等......我如何擺脫這些“中間零”?我想保持其餘的編號相同,例如,
第1章
部分
定義1.1.1
定理1.1.2
ETC。
--
第2章
定義2.1
定理2.2
ETC。
答案1
有兩種選擇(您可能贊成第二種):
A:保留3位編號,但將0設定為1:
由於缺少,subsection
LaTeX 計數器不會增加subsection
1。\section{...}
\addtocounter{subsection}{1}
並且相應計數器的值會增加,就像您有一個小節一樣。
(計數器也存在於節、子節等)
B:從3位數字切換到2位數字 這有點不尋常,但可以透過以下方式實現:
\documentclass[english,11pt,a4paper]{article}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\numberwithin{theorem}{subsection}
\begin{document}
\section{One}
\subsection{Sub-One}
\begin{theorem}
content
\end{theorem}
\section{Two}
%\addtocounter{subsection}{1}
\numberwithin{theorem}{section}
\begin{theorem}
content
\end{theorem}
\end{document}
然後給出以下文檔:
請注意,您可能必須切換回「3 位數章節編號」\numberwithin{theorem}{subsection}
(當然,根據您的情況調整章節/章節/小節)。