6

Suppose, it's necessary to change the most of itemize or enumerate parameters globally (it's not elegant to change the parameters inside every itemize or enumerate environment). If to write something like

\renewcommand{\@listI}{
\leftmargin=5mm
\labelsep=5mm
\itemindent=0mm
\listparindent=3mm}

it will not work in standard LaTeX classes. Also, it's possible to create own itemize like

\newenvironment{itemizetest}
{\begin{list}{$\bullet$}{
\leftmargin=5mm
\labelwidth=3mm
\labelsep=3mm
}}{\end{list}}

but it's just one-level itemize (not nested).

  1. Is it possible to change default parameters of itemize/enumerate globally (in preamble)?
  2. If to create own itemize or enumerate, is it possible to create 2nd level (nested)?
2
  • The enumitem package offers such possibilities. You can look at its documentation with texdoc enumitem.
    – Guido
    Jun 4, 2013 at 18:39
  • You already provided the answer, by tagging with enumitem (-;
    – jmc
    Jun 5, 2013 at 6:35

1 Answer 1

6

enumitem provides a dedicated way of dealing with this. Read more about it under section 5 Global settings (p 9) in the enumitem documentation.

The main interface provides:

\setlist[enumerate,<levels>]{<format>}
\setlist[itemize,<levels>]{<format>}
\setlist[description,<levels>]{<format>}
\setlist[<levels>]{<format>}

which can be used to set the <format> for different <levels> of the lists enumerate, itemize and description, or globally for all. Without <levels>, it applies to all levels.

The following illustration shows a nested enumerate/itemize list using the default settings on the left, while \setlist[enumerate]{noitemsep,label*=\arabic*.} has been applied to the same nested structure on the right:

enter image description here

As may be seen, only enumerate has no separation between items and a nested \arabic*. label style as supplied through \setlist.

\documentclass{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}

\noindent
\begin{minipage}[t]{0.5\textwidth}
\begin{enumerate}
  \item First item
  \begin{itemize}
    \item Second item
    \item Third item
    \begin{enumerate}
      \item Fourth item
      \item Fifth item
    \end{enumerate}
    \item Sixth item
    \begin{itemize}
      \item Seventh item
      \item Eighth item
    \end{itemize}
    \item Ninth item
  \end{itemize}
  \item Tenth item
\end{enumerate}
\end{minipage}%
\begin{minipage}[t]{0.5\textwidth}
\setlist[enumerate]{noitemsep,label*=\arabic*.}
\begin{enumerate}
  \item First item
  \begin{itemize}
    \item Second item
    \item Third item
    \begin{enumerate}
      \item Fourth item
      \item Fifth item
    \end{enumerate}
    \item Sixth item
    \begin{itemize}
      \item Seventh item
      \item Eighth item
    \end{itemize}
    \item Ninth item
  \end{itemize}
  \item Tenth item
\end{enumerate}
\end{minipage}

\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .