I've created my environment, and modified the enumerate command:
\renewcommand{\labelenumi}{\arabic{enumi}.}
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}
\renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}
\newenvironment{packed_enum}{
\begin{enumerate}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
}{\end{enumerate}}
And this is what i get:
The first two levels align properly (I've marked it with blue line), but the third level starts too much on the left (red line). Can You help me fix this?
I've tried something like this (also with changing labelsep
to \leftmargin
):
\renewcommand{\labelenumi}{\arabic{enumi}.}
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}
\renewcommand{\labelenumiii}{\setlength{\labelsep{5ex}\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}
or this:
\renewcommand{\labelenumi}{\arabic{enumi}.}
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}
\renewcommand{\labelenumiii}{\hbox{\hspace{5ex}\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}}
but neither helped.
Best Answer
With the help of
enumitem
The option
leftmargin=*
ensures that the label is aligned with the surrounding text. Note that I also inserted all\renewcommand
s inside the\newenvironment
to make the changes only locally.MWE:
Output: