1

I want to be able to indent individual items in an enumerate environment.
I know about {\setlength\itemindent{25pt} \item Text}, but this fail when the content of the item breaks into a new line:

enter image description here

MWE:

\documentclass[a4paper,12pt]{article}

\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{enumitem}
\begin{document}
    \begin{enumerate}
        \item \lipsum[2]
        
        {\setlength\itemindent{25pt} \item \lipsum[2] }
    \end{enumerate}
\end{document}

How can I indent the whole text of the indented item as well?
[EDIT: Without nesting environments. I would like to have a solution that works dynamically.]

0

One way would be to nest enumerate though you will need to update the item counter:

\documentclass{article}
\usepackage{lipsum}
\usepackage{hang}
\begin{document}
\begin{enumerate}
\item \lipsum[1]

\begin{enumerate} %<--
\item[2.] \lipsum[2] %<--
\end{enumerate} %<--
\setcounter{enumi}{2} %<--

\item \lipsum[3]

\end{enumerate}
\end{document}

enter image description here

0

Another solution...

\documentclass[a4paper,12pt]{article}

\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{paralist}

\begin{document}
    \begin{enumerate}
        \item \lipsum[2]
        %
        {\setlength\itemindent{0.1\textwidth}
        \item 
            \begin{minipage}[t]{0.82\textwidth} % manually adjust width
              \lipsum[2] 
            \end{minipage}
        }
    \end{enumerate}
\end{document}

with results--

img

0

I created a custom environment that deals with all the counter business (similar to what Dan suggested in his answer, but without the need of messing with the counters in the document itself). However, you would need a new environment for each layer of indention. This could be achieved by concatenating an additional i to each countername. (i.e. enumi->enumii and enumii->enumiii etc.. I demonstrated how that works for the 2nd level of indention)

Heres my code:

\documentclass[a4paper,12pt]{article}

\usepackage{lipsum}
\usepackage[shortlabels]{enumitem}

\newenvironment{enumindent}
{\begin{enumerate}[label=(\arabic*),start=\value{enumi},leftmargin=20pt] \stepcounter{enumii} }
    {\end{enumerate}\setcounter{enumi}{\value{enumii}}}
\newenvironment{enumindenttwice}
{\begin{enumerate}[label=(\arabic*),start=\value{enumii},leftmargin=20pt] \stepcounter{enumiii} }
    {\end{enumerate}\setcounter{enumii}{\value{enumiii}}}

\begin{document}
    
    \begin{enumerate}[(1)]
        \item \lipsum[2]
        \item \lipsum[2]
        \begin{enumindent}
            \item \lipsum[2]
            \item \lipsum[2]
            \begin{enumindenttwice}
                \item \lipsum[2]
                \item \lipsum[2]
            \end{enumindenttwice}
            \item \lipsum[2]
            \item \lipsum[2]
        \end{enumindent}
        \item \lipsum[2]
        \item \lipsum[2]
    \end{enumerate}
\end{document}

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.