I'm trying to typeset a numbered list in which I'm overriding the default enumerate
behaviour using enumitem so that there's text in addition to a number. I'd like the text to be flush with the left margin, and I've found this solution to that particular problem.
However, My problem turns out to be more complicated. In addition, I sometimes need to override the regular overrided behaviour of my enumerate
environments mid-list by including different text for some items mid-list. I'd like these items to still be flush with the left margin. For example:
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage{calc}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\subsection*{Using description}
\begin{description}
\item[\bfseries Item 1:] Left margin: \the\leftmargin
\item[\bfseries Much longer item 2:] Right margin: \the\rightmargin
\item[\bfseries Item 3:] Listparindent: \the\listparindent
\item[\bfseries Item 4:] Label width: \the\labelwidth
\item[\bfseries Item 5:] Label sep: \the\labelsep
\item[\bfseries Item 6:] Label indent: \the\labelindent
\item[\bfseries Item 7:] Item indent: \the\itemindent
%\item[\bfseries Much longer item 8:] \lipsum[2]
\end{description}
\subsection*{Using enumerate}
\begin{enumerate}[label={\bfseries Item \arabic*:},labelindent=0pt,labelwidth=\widthof{\ref{last-item}},itemindent=1em,leftmargin=!]%itemindent=-20pt, labelwidth=0pt]
\item Left margin: \the\leftmargin
\item[\bfseries Much longer item 2]: Right margin: \the\rightmargin
\stepcounter{enumi}
\item Listparindent: \the\listparindent
\item Label width: \the\labelwidth
\item Label sep: \the\labelsep
\item Label indent: \the\labelindent
\item Item indent: \the\itemindent \label{last-item}
%\item \lipsum[2]
\end{enumerate}
\lipsum[3]
\end{document}
I've included a description
environment for comparison: this is what I'd like my enumerate to look like.
So basically, I'm looking for a way to make enumerate
behave like description
in terms of horizontal spacing, but I don't want to just use description
because the automated numbering of items is important. Any ideas?