2

The wide feature of enumitem package effectively makes the item label part of the text, instead of setting the margin of the following text left of the label. I would like to use the wide feature, but I do not want this behavior in the case where a list item is immediately followed by another list:

enter image description here

Do you know how I can tweak the behavior of the list so that sublist items are intended correctly? I went through the manual and searched online, but could not find any information that I thought was relevant.

Here is the MWE:

\documentclass[11pt, a4paper]{article}
\usepackage{enumitem}

\newlist{test}{enumerate}{2}
\setlist[test, 1]{label = (\alph*), wide = 0pt}
\setlist[test, 2]{label = \roman*.}

\begin{document}

\begin{test}
\item
\begin{test}
\item This item is OK.
\item This item should be indented.
\item This item should be indented as well.
\end{test}
\end{test}

\end{document}

Thanks for your help!

1

A solution, if I uderstand well what you want, consists in making the sublist wide, but with a left alignment. Here are two ways, differing in the leftmargin of the sublist:

\documentclass[11pt, a4paper]{article}
\usepackage{enumitem}

\newlist{test}{enumerate}{2}
\setlist[test, 1]{label = (\alph*), wide = 0pt}
\setlist[test, 2]{label = \roman*., wide = 3em, align = right}

\begin{document}

\begin{test}
\item \leavevmode\vspace*{-\dimexpr\baselineskip + \topsep \relax}
\begin{test}
\item This item is OK.
\item This item \emph{is} indented.
\item This item is indented as well. This item is indented as well. This item is indented as well. This item is indented as well.
\end{test}
\item \leavevmode\vspace*{-\dimexpr\baselineskip + \topsep \relax}
\begin{test}[ leftmargin = \dimexpr3em + \labelwidth + \labelsep\relax]
\item This item is OK.
\item This item \emph{is} indented.
\item This item is indented as well. This item is indented as well. This item is indented as well. This item is indented as well.
\end{test}
\end{test}

\end{document} 

enter image description here

  • Thanks for answering both of my questions about lists =) The solution works perfectly. – void-pointer Oct 25 '14 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.