
重複の可能性あり:
定理カウンタをリセットする: \sections および (欠落している) \subsections
次のように新しいカウンターを作成します。
\newcounter{question}[section]
したがって、各新しいセクションはthequestion
1 に設定されます。次の操作を実行すると、
\newcounter{question}[subection]
thequestion
新しいセクション (サブセクションなし) が始まると 1 に設定されません。セクションとサブセクションの両方にカウンターをリンクすることは可能ですか?
ありがとう
答え1
パッケージを使用してchngcntr
、次のように記述します。
\counterwithin{question}{subsection}
またはsection
、効果は同じになるはずです。
それ以外の場合は、自分でリセットを定義することができます
\makeatletter
\@addtoreset{question}{subsection}
\makeatother