# Nested enumeration

I'm trying to create a list of the following type:

1a) Apples

1b) Bananas

1c) Oranges

2a) Tomatoes

2b) Carrots

4a) Cake

I tried to use both enumitem and easylist and read some answers of related questions, but I wasn't successful.

• Could you please show what you tried so far? Will there also be a "parent" to 1a), 1b) and 1c)? – leandriis Apr 1 at 7:55
• If had "parents" then it would be easy to do it with easylist. The point is that I don't – Gil Apr 1 at 9:31
• What is the question? – Peter Mortensen Apr 1 at 15:59
• Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Alessandro Cuttin Apr 1 at 18:16

The proposed syntax is

• a simple \item steps the main counter and just uses it;
• \item[+] steps the main counter and prints it followed by the secondary one;
• \item[=] only steps the secondary counter.
\documentclass{article}
\usepackage{xparse}

\newcounter{bienumi}
\newcounter{bienumii}[bienumi]
\renewcommand{\thebienumi}{%
\arabic{bienumi}\ifnest\alph{bienumii}\fi
}
\newif\ifnest

\newenvironment{bienum}{\enumerate\let\item\biitem}{\endenumerate}

\ExplSyntaxOn\makeatletter
\NewDocumentCommand{\biitem}{o}
{
\nesttrue
\IfNoValueTF{#1}
{
\nestfalse
\stepcounter{bienumi}
}
{
\str_case:nn {#1}
{
{+}{\stepcounter{bienumi}\stepcounter{bienumii}}
{=}{\stepcounter{bienumii}}
}
}
\@item[\thebienumi)]
}
\makeatother\ExplSyntaxOff

\begin{document}

\begin{bienum}
\item[+] Apples

\item[=] Bananas

\item[=] Oranges

\item[+] Tomatoes

\item[=] Carrots