在 LaTeX 中编号的最佳方法

在 LaTeX 中编号的最佳方法

我以前用过枚举器,在用首字母编号(如 2a、2b 等)时,枚举器很有用。但现在我遇到了问题,我想将问题编号为 2.1.1、2.1.2。我尝试使用枚举器

\textbf{Question 2.1}\\
\HRule
\begin{enumerate}[(2.1.1)]\itemsep1pt

\end{enumerate}

但这给了我错误,处理这种情况的最佳方法是什么?

答案1

你可以使用列表环境轻松完成此操作

以下摘自http://www.maa.org/latex/ltx-260.html

\documentclass{amsart}
\begin{document} 

\newcounter{Lcount}

\begin{list}{2.1.\arabic{Lcount}}{\usecounter{Lcount}\setlength{\rightmargin}{\leftmargin}}
\item $f(x)=x^2$ Find $f'(x)$
\item What is an antiderivative of $f(x)=x^2$
\end{list}
\end{document}

不过,我同意对问题进行硬编码编号是一种不好的做法。但如果你只是自己做考试,我可以理解你为什么会这样做。

相关内容