\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{thinlist} [1996/09/28 1.00 Adapted from mdwlist.dtx] % \end{meta-comment} % % \begin{macro}{\makecompactlistn} % % We're given two arguments: the name of the new environment to create, and % the name of the existing list environment to create. % % The first thing to do is to ensure that the environment we're creating is % actually valid (i.e., it doesn't exist already, and it has a sensible % name). We can do this with the internal \LaTeX\ macro |\@ifdefinable|. % % \begin{macrocode} \def\makecompactlistn#1#2{% \expandafter\@ifdefinable\csname#1\endcsname% {\makecompactlistn@i{#1}{#2}}% } % \end{macrocode} % % We also ought to ensure that the other environment already exists. This % isn't too tricky. We'll steal \LaTeX's error and message for this. % % \begin{macrocode} \def\makecompactlistn@i#1#2{% \@ifundefined{#2}{\me@err{Environment `#2' not defined}\@ehc}{}% % \end{macrocode} % % Now to build the new environment. I'm using |\edef| because it makes % life easier, I think. % % \begin{macrocode} \expandafter\edef\csname#1\endcsname{% % \end{macrocode} % % First we open the list environment % % \begin{macrocode} \expandafter\noexpand\csname#2\endcsname% % \end{macrocode} % % Now fiddle with the list environment parameters to remove extraneous % vertical space. % % \begin{macrocode} \parskip\z@% \itemsep\z@% % \end{macrocode} % This is what I added (Nick), to make these lists Really thin: % \begin{macrocode} \topsep\z@% \partopsep\z@% \parsep\z@% % \end{macrocode} % That's all we need to do here. % % \begin{macrocode} }% % \end{macrocode} % % Now to define the end of the environment; this isn't terribly difficult. % % \begin{macrocode} \expandafter\let\csname end#1\expandafter\endcsname% \csname end#2\endcsname% % \end{macrocode} % % That's a compacted environment created. Easy, no? % % \begin{macrocode} } % \end{macrocode} % % \end{macro} % % \begin{environment}{itemize**} % \begin{environment}{enumerate**} % \begin{environment}{description**} % % Let's build some compacted environments now. These are easy now that % we've done all the work above. % % \begin{macrocode} \makecompactlistn{itemize**}{itemize} \makecompactlistn{enumerate**}{enumerate} \makecompactlistn{description**}{description} % \end{macrocode} % % \end{environment} % \end{environment} % \end{environment} % %