I have a class file in which I need to set up the enumerate
and the inline version enumerate*
(as provided by the enumitem
package with option inline
). As defined, the two environments share labels, settings, etc.
I want them to be able to share levels (i.e. an enumerate*
environment nested inside an enumerate
environment is recognised to be at level 2), but I need to be able to adjust the formatting on the enumerate*
environment (among other adjustments, I want this to start on a new line).
The problem is that I can't change enumerate*
(e.g. using \setlist
) without also changing enumerate
. I can get around that by using (e.g.) \renewlist{enumerate*}{enumerate*}{3}
, but then the nesting gets lost.
Here is a MWE:
\documentclass{article}
\usepackage[inline]{enumitem}
\setlist[enumerate]{align=left,leftmargin=8mm,labelsep*=0pt}
\setlist[enumerate,1]{label=(\alph*), ref=(\alph*)}
\setlist[enumerate,2]{label=(\roman*), ref=(\roman*),leftmargin=9mm}
\begin{document}
Here's a non-nested inline enumerate list:
\begin{enumerate*}
\item blah
\item blah
\item blah
\end{enumerate*}
\begin{enumerate}
\item blah
\item Here's a nested inline list:
\begin{enumerate*}
\item blah
\item blah
\item blah
\end{enumerate*}
\end{enumerate}
\end{document}
In this MWE, the challenge is to modify the preamble in order for both inline lists to start on a new line, but for the nested one to use \roman*
labelling, while the non-nested ones uses \alph*
.
Bonus points if you can do it entirely within enumitem
, as the users of the class file would like to have features such as [resume]
available.
Best Answer
Rather than try to exchange code via comments, I thought I would just post what I have.
Here, I introduce the
inumerate
environment that is an inlineenumerate*
variety that modifies certain parameters of the enumeration that the OP seemed interested in.The above does not support
resume
becauseinumerate
, being an environment, is grouped, and the data necessary toresume
are lost. Here I instead provide a pseudo-environmentxnumerate
that will supportresume
.I also provide the original
inumerate
environment, modified to take additional optional arguments (exceptresume
).