4

I need to write an enumerate list nested inside a description list, like in the following example:

\documentclass[a4paper]{article}
\usepackage[english]{babel}
\title{}
\date{}
\begin{document}
\maketitle

\begin{description}
\item[p] aa
\item[u]
\begin{enumerate}
\item first
\item second
\item third
\end{enumerate}
\item[v] lorem
\item[w] ipsum
\end{description}
\end{document}

However, in the result, the first item of the inner list is not indented as the other items of the inner list:

result

How to fix that?

I noticed that if the description is replaced by enumerate or itemize then the indentation becomes good, but I need to use description.

5

You can use enumitem features, as in the following example

\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage{enumitem}
\title{}
\date{}
\begin{document}
\maketitle

\begin{description}[labelwidth=8pt,leftmargin=\dimexpr\labelwidth+\labelsep\relax]
\item[p] aa
\item[u]
\begin{enumerate}
\item first
\item second
\item third
\end{enumerate}
\item[v] lorem
\item[w] ipsum
\end{description}

\end{document} 

enter image description here

or the following

\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage{enumitem}
\title{}
\date{}
\begin{document}
\maketitle

\begin{description}[labelwidth=8pt,leftmargin=\dimexpr\labelwidth+\labelsep\relax]
\item[p] aa
\item[u]
\begin{enumerate}[leftmargin=*]
\item first
\item second
\item third
\end{enumerate}
\item[v] lorem
\item[w] ipsum
\end{description}

\end{document} 

enter image description here

3

LaTeX goes to some effort to achieve that layout, I've never really understood why, but the default can't be changed now for compatibility reasons. There are probably packages that change this but the simplest direct fix is to use

\item[u]\mbox{}
\begin{enumerate}

or perhaps

\item[u]\mbox{}\\[-2\baselineskip]
\begin{enumerate}

according to the layout you want.

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.