I have an enumeration environment in my LaTeX document consisting of several numbered steps. Now I need to indent some of these steps. I am using the following command to achieve this indentation for one item:
{\setlength\itemindent{2cm}
\item Some item text...
}
It works for short item texts, but in the case of longer texts that lead to line breaks, the subsequent lines are not indented. See the following LaTeX code for an example:
\begin{enumerate}
\item This is a normal item without any indentation.
{\setlength\itemindent{2cm}
\item This is an indented item with a long text that causes a line break. Unfortunately, the new line is not indented.
}
\item This is a normal item without any indentation.
\end{enumerate}
(Unfortunately I am not allowed to post an image of the output as I'm a new user…)
The first line of the second item is indented by 2cm, but all subsequent lines are not. Can anyone give me a hint on how to get the subsequent lines indented, too?
Best Answer
As ErikYou suggests, one normally would nest an enumerated list within an enumerated list to get this effect. However, in your case, this would in effect start a new list with its own counter. So, I would suggest you use the
IndentedEnumerate
environment defined below which starts the nested list so that its enumeration continues on from the previous list and yields:Notes:
\item[]
before starting theIndentedEnumerate
environment.enumitem
package package, the only tweaks necessary should be to modify how thelabel
is specified for the indented list.showframe
package was used just to show the page margins.Code: