![我想重置每个部分下的问题编号?](https://linux22.com/image/477296/%E6%88%91%E6%83%B3%E9%87%8D%E7%BD%AE%E6%AF%8F%E4%B8%AA%E9%83%A8%E5%88%86%E4%B8%8B%E7%9A%84%E9%97%AE%E9%A2%98%E7%BC%96%E5%8F%B7%EF%BC%9F.png)
我正在使用 exsheets 输入问题和答案。当我开始新的部分时,问题编号会从上一个继续。我如何重置它并使其再次从 1 开始?以下是 MWE:
\documentclass{article}
\usepackage{exsheets}
\begin{document}
\section{One}
\begin{question}
This is question number 1 in section 1.
\end{question}
\section{two}
\begin{question}
This is question number 1 in section 2. But it is numbered as "Exercise 2" how do I make it 1?
\end{question}
\end{document}
答案1
使用包选项counter-within=section
以便在每次开始某个部分时重置问题计数器(参见 exsheets 文档第 8 章)
\documentclass{article}
\usepackage[counter-within=section]{exsheets}
\begin{document}
\section{One}
\begin{question}
This is question number 1 in section 1.
\end{question}
\section{two}
\begin{question}
This is question number 1 in section 2. But it is numbered as "Exercise 2" how do I make it 1?
\end{question}
\end{document}