5

The following code produces a result, that I find quite strange:

\documentclass{article}
\let\origenumerate\enumerate
\renewenvironment{enumerate}{\begin{origenumerate}}{\end{origenumerate}}

\begin{document}

\begin{enumerate}
\item{First}
\begin{enumerate}
    \item{First-1}
    \item{First-2}
\end{enumerate}
\item{Second}
\end{enumerate}

\end{document}

Actual result:

    1. First
        (a) First-1
    (b) First-2
2. Second

Expected result (as without third line in code):

    1. First
        (a) First-1
        (b) First-2
    2. Second

Why is this so? How can I redefine \enurate to use custom \parskip and \itemsep without getting this kind of (bad) jokes?

edit: I am using pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)

lockstep
  • 250,273
Andres
  • 661

2 Answers2

6

Usually in these cases you need to use the lower-level internal commands for the environment, and also remember about the \end... one. Try

\documentclass{article}
\let\origenumerate\enumerate
\let\origendenumerate\endenumerate
\renewenvironment{enumerate}{\origenumerate}{\origendenumerate}

\begin{document}

\begin{enumerate}
\item{First}
\begin{enumerate}
    \item{First-1}
    \item{First-2}
\end{enumerate}
\item{Second}
\end{enumerate}

\end{document}
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
2

If all you want to do is change the spacing, a package like enumitem is probably safer than this kind of low level hacking.

Seamus
  • 73,242