[Tex/LaTex] Include section number in list number


As a follow-up to this question, I'd like to know if it is possible to automatically include the current section number, including all nesting levels, in the list number. How do I accomplish this?

Example of what I want:

\section{This is section 1}
    \item This item has number 1.1.
    \item This item has number 1.2.
      \item This item has number 1.2.1.

  \subsection{This is section 1.1}
      \item This item has number 1.1.1.
      \item This item has number 1.1.2.
% etcetera...

Best Answer

You could redefine \theenumi using \thesection:


In that case omit \pointedenum, it would destroy that redefinition.

That may also be done using \thesubsection.

Alternatively, here's code using the enumitem package:


Using enumitem you're able to continue numbering by \begin{enumerate}[resume] if you like.