# how do I change the following macro to let me add labels or to enumerate using numbers?

I have the following macro that I found:

\newenvironment{itemizetight}[2]
{\begin{list}{\labelitemi}{%
\setlength{\itemsep}{#1}%
\setlength{\labelwidth}{#2}%
\setlength{\leftmargin}{\labelwidth}%
}%
}
{\end{list}}


However, it does not let me use \item[1.]. How can I change it so that I can use labels like in a typical itemize environment? Or alternatively, what would be the parallel for an enumerate environment?

The way to use it, for example is:

\begin{itemizetight}{-0.2em}{0.5em}
\item item 1
\item item 2
\end{itemizetight}

-
You should look up the enumitem package; it would make your life easier for this sort of things. –  Jubobs Jan 13 '14 at 13:19
I can't see any reason why \item should not work as usual (since you show no code that changes it) Please always include a complete document that shows the problem. –  David Carlisle Jan 13 '14 at 13:20

Apart from the fact that I'm able to use things like \item[1.] inside your itemizetight environment, the "parallel" for the enumerate environment could be:

\newenvironment{enumtight}[2]
{\begin{list}{\labelenumi}{%
\usecounter{enumi}%
\setlength{\itemsep}{#1}%
\setlength{\labelwidth}{#2}%
\setlength{\leftmargin}{\labelwidth}%
}%
}
{\end{list}}


You only have to change \labelitemi to \labelenumi and add the line \usecounter{enumi} to let the list use this counter.

MWE:

\documentclass{article}

\newenvironment{itemizetight}[2]
{\begin{list}{\labelitemi}{%
\setlength{\itemsep}{#1}%
\setlength{\labelwidth}{#2}%
\setlength{\leftmargin}{\labelwidth}%
}%
}
{\end{list}}

\newenvironment{enumtight}[2]
{\begin{list}{\labelenumi}{%
\usecounter{enumi}%
\setlength{\itemsep}{#1}%
\setlength{\labelwidth}{#2}%
\setlength{\leftmargin}{\labelwidth}%
}%
}
{\end{list}}

\begin{document}

\begin{itemizetight}{-0.2em}{0.5em}
\item[1.] item 1
\item[2.] item 2
\end{itemizetight}

\begin{enumtight}{-0.2em}{0.5em}
\item item 1
\item item 2
\end{enumtight}

\end{document}


Output:

-