Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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)

share|improve this question
    
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

2 Answers 2

up vote 6 down vote accepted

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}
share|improve this answer
    
You were 5sec faster :-) –  Martin Scharrer Jul 28 '11 at 17:19
2  
@Andres: See also my answer to Defining environments based on other ones: What's the right way? for an explanation between the higher and lower level form. –  Martin Scharrer Jul 28 '11 at 17:20
1  
8sec faster, in my case ;-) –  Gonzalo Medina Jul 28 '11 at 17:21

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

share|improve this answer
1  
\enumitem is probably the one to use. See this for a comparrison between paralist and enumitem –  Peter Grill Jul 28 '11 at 17:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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