2

I want to create a numbered list, where each item number is prefixed by the section number. This answer shows how to make customized prefixes using the enumitem package. But the problem is I have to hard code the section number. Is there a way to populate the section number automatically?

\documentclass{article}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}[leftmargin=,label=Q1.1.\arabic] \item First question \item Second question \end{enumerate}

\end{document}

2 Answers2

1

Bernand's suggestion worked. Below is the complete code

\documentclass{article}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}[leftmargin=,label=\thesubsection.\arabic] \item First question \item Second question \end{enumerate}

\end{document}

1

A global setting is as follows:

\documentclass{article}

\usepackage{enumitem} \renewcommand{\labelenumi}{(\thesection.\theenumi)} %i,ii,iii,...

\title{A Test} \begin{document} \maketitle \section{Enumeration Numbers} \begin{enumerate} \item First question \item Second question \end{enumerate}

\end{document}

And the output is

enter image description here

M. Logic
  • 4,214