4

I want that a list that is inside a list ignores that it is the second level of depth:

\documentclass[11pt]{amsart}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}
\item A
    \begin{enumerate}
    \item C
    \item D
    \end{enumerate}
\item B
\end{enumerate}
\end{document}  

should give me something like:

1.A

1.C

2.D

2.B

I don't want to change the definition of enumii...

Is there an easy way to tell the second (inside) list that it should be a list of level 1?

3
  • Can you be more specific? What should happen if there are more items in the nested list? Should there be no indent and the item number be the same?
    – egreg
    Dec 12 '14 at 16:05
  • I added a second item to this list. It should just count from 1 to n.
    – mimi
    Dec 12 '14 at 16:07
  • No indentation? Sorry, but I don't understand. Even less after reading your comment to cmhughes' answer.
    – egreg
    Dec 12 '14 at 16:11
3

This is very easy with the enumitem package.

You have to set [label=\arabic*.] as options for the outer enumerate and [label=\arabic*.,leftmargin=0pt] for the inner one.

MWE:

\documentclass[11pt]{amsart}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\arabic*.]
\item A
    \begin{enumerate}[label=\arabic*.,leftmargin=0pt]
    \item C
    \item D
    \end{enumerate}
\item B
\end{enumerate}
\end{document} 

Output:

enter image description here

1

It sounds like you need

\setlist[enumerate,2]{label=(\arabic*)}

Here's a complete example:

% arara: pdflatex 
\documentclass[11pt]{amsart}
\usepackage{enumitem}
\setlist[enumerate,2]{label=(\arabic*)}
\begin{document}
\begin{enumerate}
\item A
    \begin{enumerate}
    \item C
    \end{enumerate}
\item B
\end{enumerate}
\end{document} 
2
  • Thats of cause possible, but is it also possible to tell the second list that it is "first level"? With your example one would have a problem when there is a second 2 level list where the second list should be like 1.1, 1.2. and so on...
    – mimi
    Dec 12 '14 at 16:08
  • @mimi just to clarify: you'd like one instance of a second level enumerate to behave in one way, and another instance to behave in another?
    – cmhughes
    Dec 12 '14 at 16:11
1

How about

\documentclass[11pt]{amsart}
\usepackage{enumitem}
\newlist{Enumerate}{enumerate}{4}
\setlist[Enumerate]{label=\arabic*}
\begin{document}
\begin{enumerate}
\item A
    \begin{Enumerate}
    \item C
    \item D
    \end{Enumerate}
\item B
\end{enumerate}
\end{document} 

If you do not want to mess with the second level list, then make a different env.

1

enter image description here

\documentclass[11pt]{amsart}
\usepackage{enumitem}
\makeatletter
\def\nest{%
\edef\reset{\c@enumi\the\c@enumi\relax}\c@enumi\z@
}
\makeatother

\begin{document}

\begin{enumerate}
\item A
\nest
%    \begin{enumerate}
    \item C
    \item D
\reset
%    \end{enumerate}
\item B
\end{enumerate}
\end{document} 
2
  • hmmm. if this were to be cross-referenced without benefit of hyperlinking, i would be very confused. Dec 12 '14 at 16:47
  • @barbarabeeton I am confused as well, but presumably the OP asked for it for a reason. Dec 12 '14 at 16: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.