1

I'd like the numbering of items in the document to reflect the numbers of the sections in which they are found. In the MWE, the numbering is

Section 1

1.

2.

Section 2

1.

2.

What I want is:

Section 1

1.1

1.2

Section 2

2.1

2.2

How can I achieve this?

\documentclass[11pt]{article}
 
\begin{document}
%\maketitle
%\section{}
%\subsection{}

\section{Structure}
\begin{enumerate}

\item
first point
\item
Second point

\end{enumerate}

\section{Circus Tents}
\begin{enumerate}
\item
number
\item
kind
\end{enumerate}



\end{document}  

1 Answer 1

2

There are a number of ways to achieve this. First, if you're not into using packages, adjust \labelenumi by adding this to your document preamble: \renewcommand\labelenumi{\thesection.\theenumi.}. It prefixes \thesection to the default label.

enter image description here

\documentclass{article}

\renewcommand\labelenumi{\thesection.\theenumi.}

\begin{document}

\section{Structure}

\begin{enumerate}
  \item
  First point

  \item
  Second point
\end{enumerate}

\section{Circus Tents}

\begin{enumerate}
  \item
  Number

  \item
  Kind
\end{enumerate}

\end{document}

This process is made a little more easy using enumitem:

\documentclass{article}

\usepackage{enumitem}
\setlist[enumerate,1]{label=\thesection.\arabic*.}

\begin{document}

\section{Structure}

\begin{enumerate}
  \item
  First point

  \item
  Second point
\end{enumerate}

\section{Circus Tents}

\begin{enumerate}
  \item
  Number

  \item
  Kind
\end{enumerate}

\end{document}
2
  • This worked well. Assuming no aversion to packages, which would you recommend?
    – user26732
    Commented Jan 6, 2023 at 6:55
  • Go with the second (enumitem) approach, since it adds other functionality that you may be interested in. It is the go-to package for list management.
    – Werner
    Commented Jan 6, 2023 at 18:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .