3

I'm having some troubles with the customisation of the indent of itemize environment. My MWE is:

\documentclass{article}
    \usepackage{lipsum}
    \usepackage[utf8]{inputenc}
    \usepackage{enumitem}

\begin{document}%

\lipsum[1-2]

\begin{itemize}[leftmargin=3cm]
    \item [My custom item long long long long]: \lipsum[1]
    \item [My custom item short]: \lipsum[2]
\end{itemize}

\end{document}%

The output:

enter image description here

Now, i would like to have the two custom labels at the same width, and not one more indented of another. Plus I would like to decide where the text of the item stars (in this case, due to the [leftmargin=3cm] option is too much indented, otherwise the two labels wouldn't have been inside the page).

How can I deal with margins, alignment and indentation od itemize/enumerate? Thanks for help!

P.S.: The next image will eventually clarify what I would like to have

enter image description here

  • Do you absolutely want labels going in the margin? – Bernard Jul 21 '17 at 19:19
  • I really wish they have the same left margin yes, as it happens When you do not define custom labels. For the text width I can turn a blind eye to... – GiuTeX Jul 21 '17 at 19:23
  • 1
    You also might have a multiline label. – Bernard Jul 21 '17 at 19:27
2

Maybe like this, with a custom description environment?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage{lipsum}

\begin{document}%

\lipsum[1-2]
\begin{description}[leftmargin=1cm, labelindent=-3cm, labelsep=0pt, font=\normalfont]
    \item[ My custom item long long long long]: \lipsum[1]
    \item [My custom item short]: \lipsum[2]
\end{description}

\end{document}

enter image description here

|improve this answer|||||
3

Unfortunately, to do the left-alignment of labels, you need to know (or approximate) the width of the widest label, in this case approximated as 5.42cm.

The initial and residual indents are handled by way of a judicious selection of leftmargin and itemindent.

\documentclass{article}
    \usepackage{lipsum}
    \usepackage[utf8]{inputenc}
    \usepackage{enumitem}
\let\svitem\item
\begin{document}%

\lipsum[1-2]

{\renewcommand\item[1][]{\svitem[{\makebox[5.42cm][l]{#1}}]}
\begin{itemize}[leftmargin=1cm,itemindent=2cm]
    \item [My custom item long long long long]: \lipsum[1]
    \item [My custom item short]: \lipsum[2]
\end{itemize}
}
\end{document}

enter image description here

|improve this answer|||||

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.