I would like to have an environment, let's call it nested
, which produces output like
Case 1: top level item 1
Case 2: top level item 2
Case 2.1: nested item 1
Case 2.2: nested item 2
Case 2.2.1: even nestier item 1
Case 2.3: just nested again
Case 3: and toplevel to top it off
from code that either looks like nested enumerate
's, i.e.
\begin{nested}
\item top level item 1
\item top level item 2
\begin{nested}
\item nested item 1
\item nested item 2
\begin{nested}
\item even nestier item 1
\end{nested}
\item just nested again
\end{nested}
\item and toplevel to top it off
\end{nested}
or from code that looks, well, like nested environments:
\begin{nested} top level item 1 \end{nested}
\begin{nested} top level item 2
\begin{nested} nested item 1 \end{nested}
\begin{nested} nested item 2
\begin{nested} even nestier item 1 \end{nested}
\end{nested}
\begin{nested} just nested again \end{nested}
\end{nested}
\begin{nested} and toplevel to top it off \end{nested}
In fact, I don't much care how the code has to look at all, as long as the numbering on the cases is done automatically. I tried to implement both of the above, however, and I could not figure it out at all. Is there a way to achieve this?