# Understanding \list and \item[]

In this question, the following solution was offered for creating an indented environment.

\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist


I want to understand this code better.

First of all, I think I get the basic idea of \def and \let, and the difference between them. But does anyone have a good reference for the finer points of these?

Also, I see this \list{} command popping up in a lot of places, and I don't understand what it does. Googling didn't bring a lot of help. And what is this item[] thing doing?

• – David Carlisle Sep 30 '16 at 17:53
• @DavidCarlisle Hi David, thanks for your comment. Maybe it would help if I had a reference for the \list{} command and what it does. Then I could figure out how it accomplishes what you say. – Eric Auld Sep 30 '16 at 17:58

## 1 Answer

\list is the command that underlies \begin{enumerate} and \begin{itemize} (hence its name), but also \begin{quote} \begin{verbatim} , \begin{center} and more or less all display environments in latex. \item[] is the usual \item command as used in enumerate

The changemargin environment shown, like the standard centerand quote environments is implemented as a one item list with no visible item label (hence the \item[] command in the environment definition).

Using the list mechanism is a convenient way to control the paragraph shape and the spacing before and after the environment.

• Thank you! Can you explain why {\rightmargin#2\leftmargin#1} is surrounded by its own set of braces? – Eric Auld Sep 30 '16 at 18:19
• @EricAuld they are not a group, that is the second argument of \list and that macro injects them to set up the inner paragraph setting, after it has handled other details of the setup. – David Carlisle Sep 30 '16 at 19:03