8

I would like to make a custom indenting for lists:

  1. Bullet or number is indented 1.2 cm from the left margin
  2. Text (all lines) is indented 1.8 cm from the left margin

I am trying to use the enumitem package. It is easy to indent text with leftmargin option, but I can not succeed with bullet/number indenting. I have tried different values for itemindent, labelindent, labelwidth and labelsep but have not achieved the result I am looking for.

Here is MWE.

\documentclass{article}

\usepackage{enumitem}
\setlist{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt, leftmargin=1.8cm}

\begin{document}

\noindent Here is some text.

\begin{itemize}
    \item \( y_i = 1 \) if individual \( i \) is employed is employed is employed is employed is employed is employed is employed is employed is employed is employed,
    \item \( y_i = 2 \) if individual \( i \) is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed,
    \item \( y_i = 3 \) if individual \( i \) is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive.
\end{itemize}
\noindent \rule{1.2cm}{1pt}$\bullet$ \par
\noindent \rule{1.8cm}{1pt} \par

\begin{enumerate}
    \item \( y_i = 1 \) if individual \( i \) is employed is employed is employed is employed is employed is employed is employed is employed is employed is employed,
    \item \( y_i = 2 \) if individual \( i \) is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed,
    \item \( y_i = 3 \) if individual \( i \) is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive.
\end{enumerate}
\noindent \rule{1.2cm}{1pt}3 \par
\noindent \rule{1.8cm}{1pt} \par

\noindent Here is some text.

\end{document}

1 Answer 1

8

I used some boxes to calculate the widths:

enter image description here

\documentclass{article}

\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\setbox1=\hbox{$\bullet$}
\setlist{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt, leftmargin=1.8cm, labelindent=1.2cm, labelwidth=\wd1, itemindent=*, labelsep=\dimexpr0.6cm-\wd1}

\begin{document}

\noindent Here is some text.

\begin{itemize}
    \item \( y_i = 1 \) if individual \( i \) is employed is employed is employed is employed is employed is employed is employed is employed is employed is employed,
    \item \( y_i = 2 \) if individual \( i \) is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed,
    \item \( y_i = 3 \) if individual \( i \) is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive.
\end{itemize}
\noindent \rule{1.2cm}{1pt}$\bullet$ \par
\noindent \rule{1.8cm}{1pt} \par

\setbox1=\hbox{1.}
\setlist{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt, leftmargin=1.8cm, labelindent=1.2cm, labelwidth=\wd1, itemindent=*, labelsep=\dimexpr0.6cm-\wd1}

\begin{enumerate}
    \item \( y_i = 1 \) if individual \( i \) is employed is employed is employed is employed is employed is employed is employed is employed is employed is employed,
    \item \( y_i = 2 \) if individual \( i \) is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed,
    \item \( y_i = 3 \) if individual \( i \) is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive.
\end{enumerate}
\noindent \rule{1.2cm}{1pt}3 \par
\noindent \rule{1.8cm}{1pt} \par

\noindent Here is some text.

\end{document}

The enumitem documentation presents a graphic of the composition of lengths regarding its horizontal spacing,. leftmargin is constructed from 4 others lengths; or you could specify all but one using * and it will be calculated. See section 3 More on horizontal spacing, p 5. As is evident, it may be tricky to find out exactly which lengths go where...

enter image description here

1
  • I found out it is better to use setbox9 and wd9 accordingly. Usage of setbox1 and wd1 sometimes does not give the expected result. Probably they get over-written by some other command.
    – djhurio
    Commented Jan 18, 2013 at 8:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .