% % http://www.fysik.dtu.dk/~schiotz/comp/latextips/
% 
% The standard listmaking environments are defined as special versions
% of the list environment. The list environment contains a large number
% of adjustable parameters, setting the margins, spacing between items
% etc. etc. Some of these, such as \itemsep can be set immediately after
% the \begin command:
% 
% \begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip}
% 
% Others, such as \topsep, cannot be adjusted in this way as it is used
% inside the \begin statement. Anyway, in the spirit of LaTeX these
% spacings should be adjustable in a global way.
% 
% Solution: The tweaklist.sty package redefines the itemize, enumerate
% and description packages, so that all parameters can be adjusted. This
% was done by copying the original definitions, and adding "hook
% commands" that are executed when entering the environment. The hook
% commands are initially empty, but can be redefined with \renewcommand.
% 
% 
% Example: to set \topsep and \itemsep to 0 in the enumerate environment, use: 
% 
% \usepackage{tweaklist}
% \renewcommand{\enumhook}{\setlength{\topsep}{0pt}%
%   \setlength{\itemsep}{0pt}}
% 
% The following hook commands are defined: enumhook for the enumerate
% environment, itemhook for the itemize environment, and descripthook
% for the description environment.
% 
% LaTeX keeps track of nested enumerate and itemize environments. If you
% only want to modify a specific nesting level, you should not use
% enumhook or itemhook. Special hooks are defined that are only called
% at the specific level. For the enumerate environment they are
% enumhooki, enumhookii, enumhookiii, and enumhookiv. For the itemize
% environment they are itemhooki, itemhookii, itemhookiii, and
% itemhookiv. The level-specific hooks are called after the global hook,
% so they can redefine a setting in the global hook. As LaTeX does not
% keep track of the nesting level of description environments, there are
% no level-specific hooks for that environment.
% 

\def\enumhook{}
\def\enumhooki{}
\def\enumhookii{}
\def\enumhookiii{}
\def\enumhookiv{}
\def\itemhook{}
\def\itemhooki{}
\def\itemhookii{}
\def\itemhookiii{}
\def\itemhookiv{}
\def\descripthook{}
\def\enumerate{%
  \ifnum \@enumdepth >\thr@@\@toodeep\else
    \advance\@enumdepth\@ne
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
      \expandafter
      \list
        \csname label\@enumctr\endcsname
        {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}%
          \enumhook \csname enumhook\romannumeral\the\@enumdepth\endcsname}%
  \fi}
\def\itemize{%
  \ifnum \@itemdepth >\thr@@\@toodeep\else
    \advance\@itemdepth\@ne
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \expandafter
    \list
      \csname\@itemitem\endcsname
      {\def\makelabel##1{\hss\llap{##1}}%
        \itemhook \csname itemhook\romannumeral\the\@itemdepth\endcsname}%
  \fi}
\renewenvironment{description}
                 {\list{}{\labelwidth\z@ \itemindent-\leftmargin
                          \let\makelabel\descriptionlabel\descripthook}}
                 {\endlist}

