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)

  • There's no need to use braces around each item: you can use \item First instead of \item{First}. – Gonzalo Medina Jul 28 '11 at 17:41
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}
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.