0

I want to create list like attached pic enter image description here

I try this command

\begin{enumerate}
\item xxx
\begin{enumerate}
\item A
\item B
\end{enumerate}
\begin{enumerate}
\item yy
\end{enumerate}
 \end{enumerate}

But output is different. How to fix that?

Norman
  • 475
  • 2
    I'd suggest you use the enumitem package. Using \item [Xxx] will get you the first level list. For the second level list you can use \begin{enumerate}[label=\arabic*] and for subsequent lists where you want the numbering to continue you need to indicate that the numbering is to continue: \begin{enumerate}[label=\arabic*, resume*]. – Peter Grill Feb 04 '22 at 05:59
  • For future reference, while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. A particular solution is often dependent on the packages that you are using. – Peter Grill Feb 04 '22 at 06:01
  • 1
    Not sure if you intend the XXX/YYY/ZZZ to be item-like aligned or normal-text-like aligned, but in the latter case duplicate of enumerate - Resuming a list - TeX - LaTeX Stack Exchange – user202729 Feb 04 '22 at 06:07

1 Answers1

3

Possible solution:

\documentclass{article}
\usepackage{enumitem}

\begin{document} \begin{description}[nosep] \item[xxx] \mbox{} \begin{enumerate} \item A \item B \item C \end{enumerate} \item[yy] \mbox{} \begin{enumerate}[resume] \item D \item E \end{enumerate} \item[yy] \mbox{} \begin{enumerate}[resume] \item F \item G \item H \item I \end{enumerate} \end{description} \end{document}

enter image description here

But it can also be:

\documentclass{article}
\usepackage{enumitem}

\begin{document} \noindent% xxx \begin{enumerate} \item A \item B \item C \end{enumerate} yy \begin{enumerate}[resume] \item D \item E \end{enumerate} zz
\begin{enumerate}[resume] \item F \item G \item H \item I \end{enumerate} \end{document}

enter image description here

Zarko
  • 296,517