
我建立一個新計數器如下:
\newcounter{question}[section]
因此,在每個新部分都thequestion
設定為 1。
\newcounter{question}[subection]
thequestion
當新部分開始時(沒有小節),不設定為 1。是否可以將計數器連結到section和subsection?
謝謝
答案1
您可以使用該chngcntr
包,然後編寫
\counterwithin{question}{subsection}
或者section
,效果應該是一樣的。
否則,您可以自行定義重置
\makeatletter
\@addtoreset{question}{subsection}
\makeatother