[Tex/LaTex] beautiful list from indesign

enumitemlists

How can i create this list in Latex

enter image description here

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 called underrated -- since we are underlining in an enumerate environment:

\newlist{underrated}{enumerate}{1}% define a new eumerate-like environment
\setlist[underrated]{%
    before=\let\item\underlineItem, % Set \item -> \underlineItem
    align=underline,% use underline "style" above
    label=\alph*),
    ref=\alph*,
    leftmargin=40mm,
    labelwidth=42mm,
}

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 the underline me in \item[underline me], we need to "pass" this text from \item back to the underline style. This is done by hijacking the \item command and replacing it with \underlineItem:

\let\realItem\item% save the original \item command for later use
\newcommand\underlineItem[1][]{%
   \def\underratedText{#1}%  
   \realItem\ignorespaces%
 }

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 the enumitem manual:

\SetLabelAlign{underline}{\parbox[t]\labelwidth{%
   \underline{\hbox to 36mm{\quad\texttt{\underratedText}}}\space#1}%
}

For good measure I also defined a new enumerate like environment, MyGroup, for the groups. With this set up, the code:

  \begin{MyGroup}
    \item\mbox{}
      \begin{underrated}
        \item A lunar eclipse is an omen of a coming disaster
        \item Superstitions have been around forever
        \item[an answer] People hold many superstitious beliefs about
        the moon
        \item[another answer] It is made of green cheese
      \end{underrated}

    \item\mbox{}
      \begin{underrated}
        \item The history of astronomy is interesting
        \item Ice age people recorded the appearance of new moons by
        making scratches in animal bones
        \item For example, Stonehenge in Britain,m build 3500 years
        ago to track the movement of the sun
        \item Ancient people observed and recorded lunar and solar
        events in different ways
      \end{underrated}
  \end{MyGroup}

produces

enter image description here

The \mbox's after the \item are necessary to force enumerate to start a new line; see Forcing new line after item number in enumerate environment.

Here is the full code:

\documentclass{book}
\usepackage{enumitem}

\let\realItem\item% save the original \item command for later use
\newcommand\underlineItem[1][]{%
   \def\underratedText{#1}\realItem\ignorespaces%
}
\SetLabelAlign{underline}{%
   \parbox[t]\labelwidth{%
      \underline{\hbox to 36mm{\quad\texttt{\underratedText}}}%
      \space#1%
   }%
 }

\newlist{underrated}{enumerate}{1}% define a new eumerate-like environment
\setlist[underrated]{%
    before=\let\item\underlineItem, % Set \item -> \underlineItem
    align=underline,% use underline "style" above
    label=\alph*),
    ref=\alph*,
    leftmargin=40mm,
    labelwidth=42mm,
}
\newlist{MyGroup}{enumerate}{1}
\setlist[MyGroup]{
   label=\bfseries Group \arabic*:,
   style=nextline,
   leftmargin=*,
   labelsep=2em,
   itemsep=2em
}

\begin{document}
  \begin{MyGroup}
    \item\mbox{}
      \begin{underrated}
        \item A lunar eclipse is an omen of a coming disaster
        \item Superstitions have been around forever
        \item[an answer] People hold many superstitious beliefs about
        the moon
        \item[another answer] It is made of green cheese
      \end{underrated}

    \item\mbox{}
      \begin{underrated}
        \item The history of astronomy is interesting
        \item Ice age people recorded the appearance of new moons by
        making scratches in animal bones
        \item For example, Stonehenge in Britain,m build 3500 years
        ago to track the movement of the sun
        \item Ancient people observed and recorded lunar and solar
        events in different ways
      \end{underrated}
  \end{MyGroup}
\end{document}
Related Question