How can i create this list in Latex
Here's my MW
\documentclass{book}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=Group \arabic*.]
\item
\begin{enumerate}[label=\alph*)]
\item very very very very very very very very very very very very very very long Text 1
\item very very very very very very very long sentence 2
\item very very very very very very very long sentence 3
\item very very very very very very very very very very very very very very long sentence 4
\end{enumerate}
\item
\begin{enumerate}[label=\alph*)]
\item very very very very very very very very very very very very very very very very very very very very very long sentence 1
\item very very very very very very very long sentence 2
\item very very very very very very very long sentence 3
\item very very very very very very very long sentence 4
\end{enumerate}
\end{enumerate}
\end{document}
Is it possible to add text above line
Best Answer
Edit
My first solution was causing havoc with the way that enumitem aligns labels and the item text, so I have changed it slightly so that I now use the
enumitem
\SetLabelAlign
command. This is, in fact, slightly easier than what I did previously.Here is a different approach where I define a new
enumerate
like environment calledunderrated
-- since we areunder
lining in an enumerate
environment:The idea is to define a new "alignment style",
underline
, that will put the line before the item labels. There is a catch, however, in that when there is some text to be underlined, like theunderline me
in\item[underline me]
, we need to "pass" this text from\item
back to theunderline
style. This is done by hijacking the\item
command and replacing it with\underlineItem
:So all that this really does is define
\underratedText
, which is used in the new label alignment style, and then call the real\item
. To define this style we essentially just underline the text, following the example in theenumitem
manual:For good measure I also defined a new enumerate like environment,
MyGroup
, for the groups. With this set up, the code:produces
The
\mbox
's after the\item
are necessary to forceenumerate
to start a new line; see Forcing new line after item number in enumerate environment.Here is the full code: