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.

I'm trying to use enumitem to modify my lists so that they're flush to the left side of the paper but so that any nested lists are properly indented.

This is what I've tried:

\documentclass[12pt,letterpaper]{article}
    \usepackage{enumitem}
    \setlist{nolistsep}
    \newenvironment{notes}
        {\begin{itemize}[label=,leftmargin=0em,labelindent=1cm]\ignorespaces}
        {\end{itemize}\ignorespacesafterend}

\begin{document}
\begin{notes}
    \item item 1
    \item item 2
        \begin{notes}
            \item item 2.a
            \item item 2.b
        \end{notes}
\end{notes}

\end{document}

It ends up looking like this:

item 1
item 2
item 2.a
item 2.b

How can I modify it so it looks like this?

item 1
item 2
    item 2.a
    item 2.b
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You can us adjust the \leftmargin once you are inside the notes list:

    \newcommand{\LeftMargin}{0em}%
    \newenvironment{notes}{%
         \begin{itemize}[label=,leftmargin=\LeftMargin,labelindent=1cm]%
          \renewcommand*{\LeftMargin}{1cm}%
          \ignorespaces%
    }{%
        \end{itemize}%
        \ignorespacesafterend%
    }
share|improve this answer
    
Thanks, this worked perfectly. Just out of curiosity, why do you append the % symbol to the end of each of your lines? –  Michael0x2a Nov 4 '12 at 18:42
    
@Michael0x2a: The percent signs here are intended to suppress a spurious space in the output. I learned the hard way as per Tex Capacity Exceeded (if remove % after use of macro), so I tend to add them always. BUT, before you start doing that you should also see When is it harmful to add percent character at end of lines in a \newcommand, or similar as there are cases where you don't want to do that. –  Peter Grill Nov 4 '12 at 18:47
add comment

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.