6

I have several lists, I want all of them to have {\labelwidth}{2cm}, and {\labelsep}{1cm}. How can I do it, instead of writing the following everywhere?

\begin{list}{\stepcounter{enumi} Person \arabic{enumi}:\ }
{
\setlength{\labelwidth}{2cm}
\setlength{\labelsep}{1cm}
}
\end{list}

I tried this with no success

\let\oldlist\list
\renewcommand{\list}
{
\setlength{\labelwidth}{2cm}
\setlength{\labelsep}{1cm}
\oldlist
}

it is buggy, the item numbers seems mixed up. What is the correct way of doing it?

1 Answer 1

10

Using enumitem and the code from your previous question.

You can use

\setlist{labelwidth=2cm,labelsep=1cm}

and these values will be used for all your lists.

MWE

\documentclass{article}
\usepackage{enumitem}

\setlist{labelwidth=2cm,labelsep=1cm}

\begin{document}

\begin{enumerate}
\item 5 + 7 = 12
\item 9 + 1 = 10
\item 2 * 2 = 4
\end{enumerate}

\begin{itemize}
\item 5 + 7 = 12
\item 9 + 1 = 10
\item 2 * 2 = 4
\end{itemize}

\end{document} 

Output:

enter image description here


If you want different behaviors for different types of lists, you have to specify the optional argument of \setlist. For example

\setlist[enumerate]{labelwidth=2cm,labelsep=1cm}
\setlist[itemize]{labelwidth=2cm,labelsep=2cm}

gives you this result

enter image description here

2
  • how can I modify, if I want enumerate and itemize to have different margins?
    – Emmet B
    Jan 18, 2014 at 10:21
  • 1
    @EmmetB added in the answer Jan 18, 2014 at 10:30

You must log in to answer this question.

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