LaTeX 计数器:如何在每个 \subsubsection 后重置计数器
\documentclass{article}\ \newcounter{testcounter}\ \setcounter{testcounter}{1}\ \begin{document}\ \section{Section 1}\ \subsubsection{Subsubsection 1.\arabic{testcounter}}\ Some text.\ \stepcounter{testcounter}\ \subsubsection{Subsubsection 1.\arabic{testcounter}}\ Some text.\ \stepcounter{testcounter}\ \subsubsection{Subsubsection 1.\arabic{testcounter}}\ Some text.\ \section{Section 2}\ \subsubsection{Subsubsection 2.\arabic{testcounter}}\ Some text.\ \stepcounter{testcounter}\ \subsubsection{Subsubsection 2.\arabic{testcounter}}\ Some text.\ \setcounter{testcounter}{1} % 重置计数器 testcounter 为 1\ \subsubsection{Subsubsection 2.\arabic{testcounter}}\ Some text.\ \end{document}
原文地址: https://www.cveoy.top/t/topic/p8ah 著作权归作者所有。请勿转载和采集!